Skip to content

lint-requirements: add option to configure variant from file path #791

@tiran

Description

@tiran

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions