The lint-requirements operates under default variant cpu. For resolve requirements, the context must be configured to use the correct variant name for each input file. Otherwise Fromager does not use the correct override settings like prebuilt flag for a package.
In downstream we are validating collections/accelerated/cpu-ubi9/requirements.txt with ctx.variant == "cpu". That is obviously wrong and leads to issues because override configuration are not applied when resolving prebuilt packages.
Idea
Add an option --auto-variant that updates settings and context to use the parent directory name as ctx.variant.
Changing variant on the fly is possible, but needs extra steps like updating context.settings and resetting the dependency graph.
The
lint-requirementsoperates under default variantcpu. For resolve requirements, the context must be configured to use the correct variant name for each input file. Otherwise Fromager does not use the correct override settings likeprebuiltflag for a package.In downstream we are validating
collections/accelerated/cpu-ubi9/requirements.txtwithctx.variant == "cpu". That is obviously wrong and leads to issues because override configuration are not applied when resolving prebuilt packages.Idea
Add an option
--auto-variantthat updates settings and context to use the parent directory name asctx.variant.Changing variant on the fly is possible, but needs extra steps like updating
context.settingsand resetting the dependency graph.