staged-recipes icon indicating copy to clipboard operation
staged-recipes copied to clipboard

Adding r-archive R package

Open pschloss opened this issue 2 years ago • 11 comments

Checklist

  • [x] Title of this PR is meaningful: e.g. "Adding my_nifty_package", not "updated meta.yaml".
  • [x] License file is packaged (see here for an example).
  • [x] Source is from official source.
  • [x] Package does not vendor other packages. (If a package uses the source of another package, they should be separate packages or the licenses of all packages need to be packaged).
  • [x] If static libraries are linked in, the license of the static library is packaged.
  • [x] Package does not ship static libraries. If static libraries are needed, follow CFEP-18.
  • [x] Build number is 0.
  • [x] A tarball (url) rather than a repo (e.g. git_url) is used in your recipe (see here for more details).
  • [x] GitHub users listed in the maintainer section have posted a comment confirming they are willing to be listed there.
  • [x] When in trouble, please check our knowledge base documentation before pinging a team.

Used conda_r_skeleton_helper to create meta.yml and build.sh files.

pschloss avatar Sep 17 '22 17:09 pschloss

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipes/r-archive) and found it was in an excellent condition.

conda-forge-linter avatar Sep 17 '22 17:09 conda-forge-linter

I wonder if anyone can help me with building this recipe. Initially none of the OS's would build. I added libarchive to the requirements: build: and requirements: host: listings from the output of using conda_r_skeleton_helper and that got the linux version to build. Unfortunately, neither os x nor windows are building now. Both of the failed OS's seem to have different error messages. I'm feeling a bit stuck with my skills and googling at this point. If @bgruening or @jdblischak have any suggestions for things to try I'd be very grateful!

os x

installing to /Users/runner/mambaforge/conda-bld/r-archive_1663437129171/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/lib/R/library/00LOCK-work/00new/archive/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
ERROR: loading failed
* removing ‘/Users/runner/mambaforge/conda-bld/r-archive_1663437129171/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/lib/R/library/archive’
Error: package or namespace load failed for ‘archive’:
 .onLoad failed in loadNamespace() for 'archive', details:
  call: dyn.load(lib_path)
  error: unable to load shared object '$SRC_DIR/':
  dlopen($SRC_DIR/, 6): no suitable image found.  Did find:
	$SRC_DIR/: not a file
	$SRC_DIR: not a file
