Skip to content

feat: inline package manifests for pixi global#6521

Draft
Hofer-Julian wants to merge 5 commits into
mainfrom
claude/pixi-global-command-design-tmdtf0
Draft

feat: inline package manifests for pixi global#6521
Hofer-Julian wants to merge 5 commits into
mainfrom
claude/pixi-global-command-design-tmdtf0

Conversation

@Hofer-Julian

@Hofer-Julian Hofer-Julian commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Description

This PR implements inline package manifests in pixi global, enabling users to install tools from source repositories that don't contain pixi manifests by supplying the package definition via CLI flags or the global manifest.

It covers:

  • Manifest syntax: Reusing workspace inline-manifest syntax in pixi-global.toml under [envs.<env>.dependencies], with full package.* grammar support
  • CLI interface:
    • --build-backend <MATCHSPEC> flag for the obvious case (e.g., pixi global install --git <url> --build-backend pixi-build-rust)
    • Generic --package <DOTTED_KEY>=<TOML_VALUE> escape hatch for advanced configuration
  • Name inference: Automatic package naming by querying the build backend's outputs, with support for multi-output sources
  • Sync semantics: Spec-fingerprint tracking to detect when inline definitions or source specs change, ensuring pixi global sync properly rebuilds when needed
  • Platform safety: Hard error for cross-platform source builds
  • Precedence: Inline definitions override discovered manifests when both are present

@Hofer-Julian Hofer-Julian changed the title Design: Inline package manifests for pixi global feat: inline package manifests for pixi global Jul 3, 2026
@Hofer-Julian Hofer-Julian force-pushed the claude/pixi-global-command-design-tmdtf0 branch from 9a5eed8 to 0337e6f Compare July 3, 2026 13:45
Comment thread design/pixi-global-inline-manifests.md Outdated
--package 'build.config.noarch=true'
```

- `--package <DOTTED_KEY>=<TOML_VALUE>`, repeatable, merges the value under

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this makes sense but I worry about the ability to simply define that you want one package from a workspace. similar to --bin in cargo. Where I saw the cli looking like this:

pixi global install --git xxx/user/repo --package package_a

With that in mind would it make sense to rename this special key to --package-config or something like that?

No is a fine answer I just reserved that flag in my head already.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a good point. A few counterpoints why I still prefer --package:

  • in the manifest it's called [package]
  • other CLIs use --package in a different way, but in our case there's no overlap
  • you sometimes have to specify this flag multiple times, so making it longer will be annoying

@Hofer-Julian Hofer-Julian marked this pull request as draft July 6, 2026 07:42
claude and others added 2 commits July 6, 2026 12:13
…nitions

Implements the `pixi global install --git <url> --build-backend <backend>`
workflow fantasized in the Pixi Build blog post, plus the supporting
manifest, sync and lifecycle semantics from the design doc.

- Parse inline package definitions in `pixi-global.toml`, reusing the
  workspace inline-manifest grammar and parser (`[envs.*.dependencies]`
  entries may carry a `package` table).
- Thread inline definitions through the solve, install and
  build-backend-metadata specs so backend discovery uses them instead of
  reading a manifest from the checkout.
- Add `--build-backend` and repeatable `--package DOTTED_KEY=TOML_VALUE`
  flags on the shared `GlobalSpecs` (install + add), with a bare-string
  fallback and hard collision errors.
- Record per-environment source fingerprints (pinned source + inline
  content hash) so `pixi global sync` rebuilds when a source spec or its
  inline definition changes; `update` keeps chasing moving references.
- Hard-error when an environment with source dependencies targets a
  non-current platform.
- Infer package names for git and path sources alike, dedupe backend
  output names before deciding ambiguity, suggest the exact names to
  re-run with, delete the dead `GitNotSupported` variant, and hint at
  `--build-backend` when a source has no discoverable manifest.
- Document source dependencies in the global manifest reference.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ZxLj1q9onVBH2BXgGh6iu
@Hofer-Julian Hofer-Julian force-pushed the claude/pixi-global-command-design-tmdtf0 branch from c6f0f17 to 767edaf Compare July 6, 2026 12:16
Rust unit tests for --build-backend/--package spec conversion and manifest
overwrite, plus Python integration tests for the manifest-less build, name
inference, and fingerprint-driven rebuild paths.
@Hofer-Julian Hofer-Julian force-pushed the claude/pixi-global-command-design-tmdtf0 branch from 3e0d57c to 082d4e2 Compare July 6, 2026 14:45
Comment thread crates/pixi_global/src/project/mod.rs Outdated
if !source_package_names.is_empty() {
let expected_fingerprints = source_fingerprints_for_environment(environment);
let recorded_fingerprints =
pixi_core::environment::read_environment_file(env_dir.path())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens when this is not readable? I read it as if that will consider the file as out of sync every time. Is it OK to just have a debug! to help diagnose this?

Comment thread crates/pixi_cli/src/global/global_specs.rs Outdated
return Err(GlobalSpecsConversionError::InvalidBuildBackend {
input: input.clone(),
reason: "only a name and a version constraint are supported".to_string(),
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a super elaborate way to check for name and version constraints:-)

self.parsed = match ParsedManifest::from_toml_str(&contents, root_directory) {
Ok(parsed) => parsed,
Err(e) => {
return e.to_fancy(consts::GLOBAL_MANIFEST_DEFAULT_NAME, &contents, &self.path);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you do the checks before changing the self.document (e.g. in line 177)? It's just safer to do it in that order.

@Hofer-Julian Hofer-Julian force-pushed the claude/pixi-global-command-design-tmdtf0 branch from a400769 to 284362f Compare July 9, 2026 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants