Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error related to os.getcwd() on linux. Only works with --no-build-id #206

Closed
2 tasks done
Krande opened this issue Mar 24, 2023 · 2 comments
Closed
2 tasks done
Assignees
Labels
stale [bot] marked as stale due to inactivity

Comments

@Krande
Copy link

Krande commented Mar 24, 2023

Checklist

  • I added a descriptive title
  • I searched open reports and couldn't find a duplicate

What happened?

When trying to build and upload pre-releases of my noarch python package ada-py on linux to my personal conda channel I keep seeing a repeating failure related to os.getcwd() in the conda_package_handling/interface.py. The same issue occurs when running locally on my WSL2 linux and on github actions. However, the issue disappears when adding the --no-build-id flag. There is no issue when running this on windows.

Before trying the --no-build-id option I tried a lot of different things (but without success):

  • Changed the build and output directories.
  • Switched between conda mambabuild and conda build
  • Tried different pre-release tags and without; 0.0.38, 0.0.38a1 and 0.0.38alpha.1 which all produces the same issue
  • Tried with --build-id-pat '' instead of --no-build-id.
  • Tried a different version of conda-build 3.23.3 instead of 3.23.4

As mentioned, I did finally get around the os.getcwd() issue by adding the --no-build-id flag, so my pipeline works for now. However I noticed in the docs that --no-build-id is deprecated and I should use --build-id-pat instead. Any suggestions of how I should use --build-id-pat to get the same effect as --no-build-id?

Any help with this would be greatly appreciated!
Let me know if you need more information and I'll happily oblige,

Best Regards
Kristoffer

Conda Info

active environment : base
    active env location : /home/krande/mambaforge
            shell level : 1
       user config file : /home/krande/.condarc
 populated config files : /home/krande/mambaforge/.condarc
          conda version : 22.11.1
    conda-build version : not installed
         python version : 3.10.8.final.0
       virtual packages : __archspec=1=x86_64
                          __glibc=2.35=0
                          __linux=5.10.16.3=0
                          __unix=0=0
       base environment : /home/krande/mambaforge  (writable)
      conda av data dir : /home/krande/mambaforge/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : /home/krande/mambaforge/pkgs
                          /home/krande/.conda/pkgs
       envs directories : /home/krande/mambaforge/envs
                          /home/krande/.conda/envs
               platform : linux-64
             user-agent : conda/22.11.1 requests/2.28.2 CPython/3.10.8 Linux/5.10.16.3-microsoft-standard-WSL2 ubuntu/22.04.1 glibc/2.35
                UID:GID : 1000:1000
             netrc file : None
           offline mode : False

Conda Config

==> /home/krande/mambaforge/.condarc <==
channels:
  - conda-forge

Conda list

