nextstrain / conda-base

Conda package build for nextstrain-base
https://anaconda.org/Nextstrain/nextstrain-base
1 stars 1 forks source link

`./devel/build` tries to install osx-arm64 package when run on arm macos #10

Closed corneliusroemer closed 1 year ago

corneliusroemer commented 1 year ago

Current Behavior

When I run ./devel/build on an arm mac, ./devel/build tries to build the recipe/variant osx-arm64 - which fails since bioconda doesn't support arm64 and some packages are not available for arm64.

Expected behavior

./devel/build sets environment variables so that osx64 emulation is used and that variant is built

corneliusroemer commented 1 year ago

Workaround

Set CONDA_SUBDIR=osx-64 either before ./devel/build like:

CONDA_SUBDIR=osx-64 ./devel/build     

Maybe better solution: Add such an env variable to the build script.

Maybe architecture should be an argument for the build script? It would be nice if one could test linux-64 on mac, and vice versa.

tsibley commented 1 year ago

Ah, I don't have a Mac so can't test solutions to this myself, but…

Maybe better solution: Add such an env variable to the build script.

Relatedly, I needed to know/use the current Conda subdir for #16, and implemented it like so:

https://github.com/nextstrain/conda-base/blob/f14d39c62c5df6ddbdc73b5b29a3418258be14f6/devel/download-latest#L7-L8

https://github.com/nextstrain/conda-base/blob/f14d39c62c5df6ddbdc73b5b29a3418258be14f6/devel/conda-subdir#L10-L23

Maybe architecture should be an argument for the build script? It would be nice if one could test linux-64 on mac, and vice versa.

Would prefer a default that can be overridden by setting CONDA_SUBDIR, as above. Is it actually possible to test linux-64 on macOS? Like, I can imagine that Conda/Mamba/etc. might download and unpack the linux-64 packages just fine, but if any binary from them has to be run (like in a post-link script?) it won't work, right?

corneliusroemer commented 1 year ago

Like, I can imagine that Conda/Mamba/etc. might download and unpack the linux-64 packages just fine, but if any binary from them has to be run (like in a post-link script?) it won't work, right?

Conda/Mamba can definitely test solving any subdir independent from the underlying system architecture, but building will not work unless the architecture is compatible.

I don't know to which extent we do linking, I don't fully understand what ./devel/build does. It seems to do more than just solving.

tsibley commented 1 year ago

I don't fully understand what ./devel/build does. It seems to do more than just solving.

It performs two package builds. The first build is of the recipe in src/, which is only a meta-package having no contents itself. Then the fully-resolved dep tree from that built package is used to generate a recipe in locked/, which is built into the final package.

Described in a little more detail in the README.