Error: loading failed
Execution halted
Traceback (most recent call last):
  File "/Users/runner/work/1/s/.ci_support/build_all.py", line 223, in <module>
    build_all(os.path.join(root_dir, "recipes"), args.arch)
  File "/Users/runner/work/1/s/.ci_support/build_all.py", line 120, in build_all
    build_folders(recipes_dir, folders, arch, channel_urls)
  File "/Users/runner/work/1/s/.ci_support/build_all.py", line 179, in build_folders
    conda_build.api.build([recipe], config=get_config(arch, channel_urls))
  File "/Users/runner/mambaforge/lib/python3.10/site-packages/conda_build/api.py", line 186, in build
    return build_tree(
  File "/Users/runner/mambaforge/lib/python3.10/site-packages/conda_build/build.py", line 3091, in build_tree
    packages_from_this = build(metadata, stats,
  File "/Users/runner/mambaforge/lib/python3.10/site-packages/conda_build/build.py", line 2214, in build
    utils.check_call_env(cmd, env=env, rewrite_stdout_env=rewrite_env,
  File "/Users/runner/mambaforge/lib/python3.10/site-packages/conda_build/utils.py", line 412, in check_call_env
    return _func_defaulting_env_to_os_environ('call', *popenargs, **kwargs)
  File "/Users/runner/mambaforge/lib/python3.10/site-packages/conda_build/utils.py", line 392, in _func_defaulting_env_to_os_environ
    raise subprocess.CalledProcessError(proc.returncode, _args)
subprocess.CalledProcessError: Command '['/bin/bash', '-o', 'errexit', '/Users/runner/mambaforge/conda-bld/r-archive_1663437129171/work/conda_build.sh']' returned non-zero exit status 1.

windows

g++ -shared -s -o archive.dll tmp.def archive.o archive_extract.o archive_read.o archive_write.o archive_write_direct.o archive_write_files.o cpp11.o r_archive.o -L../windows/libarchive-3.6.1/lib-5.3.0/x64 -L../windows/libarchive-3.6.1/lib/x64 -larchive -lcrypto -lnettle -lregex -lexpat -llzo2 -llzma -llz4 -lbz2 -lzstd -lz -liconv -lbcrypt -LC:/bld/r-archive_1663437177396/_h_env/lib/R/bin/x64 -lR
../windows/libarchive-3.6.1/lib/x64/libarchive.a(archive_write_set_format_iso9660.o):(.text$set_date_time+0x1e5): undefined reference to `__imp__get_timezone'
../windows/libarchive-3.6.1/lib/x64/libarchive.a(archive_write_set_format_iso9660.o):(.text$set_time_915+0x54): undefined reference to `__imp__get_timezone'
../windows/libarchive-3.6.1/lib/x64/libarchive.a(archive_read_disk_windows.o):(.text$tree_reopen+0x28d): undefined reference to `__imp___acrt_iob_func'
../windows/libarchive-3.6.1/lib/x64/libarchive.a(archive_read_disk_windows.o):(.text$tree_reopen+0x2e5): undefined reference to `__imp___acrt_iob_func'
../windows/libarchive-3.6.1/lib/x64/libarchive.a(archive_write_disk_windows.o):(.text$la_GetFunctionKernel32+0x5a): undefined reference to `__imp___acrt_iob_func'
../windows/libarchive-3.6.1/lib/x64/libexpat.a(xmlparse.o):(.text+0x1800): undefined reference to `__imp___acrt_iob_func'
../windows/libarchive-3.6.1/lib/x64/libbz2.a(bzlib.o):(.text+0x689): undefined reference to `__imp___acrt_iob_func'
../windows/libarchive-3.6.1/lib/x64/libbz2.a(bzlib.o):(.text+0x111a): more undefined references to `__imp___acrt_iob_func' follow
collect2.exe: error: ld returned 1 exit status
gcc  -I"C:/bld/r-archive_1663437177396/_h_env/lib/R/include" -DNDEBUG -I../windows/libarchive-3.6.1/include -I. -I'C:/bld/r-archive_1663437177396/_h_env/lib/R/library/cli/include' -I'C:/bld/r-archive_1663437177396/_h_env/lib/R/library/cpp11/include'        -O2 -Wall  -std=gnu99 -march=x86-64 -mtune=generic -c connection/connection.c -o connection/connection.o
mkdir -p ../inst/lib/x64/
g++  -Wl,--export-all-symbols -shared  -L"C:/bld/r-archive_1663437177396/_h_env/lib/R/bin/x64" -lR -o ../inst/lib/x64/libconnection.dll connection/connection.o
connection/connection.o:connection.c:(.text+0x1e): undefined reference to `R_GetConnection'
connection/connection.o:connection.c:(.text+0x1): undefined reference to `R_new_custom_connection'
connection/connection.o:connection.c:(.text+0x33): undefined reference to `R_ReadConnection'
collect2.exe: error: ld returned 1 exit status
make: *** [../inst/lib/x64/libconnection.dll] Error 1
Makevars.win:20: recipe for target '../inst/lib/x64/libconnection.dll' failed
ERROR: compilation failed for package 'archive'
* removing 'C:/bld/r-archive_1663437177396/_h_env/lib/R/library/archive'

(%BUILD_PREFIX%) %SRC_DIR%>IF 1 NEQ 0 exit /B 1 
Traceback (most recent call last):
  File "D:\a\1\s\.ci_support\build_all.py", line 223, in <module>
    build_all(os.path.join(root_dir, "recipes"), args.arch)
  File "D:\a\1\s\.ci_support\build_all.py", line 120, in build_all
    build_folders(recipes_dir, folders, arch, channel_urls)
  File "D:\a\1\s\.ci_support\build_all.py", line 179, in build_folders
    conda_build.api.build([recipe], config=get_config(arch, channel_urls))
  File "C:\Miniforge\lib\site-packages\conda_build\api.py", line 186, in build
    return build_tree(
  File "C:\Miniforge\lib\site-packages\conda_build\build.py", line 3091, in build_tree
    packages_from_this = build(metadata, stats,
  File "C:\Miniforge\lib\site-packages\conda_build\build.py", line 2182, in build
    windows.build(m, build_file, stats=build_stats, provision_only=provision_only)
  File "C:\Miniforge\lib\site-packages\conda_build\windows.py", line 297, in build
    check_call_env(cmd, cwd=m.config.work_dir, stats=stats, rewrite_stdout_env=rewrite_env)
  File "C:\Miniforge\lib\site-packages\conda_build\utils.py", line 412, in check_call_env
    return _func_defaulting_env_to_os_environ('call', *popenargs, **kwargs)
  File "C:\Miniforge\lib\site-packages\conda_build\utils.py", line 392, in _func_defaulting_env_to_os_environ
    raise subprocess.CalledProcessError(proc.returncode, _args)
subprocess.CalledProcessError: Command '['cmd.exe', '/d', '/c', 'conda_build.bat']' returned non-zero exit status 1.
##[error]Cmd.exe exited with code '1'.

pschloss avatar Sep 18 '22 18:09 pschloss

@pschloss I'm not sure exactly how to fix this. Below are various observations/ideas I had while reviewing your PR:

  • libarchive is available cross-platform from conda-forge, so in theory we should be able to build the R package cross-platform as well
  • The macOS package successfully compiled but failed to load
  • The Windows package failed earlier during the compilation step
  • Here are existing recipes that depend on r-cpp11 that might be informative to learn from
  • I didn't see any special steps for building the package in the source repo CI workflow
  • You can probably remove r-cpp11 from the run-time dependencies (source), but that is unrelated to the current errors
  • I suspect the solution will involve defining INCLUDE_DIR and LIB_DIR as described in configure. The package authors are assuming that libarchive is available from Homebrew on macOS and from RTools42 on Windows. For the conda recipe, you'll need to direct the R package towards libarchive installed in the conda environment ($PREFIX/lib)

jdblischak avatar Sep 19 '22 14:09 jdblischak

Hi! This is the friendly automated conda-forge-linting service.

I wanted to let you know that I linted all conda-recipes in your PR (recipes/r-archive) and found some lint.

Here's what I've got...

For recipes/r-archive:

  • noarch packages can't have selectors. If the selectors are necessary, please remove noarch: generic.

conda-forge-linter avatar Sep 19 '22 17:09 conda-forge-linter

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipes/r-archive) and found it was in an excellent condition.

conda-forge-linter avatar Sep 19 '22 17:09 conda-forge-linter

It's not a noarch recipe. It has C++ code to compile in src. That's why the conda skeleton included compilers in the build dependencies.

jdblischak avatar Sep 19 '22 17:09 jdblischak

Hi! This is the friendly automated conda-forge-linting service.

I wanted to let you know that I linted all conda-recipes in your PR (recipes/r-archive) and found some lint.

Here's what I've got...

For recipes/r-archive:

  • Non noarch packages should have r-base requirement without any version constraints.
  • Non noarch packages should have r-base requirement without any version constraints.

conda-forge-linter avatar Sep 27 '22 21:09 conda-forge-linter

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipes/r-archive) and found it was in an excellent condition.

conda-forge-linter avatar Sep 27 '22 21:09 conda-forge-linter

Hi! This is the friendly automated conda-forge-linting service.

I wanted to let you know that I linted all conda-recipes in your PR (recipes/r-archive) and found some lint.

Here's what I've got...

For recipes/r-archive:

  • Selectors are suggested to take a <two spaces>#<one space>[<expression>] form. See lines [25]

conda-forge-linter avatar Sep 27 '22 22:09 conda-forge-linter

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipes/r-archive) and found it was in an excellent condition.

conda-forge-linter avatar Sep 27 '22 22:09 conda-forge-linter

It would be great if @conda-forge/help-r could check out this PR for r-archive. It passes although we did skip building windows version.

pschloss avatar Sep 27 '22 22:09 pschloss

Hi friend!

We really, really, really appreciate that you have taken the time to make a PR on conda-forge/staged-recipes! conda-forge only exists because people like you donate their time to build and maintain conda recipes for use by the community.

In an effort to maintain this repository and increase the signal-to-noise for open PRs, the maintainers of staged-recipes close excessively old PRs after six months. This PR will remain open for another month, and then will be closed.

If you'd like to keep it open, please comment/push and we will be happy to oblige! Note that very old PRs will likely need to be rebased on main so that they can be rebuilt with the most recent CI scripts. If you have any trouble, or we missed reviewing this PR in the first place (sorry!), feel free to ping the team using a special command in a comment on the PR to get the attention of the staged-recipes team.

Cheers and thank you for contributing to this community effort!

stale[bot] avatar Mar 28 '23 23:03 stale[bot]

Hi again! About a month ago, we commented on this PR saying it would be closed in another month if it was still inactive. It has been a month and so now it is being closed. Thank you so much for making it in the first place and contributing to the community project that is conda-forge. If you'd like to reopen this PR, please feel free to do so at any time!

Cheers and have a great day!

stale[bot] avatar May 03 '23 01:05 stale[bot]