# packages in environment at /home/krande/mambaforge/envs/conda-build:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
anaconda-client           1.11.1             pyhd8ed1ab_0    conda-forge
anaconda-project          0.11.1             pyhd8ed1ab_0    conda-forge
anyio                     3.6.2              pyhd8ed1ab_0    conda-forge
attrs                     22.2.0             pyh71513ae_0    conda-forge
backports                 1.0                pyhd8ed1ab_3    conda-forge
backports.functools_lru_cache 1.6.4              pyhd8ed1ab_0    conda-forge
beautifulsoup4            4.12.0             pyha770c72_0    conda-forge
boa                       0.14.0             pyhd8ed1ab_4    conda-forge
brotlipy                  0.7.0           py311hd4cff14_1005    conda-forge
bzip2                     1.0.8                h7f98852_4    conda-forge
c-ares                    1.18.1               h7f98852_0    conda-forge
ca-certificates           2022.12.7            ha878542_0    conda-forge
certifi                   2022.12.7          pyhd8ed1ab_0    conda-forge
cffi                      1.15.1          py311h409f033_3    conda-forge
chardet                   5.1.0           py311h38be061_0    conda-forge
charset-normalizer        2.1.1              pyhd8ed1ab_0    conda-forge
click                     8.1.3           unix_pyhd8ed1ab_2    conda-forge
clyent                    1.2.2                      py_1    conda-forge
colorama                  0.4.6              pyhd8ed1ab_0    conda-forge
conda                     23.1.0          py311h38be061_0    conda-forge
conda-build               3.24.0          py311h38be061_0    conda-forge
conda-pack                0.7.0              pyh6c4a22f_0    conda-forge
conda-package-handling    2.0.2              pyh38be061_0    conda-forge
conda-package-streaming   0.7.0              pyhd8ed1ab_1    conda-forge
conda-verify              3.1.1           py311h38be061_1006    conda-forge
cryptography              39.0.2          py311h9b4c7bb_0    conda-forge
dataclasses               0.8                pyhc8e2a94_3    conda-forge
defusedxml                0.7.1              pyhd8ed1ab_0    conda-forge
filelock                  3.10.3             pyhd8ed1ab_0    conda-forge
fmt                       9.1.0                h924138e_0    conda-forge
freetype                  2.12.1               hca18f0e_1    conda-forge
future                    0.18.3             pyhd8ed1ab_0    conda-forge
glob2                     0.7                        py_0    conda-forge
icu                       72.1                 hcb278e6_0    conda-forge
idna                      3.4                pyhd8ed1ab_0    conda-forge
importlib-metadata        6.1.0              pyha770c72_0    conda-forge
importlib_resources       5.12.0             pyhd8ed1ab_0    conda-forge
jinja2                    3.1.2              pyhd8ed1ab_1    conda-forge
joblib                    1.2.0              pyhd8ed1ab_0    conda-forge
json5                     0.9.5              pyh9f0ad1d_0    conda-forge
jsonschema                4.17.3             pyhd8ed1ab_0    conda-forge
jupyter_core              5.3.0           py311h38be061_0    conda-forge
keyutils                  1.6.1                h166bdaf_0    conda-forge
krb5                      1.20.1               h81ceb04_0    conda-forge
lcms2                     2.15                 haa2dc70_1    conda-forge
ld_impl_linux-64          2.40                 h41732ed_0    conda-forge
lerc                      4.0.0                h27087fc_0    conda-forge
libarchive                3.6.2                h3d51595_0    conda-forge
libcurl                   7.88.1               hdc1c0ab_1    conda-forge
libdeflate                1.17                 h0b41bf4_0    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libev                     4.33                 h516909a_1    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libgcc-ng                 12.2.0              h65d4601_19    conda-forge
libgomp                   12.2.0              h65d4601_19    conda-forge
libiconv                  1.17                 h166bdaf_0    conda-forge
libjpeg-turbo             2.1.5.1              h0b41bf4_0    conda-forge
liblief                   0.12.3               h27087fc_0    conda-forge
libmamba                  1.4.0                hcea66bb_0    conda-forge
libmambapy                1.4.0           py311h1f88262_0    conda-forge
libnghttp2                1.52.0               h61bc06f_0    conda-forge
libnsl                    2.0.0                h7f98852_0    conda-forge
libpng                    1.6.39               h753d276_0    conda-forge
libsolv                   0.7.23               h3eb15da_0    conda-forge
libsqlite                 3.40.0               h753d276_0    conda-forge
libssh2                   1.10.0               hf14f497_3    conda-forge
libstdcxx-ng              12.2.0              h46fd767_19    conda-forge
libtiff                   4.5.0                hddfeb54_5    conda-forge
libuuid                   2.32.1            h7f98852_1000    conda-forge
libwebp-base              1.3.0                h0b41bf4_0    conda-forge
libxcb                    1.13              h7f98852_1004    conda-forge
libxml2                   2.10.3               hfdac1af_6    conda-forge
libzlib                   1.2.13               h166bdaf_4    conda-forge
lz4-c                     1.9.4                hcb278e6_0    conda-forge
lzo                       2.10              h516909a_1000    conda-forge
mamba                     1.4.0           py311h3072747_0    conda-forge
markdown-it-py            2.2.0              pyhd8ed1ab_0    conda-forge
markupsafe                2.1.2           py311h2582759_0    conda-forge
mdurl                     0.1.0              pyhd8ed1ab_0    conda-forge
nbformat                  5.8.0              pyhd8ed1ab_0    conda-forge
ncurses                   6.3                  h27087fc_1    conda-forge
openjpeg                  2.5.0                hfec8fc6_2    conda-forge
openssl                   3.1.0                h0b41bf4_0    conda-forge
packaging                 23.0               pyhd8ed1ab_0    conda-forge
patch                     2.7.6             h7f98852_1002    conda-forge
patchelf                  0.17.2               h58526e2_0    conda-forge
pillow                    9.4.0           py311h573f0d3_2    conda-forge
pip                       23.0.1             pyhd8ed1ab_0    conda-forge
pkginfo                   1.9.6              pyhd8ed1ab_0    conda-forge
pkgutil-resolve-name      1.3.10             pyhd8ed1ab_0    conda-forge
platformdirs              3.1.1              pyhd8ed1ab_0    conda-forge
pluggy                    1.0.0              pyhd8ed1ab_5    conda-forge
prompt-toolkit            3.0.38             pyha770c72_0    conda-forge
prompt_toolkit            3.0.38               hd8ed1ab_0    conda-forge
psutil                    5.9.4           py311hd4cff14_0    conda-forge
pthread-stubs             0.4               h36c2ea0_1001    conda-forge
py-lief                   0.12.3          py311ha362b79_0    conda-forge
pybind11-abi              4                    hd8ed1ab_3    conda-forge
pycosat                   0.6.4           py311hd4cff14_1    conda-forge
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pygments                  2.14.0             pyhd8ed1ab_0    conda-forge
pyopenssl                 23.0.0             pyhd8ed1ab_0    conda-forge
pyrsistent                0.19.3          py311h2582759_0    conda-forge
pysocks                   1.7.1              pyha2e5f31_6    conda-forge
python                    3.11.0          he550d4f_1_cpython    conda-forge
python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
python-fastjsonschema     2.16.3             pyhd8ed1ab_0    conda-forge
python-libarchive-c       4.0             py311h38be061_2    conda-forge
python_abi                3.11                    3_cp311    conda-forge
pytz                      2022.7.1           pyhd8ed1ab_0    conda-forge
pyyaml                    6.0             py311hd4cff14_5    conda-forge
readline                  8.2                  h8228510_1    conda-forge
reproc                    14.2.4               h0b41bf4_0    conda-forge
reproc-cpp                14.2.4               hcb278e6_0    conda-forge
requests                  2.28.2             pyhd8ed1ab_0    conda-forge
rich                      13.3.2             pyhd8ed1ab_0    conda-forge
ripgrep                   13.0.0               h2f28480_2    conda-forge
ruamel.yaml               0.17.21         py311h2582759_3    conda-forge
ruamel.yaml.clib          0.2.7           py311h2582759_1    conda-forge
ruamel_yaml               0.15.80         py311hd4cff14_1008    conda-forge
setuptools                65.6.3             pyhd8ed1ab_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
sniffio                   1.3.0              pyhd8ed1ab_0    conda-forge
soupsieve                 2.3.2.post1        pyhd8ed1ab_0    conda-forge
tk                        8.6.12               h27826a3_0    conda-forge
toolz                     0.12.0             pyhd8ed1ab_0    conda-forge
tornado                   6.2             py311hd4cff14_1    conda-forge
tqdm                      4.65.0             pyhd8ed1ab_1    conda-forge
traitlets                 5.9.0              pyhd8ed1ab_0    conda-forge
typing-extensions         4.5.0                hd8ed1ab_0    conda-forge
typing_extensions         4.5.0              pyha770c72_0    conda-forge
tzdata                    2022g                h191b570_0    conda-forge
urllib3                   1.26.15            pyhd8ed1ab_0    conda-forge
watchgod                  0.8.2              pyhd8ed1ab_0    conda-forge
wcwidth                   0.2.6              pyhd8ed1ab_0    conda-forge
wheel                     0.40.0             pyhd8ed1ab_0    conda-forge
xorg-libxau               1.0.9                h7f98852_0    conda-forge
xorg-libxdmcp             1.1.3                h7f98852_0    conda-forge
xz                        5.2.6                h166bdaf_0    conda-forge
yaml                      0.2.5                h7f98852_2    conda-forge
yaml-cpp                  0.7.0                h27087fc_2    conda-forge
zipp                      3.15.0             pyhd8ed1ab_0    conda-forge
zstandard                 0.19.0          py311hbe0fcd7_1    conda-forge
zstd                      1.5.2                h3eb15da_6    conda-forge

Additional Context

Here are a few samples from my github action runs:

A failing run without --no-build-id -> here
A working run with --no-build-id -> here

Here are the two main files for my ci workflow

Here is the output from the failing job

Packaging ada-py
INFO:conda_build.build:Packaging ada-py-0.0.38alpha.6-core_h37e0f91_100
Packaging ada-py-0.0.38alpha.6-core_h37e0f91_100
INFO:conda_build.utils:Renaming work directory '/tmp/conda_build/ada-py-0.0.38alpha.6_1679648175456/work' to '/tmp/conda_build/ada-py-0.0.38alpha.6_1679648175456/work_moved_ada-py-0.0.38alpha.6-core_h37e0f91_100_linux-64_main_build_loop'
number of files: 366
INFO:conda_build.utils:shutil.move(work)=/tmp/conda_build/ada-py-0.0.38alpha.6_1679648175456/work, dest=/tmp/conda_build/ada-py-0.0.38alpha.6_1679648175456/work_moved_ada-py-0.0.38alpha.6-core_h37e0f91_100_linux-64_main_build_loop)
Fixing permissions
INFO :: Time taken to mark (prefix)
        0 replacements in 0 files was 0.03 seconds
Renaming work directory '/tmp/conda_build/ada-py-0.0.38alpha.6_1679648175456/work' to '/tmp/conda_build/ada-py-0.0.38alpha.6_1679648175456/work_moved_ada-py-0.0.38alpha.6-core_h37e0f91_100_linux-64_main_build_loop'
shutil.move(work)=/tmp/conda_build/ada-py-0.0.38alpha.6_1679648175456/work, dest=/tmp/conda_build/ada-py-0.0.38alpha.6_1679648175456/work_moved_ada-py-0.0.38alpha.6-core_h37e0f91_100_linux-64_main_build_loop)
Traceback (most recent call last):
  File "/home/runner/micromamba-root/envs/conda-build/bin/anaconda", line 10, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/runner/micromamba-root/envs/conda-build/lib/python3.11/site-packages/binstar_client/scripts/cli.py", line 154, in main
    binstar_main(command_module, args, _exit,
  File "/home/runner/micromamba-root/envs/conda-build/lib/python3.11/site-packages/binstar_client/scripts/cli.py", line 123, in binstar_main
    add_subparser_modules(parser, sub_command_module, 'conda_server.subcommand')
  File "/home/runner/micromamba-root/envs/conda-build/lib/python3.11/site-packages/clyent/__init__.py", line 133, in add_subparser_modules
    for command_module in get_sub_commands(module):
  File "/home/runner/micromamba-root/envs/conda-build/lib/python3.11/site-packages/clyent/__init__.py", line 122, in get_sub_commands
    this_module = __import__(module.__package__ or module.__name__, fromlist=names)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/micromamba-root/envs/conda-build/lib/python3.11/site-packages/binstar_client/commands/update.py", line 17, in <module>
    from binstar_client.utils.detect import detect_package_type, get_attrs
  File "/home/runner/micromamba-root/envs/conda-build/lib/python3.11/site-packages/binstar_client/utils/detect.py", line 15, in <module>
    from binstar_client.inspect_package.conda import inspect_conda_package
  File "/home/runner/micromamba-root/envs/conda-build/lib/python3.11/site-packages/binstar_client/inspect_package/conda.py", line 12, in <module>
    from conda_package_handling.api import extract
  File "/home/runner/micromamba-root/envs/conda-build/lib/python3.11/site-packages/conda_package_handling/api.py", line 10, in <module>
    from .interface import AbstractBaseFormat
  File "/home/runner/micromamba-root/envs/conda-build/lib/python3.11/site-packages/conda_package_handling/interface.py", line 5, in <module>
    class AbstractBaseFormat(metaclass=abc.ABCMeta):
  File "/home/runner/micromamba-root/envs/conda-build/lib/python3.11/site-packages/conda_package_handling/interface.py", line 18, in AbstractBaseFormat
    def create(prefix, file_list, out_fn, out_folder=os.getcwd(), **kw):  # pragma: no cover
                                                     ^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory

And here is the output from a working job

Packaging ada-py
INFO:conda_build.build:Packaging ada-py-0.0.38alpha.7-core_h37e0f91_100
Packaging ada-py-0.0.38alpha.7-core_h37e0f91_100
INFO:conda_build.utils:Renaming work directory '/tmp/conda_build/work' to '/tmp/conda_build/work_moved_ada-py-0.0.38alpha.7-core_h37e0f91_100_linux-64_main_build_loop'
number of files: 366
INFO:conda_build.utils:shutil.move(work)=/tmp/conda_build/work, dest=/tmp/conda_build/work_moved_ada-py-0.0.38alpha.7-core_h37e0f91_100_linux-64_main_build_loop)
Fixing permissions
INFO :: Time taken to mark (prefix)
        0 replacements in 0 files was 0.02 seconds
Renaming work directory '/tmp/conda_build/work' to '/tmp/conda_build/work_moved_ada-py-0.0.38alpha.7-core_h37e0f91_100_linux-64_main_build_loop'
shutil.move(work)=/tmp/conda_build/work, dest=/tmp/conda_build/work_moved_ada-py-0.0.38alpha.7-core_h37e0f91_100_linux-64_main_build_loop)
Using Anaconda API: https://api.anaconda.org/
Using "krande" as upload username
Processing '/tmp/conda_output/noarch/ada-py-0.0.38alpha.7-core_h37e0f91_100.tar.bz2'
Detecting file type...
File type is "Conda"
Extracting conda attributes for upload
Creating package "ada-py"
Creating release "0.0.38alpha.7"
Uploading file "krande/ada-py/0.0.38alpha.7/noarch/ada-py-0.0.38alpha.7-core_h37e0f91_100.tar.bz2"
Copy link

github-actions bot commented May 8, 2024

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!

@github-actions github-actions bot added the stale [bot] marked as stale due to inactivity label May 8, 2024
@dholth dholth self-assigned this May 21, 2024
@dholth
Copy link
Contributor

dholth commented May 21, 2024

Duplicate of #205

@dholth dholth marked this as a duplicate of #205 May 21, 2024
@dholth dholth closed this as completed May 21, 2024
This issue is being transferred. Timeline may not be complete until it finishes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale [bot] marked as stale due to inactivity
Projects
None yet
Development

No branches or pull requests

2 participants