conda / conda-build

Commands and tools for building conda packages
https://docs.conda.io/projects/conda-build/
Other
381 stars 421 forks source link

BUG: failing to package dependency-less output #4950

Open h-vetinari opened 1 year ago

h-vetinari commented 1 year ago

Checklist

What happened?

In the current state of https://github.com/conda-forge/flang-feedstock/pull/28, everything gets built during the "global" build.sh / bld.bat phase, and I have an output that only needs to "install" (by copying) a single library into the $PREFIX.

Needless to say, that output doesn't have any build dependencies (beyond cp, which is already there), and it also doesn't need host deps. On unix, this works fine, but on windows, I get:

Packaging libfortran-main
Reloading output folder: D:\bld

## Package Plan ##

  environment location: D:\bld\flang-split_1690513176024\_h_env

(base) D:\bld\flang-split_1690513176024\work>call "C:\Miniforge\Scripts\..\condabin\conda_hook.bat" 

(base) D:\bld\flang-split_1690513176024\work>call "C:\Miniforge\Scripts\..\condabin\conda.bat" activate --stack "D:\bld\flang-split_1690513176024\_h_env" 

EnvironmentLocationNotFound: Not a conda environment: D:\bld\flang-split_1690513176024\_h_env

(base) D:\bld\flang-split_1690513176024\work>cp build\lib\Fortran_main.lib D:\bld\flang-split_1690513176024\_h_env\Library\lib 
cp: cannot create regular file 'D:\bld\flang-split_1690513176024\_h_env\Library\lib': No such file or directory

From what I can tell, conda build doesn't actually create the (empty) host environment, and then fails upon activating it.

Furthermore, that error does not trigger a build failure; the build script is then executed, which obviously fails as well.

Conda Info

conda-forge CI

Conda Config

conda-forge CI

Conda list

conda-forge CI

Additional Context

No response

h-vetinari commented 1 year ago

Actually, it also fails on linux, though that was less obvious because the failure happens while processing the following output. At first I thought it was an intermittent error, but it failed in exactly the same way again:

First it packages the dependency-less output correctly:

Packaging libfortran-main
INFO:conda_build.build:Packaging libfortran-main
Reloading output folder: /home/conda/feedstock_root/build_artifacts

## Package Plan ##

  environment location: /home/conda/feedstock_root/build_artifacts/flang-split_1690529258461/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold

+ cp /home/conda/feedstock_root/build_artifacts/flang-split_1690529258461/work/build/lib/libFortran_main.a /home/conda/feedstock_root/build_artifacts/flang-split_1690529258461/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/lib

Resource usage statistics from bundling libfortran-main:
   Process count: 2
   CPU time: Sys=-, User=0:00:00.0
   Memory: 3.2M
   Disk usage: 4.7M
   Time elapsed: 0:00:03.1

number of files: 1
Fixing permissions
Packaged license file/s.

Then it starts with the following output:

Packaging flang
Reloading output folder: /home/conda/feedstock_root/build_artifacts

## Package Plan ##

  environment location: /home/conda/feedstock_root/build_artifacts/flang-split_1690529258461/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold

The following NEW packages will be INSTALLED:

    _libgcc_mutex:           0.1-conda_forge                conda-forge              
    _openmp_mutex:           4.5-2_gnu                      conda-forge              
    binutils_impl_linux-64:  2.40-hf600244_0                conda-forge
    [...]

but fails upon trying to set up the environment, with the following error:

Rolling back transaction: ...working... ERROR conda.core.link:_execute(740): An error occurred while installing package 'conda-forge::libgcc-devel_linux-64-13.1.0-he3cc6c4_0'.
done
Traceback (most recent call last):
  [...]
  File "/opt/conda/lib/python3.10/site-packages/conda/core/link.py", line 756, in _execute
    raise CondaMultiError(
conda.CondaMultiError: [Errno 20] Not a directory: '/home/conda/feedstock_root/build_artifacts/flang-split_1690529258461/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/lib/gcc'
()
github-actions[bot] commented 2 months ago

Hi there, thank you for your contribution!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs.

If you would like this issue to remain open please:

  1. Verify that you can still reproduce the issue at hand
  2. Comment that the issue is still reproducible and include:
    • What OS and version you reproduced the issue on
    • What steps you followed to reproduce the issue

NOTE: If this issue was closed prematurely, please leave a comment.

Thanks!

h-vetinari commented 2 months ago

Not stale