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

conda build crashes on non-BSD systems if bash is not installed #3819

Closed
dHannasch opened this issue Nov 26, 2019 · 1 comment
Closed

conda build crashes on non-BSD systems if bash is not installed #3819

dHannasch opened this issue Nov 26, 2019 · 1 comment
Labels
locked [bot] locked due to inactivity stale::closed [bot] closed after being marked as stale stale [bot] marked as stale due to inactivity

Comments

@dHannasch
Copy link

Actual Behavior

If bash is not installed (as it is not in, among others, the official Anaconda docker images), then conda-build crashes.

$ conda build .
Traceback (most recent call last):
  File "/opt/conda/envs/test-env/bin/conda-build", line 11, in <module>
    sys.exit(main())
  File "/opt/conda/envs/test-env/lib/python3.7/site-packages/conda_build/cli/main_build.py", line 469, in main
    execute(sys.argv[1:])
  File "/opt/conda/envs/test-env/lib/python3.7/site-packages/conda_build/cli/main_build.py", line 460, in execute
    verify=args.verify, variants=args.variants)
  File "/opt/conda/envs/test-env/lib/python3.7/site-packages/conda_build/api.py", line 209, in build
    notest=notest, need_source_download=need_source_download, variants=variants)
  File "/opt/conda/envs/test-env/lib/python3.7/site-packages/conda_build/build.py", line 2344, in build_tree
    notest=notest,
  File "/opt/conda/envs/test-env/lib/python3.7/site-packages/conda_build/build.py", line 1492, in build
    cwd=src_dir, stats=build_stats)
  File "/opt/conda/envs/test-env/lib/python3.7/site-packages/conda_build/utils.py", line 398, in check_call_env
    return _func_defaulting_env_to_os_environ('call', *popenargs, **kwargs)
  File "/opt/conda/envs/test-env/lib/python3.7/site-packages/conda_build/utils.py", line 373, in _func_defaulting_env_to_os_environ
    proc = PopenWrapper(_args, **kwargs)
  File "/opt/conda/envs/test-env/lib/python3.7/site-packages/conda_build/utils.py", line 258, in __init__
    self.out, self.err = self._execute(*args, **kwargs)
  File "/opt/conda/envs/test-env/lib/python3.7/site-packages/conda_build/utils.py", line 284, in _execute
    _popen = psutil.Popen(*args, **kwargs) if psutil else subprocess.Popen(*args, **kwargs)
  File "/opt/conda/envs/test-env/lib/python3.7/site-packages/psutil/__init__.py", line 1430, in __init__
    self.__subproc = subprocess.Popen(*args, **kwargs)
  File "/opt/conda/envs/test-env/lib/python3.7/subprocess.py", line 800, in __init__
    restore_signals, start_new_session)
  File "/opt/conda/envs/test-env/lib/python3.7/subprocess.py", line 1551, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/bin/bash': '/bin/bash'

@xhochy traced this back to bash being hardcoded into build.py: https://github.com/conda/conda-build/blob/master/conda_build/build.py#L82
There's some chatter on the Docker images,
anaconda/docker-images#120 (comment)
anaconda/docker-images#160
but there doesn't seem to be a conda-build issue for this yet, and it seems like conda-build really ought to not crash regardless of the image.
@mingwandroid suggested that conda-build could depend on bash: anaconda/docker-images#159 (comment)
It also seems worth asking whether conda-build even really needs bash --- if conda-build can get by with /bin/sh on BSD systems, could it do the same on, for example, Alpine systems?
https://github.com/conda/conda-build/blob/master/conda_build/build.py#L79

(Obviously, apk add bash works as a workaround, and presumably installing bash will also solve the problem on non-Alpine systems.)

Expected Behavior

conda build should not crash.

Steps to Reproduce

Try to run conda build on a non-BSD image that does not have bash. I'm partial to frolvlad/alpine-miniconda3 since that's what taught me how to make conda activate work, but as mentioned, continuumio/miniconda3 also does not have bash, so conda-build does not work. anaconda/docker-images#162 (comment)

Output of conda info
$ conda info

     active environment : test-env
    active env location : /opt/conda/envs/test-env
            shell level : 1
       user config file : /root/.condarc
 populated config files : /root/.condarc
          conda version : 4.7.12
    conda-build version : not installed
         python version : 3.7.4.final.0
       virtual packages : 
       base environment : /opt/conda  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /opt/conda/pkgs
                          /root/.conda/pkgs
       envs directories : /opt/conda/envs
                          /root/.conda/envs
               platform : linux-64
             user-agent : conda/4.7.12 requests/2.22.0 CPython/3.7.4 Linux/3.10.0-957.5.1.el7.x86_64 alpine/3.10.2 glibc/2.30
                UID:GID : 0:0
             netrc file : None
           offline mode : False
@github-actions
Copy link

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 Mar 15, 2023
@github-actions github-actions bot added the stale::closed [bot] closed after being marked as stale label Apr 15, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 15, 2023
@github-actions github-actions bot added the locked [bot] locked due to inactivity label Apr 14, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity stale::closed [bot] closed after being marked as stale stale [bot] marked as stale due to inactivity
Projects
Archived in project
Development

No branches or pull requests

1 participant