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

mamba build passes incorrect commandline on to boa #2821

Open
2 tasks done
wence- opened this issue Sep 8, 2023 · 1 comment
Open
2 tasks done

mamba build passes incorrect commandline on to boa #2821

wence- opened this issue Sep 8, 2023 · 1 comment
Labels
type::bug Something isn't working

Comments

@wence-
Copy link

wence- commented Sep 8, 2023

Troubleshooting docs

  • My problem is not solved in the Troubleshooting docs

How did you install Mamba?

Mambaforge

Search tried in issue tracker

build

Latest version of Mamba

  • My problem is not solved with the latest version

Tried in Conda?

I do not have this problem with Conda, just with Mamba

Describe your issue

#2732 introduced special handling of mamba build (and mamba env). Unfortunately, the way mamba build is handled doesn't interface well with boa's mambabuild.main().

$ mamba build path/to/recipe
Updating build index: /home/wence/Documents/apps/mambaforge/conda-bld

Glob /home/wence/Documents/src/rapids/cudf/build did not match in root_dir /home/wence/Documents/src/rapids/cudf
ERROR:conda_build.utils:Glob /home/wence/Documents/src/rapids/cudf/build did not match in root_dir /home/wence/Documents/src/rapids/cudf
Traceback (most recent call last):
  File "/home/wence/Documents/apps/mambaforge/bin/mamba", line 11, in <module>
    sys.exit(main())
  File "/home/wence/Documents/apps/mambaforge/lib/python3.10/site-packages/mamba/mamba.py", line 928, in main
    return mambabuild.main()
  File "/home/wence/Documents/apps/mambaforge/lib/python3.10/site-packages/boa/cli/mambabuild.py", line 256, in main
    call_conda_build(action, config)
  File "/home/wence/Documents/apps/mambaforge/lib/python3.10/site-packages/boa/cli/mambabuild.py", line 228, in call_conda_build
    result = api.build(
  File "/home/wence/Documents/apps/mambaforge/lib/python3.10/site-packages/conda_build/api.py", line 249, in build
    raise ValueError(
ValueError: No valid recipes found for input: build

Whereas I expect this to build the provided recipe.

It looks like the problem is that boa's mambabuild.main() does this:

def main():
    boa_config.is_mambabuild = True
    _, args = parse_args(sys.argv[1:])

So it expects that sys.argv[0] contains the executable name, and the rest contains the commandline.

When running conda build path/to/recipe, sys.argv is ["conda-mambabuild", "path/to/recipe"]. However, when running mamba build path/to/recipe sys.argv is ["mamba", "build", "path/to/recipe"]. Which then breaks the parser.

I suppose one should rewrite sys.argv before calling through to something like ["mamba-build", "path/to/recipe"].

mamba info / micromamba info

mamba version : 1.5.1
     active environment : base
    active env location : /home/wence/Documents/apps/mambaforge
            shell level : 5
       user config file : /home/wence/.condarc
 populated config files : /home/wence/Documents/apps/mambaforge/.condarc
          conda version : 23.5.2
    conda-build version : 3.25.0
         python version : 3.10.12.final.0
       virtual packages : __archspec=1=x86_64
                          __cuda=12.0=0
                          __glibc=2.35=0
                          __linux=6.2.0=0
                          __unix=0=0
       base environment : /home/wence/Documents/apps/mambaforge  (writable)
      conda av data dir : /home/wence/Documents/apps/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/wence/Documents/apps/mambaforge/pkgs
                          /home/wence/.conda/pkgs
       envs directories : /home/wence/Documents/apps/mambaforge/envs
                          /home/wence/.conda/envs
               platform : linux-64
             user-agent : conda/23.5.2 requests/2.31.0 CPython/3.10.12 Linux/6.2.0-32-generic ubuntu/22.04.3 glibc/2.35
                UID:GID : 1000:1000
             netrc file : None
           offline mode : False

Logs

No response

environment.yml

No response

~/.condarc

No response

wence- added a commit to wence-/cudf that referenced this issue Sep 8, 2023
With boa installed, conda build forwards to the boa "mambabuild"
command, so this is still using the mamba solver.
rapids-bot bot pushed a commit to rapidsai/cudf that referenced this issue Sep 8, 2023
Since Conda 23.7.3, the plugin mechanism changed, and mambabuild broke.

Since, with `boa` installed, `conda mambabuild` uses the `libmamba` solver, switch to that.

The general handling of subcommands with `mamba` was partially fixed in mamba-org/mamba#2732, but `mamba build` does not currently work due to mamba-org/mamba#2821.

- Closes #14068

Authors:
  - Lawrence Mitchell (https://github.com/wence-)

Approvers:
  - Ray Douglass (https://github.com/raydouglass)

URL: #14067
@jonashaag jonashaag added the type::bug Something isn't working label Sep 11, 2023
@jakirkham
Copy link

cc @jaimergp (for awareness)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type::bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants