prefix-dev / rattler-build-conda-compat

rattler-build module which offer compatibility with conda-smithy
BSD 3-Clause "New" or "Revised" License
3 stars 4 forks source link

No way to specify `--experimental` for `render` function #56

Open h-vetinari opened 1 week ago

h-vetinari commented 1 week ago

While trying to switch zlib to rattler, I need a feature that's currently under an experimental flag. Aside from the problem of not being able to specify this through smithy yet, the larger issue is that this is not configurable in the compat layer here.

I've monkey-patched my local install to do:

---src/rattler_build_conda_compat/render.py
+++src/rattler_build_conda_compat/render.py
                    run_args = [
                        "rattler-build",
                        "build",
                        "--render-only",
                        "--recipe",
                        self.path,
                        "--target-platform",
                        platform_and_arch,
                        "--build-platform",
                        platform_and_arch,
+                      "--experimental",
                    ]

which still runs into a rendering error:

  File "E:\miniforge\envs\smithy-dev\Lib\site-packages\rattler_build_conda_compat\render.py", line 317, in render
    m.config.variant = package_variants[0]
                       ~~~~~~~~~~~~~~~~^^^

which I solved as follows:

---src/rattler_build_conda_compat/render.py
+++src/rattler_build_conda_compat/render.py
                        ):
                            package_variants.remove(pkg_variant)

-           m.config.variant = package_variants[0]
+           m.config.variant = package_variants[0] if package_variants else []

            # These are always the full set.  just 'variants' is the one that gets
            #     used mostly, and can be reduced

That way I was able to get a basic rerender to succeed at least (though still running into issues on the build invocation, which'll have to be fixed in smithy).

h-vetinari commented 1 week ago

@wolfv @baszalmstra @nichmor Any help with how an API for using --experimental should look like, so that smithy can build on top (https://github.com/conda-forge/conda-smithy/issues/2057).

nichmor commented 1 week ago

hey @h-vetinari ! let me take a look at this today! sorry for long reply time