Skip to content

How to specify global-environments with constraints? #254

@matthewfeickert

Description

@matthewfeickert

From

setup-pixi/README.md

Lines 151 to 157 in 33be5ba

### Global Environments
You can specify `pixi global install` commands by setting the `global-environments` input argument.
This will create one environment per line, and install them.
This is useful in particular to install executables that are needed for `pixi install` to work properly.
For instance, the `keyring`, or `gcloud` executables. The following example shows how to install both in separate global environments.
By default, global environments are not cached. You can enable caching by setting the `global-cache` input to `true`.

it is unclear how to install something the equivalent to pixi global install 'cmake <4.0' given that

      - name: Set up Pixi
        uses: prefix-dev/setup-pixi@v0.9.4
        with:
          run-install: false
          global-environments: |
            "cmake <4.0"

errors out with

Error:   × invalid package name '"cmake': '"cmake' is not a valid package name. Package names can only contain 0-9, a-z, A-Z, -, _, or .
    ╰─▶ '"cmake' is not a valid package name. Package names can only contain 0-9, a-z, A-Z, -, _, or .

and

      - name: Set up Pixi
        uses: prefix-dev/setup-pixi@v0.9.4
        with:
          run-install: false
          global-environments: |
            cmake <4.0

errors out with

  Error:   × missing package name

What is the proper syntax that I'm missing?

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