feat: inline package manifests for pixi global#6521
Conversation
pixi globalpixi global
9a5eed8 to
0337e6f
Compare
| --package 'build.config.noarch=true' | ||
| ``` | ||
|
|
||
| - `--package <DOTTED_KEY>=<TOML_VALUE>`, repeatable, merges the value under |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
That is a good point. A few counterpoints why I still prefer --package:
- in the manifest it's called
[package] - other CLIs use
--packagein 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
…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
c6f0f17 to
767edaf
Compare
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.
3e0d57c to
082d4e2
Compare
| 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()) |
There was a problem hiding this comment.
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?
| return Err(GlobalSpecsConversionError::InvalidBuildBackend { | ||
| input: input.clone(), | ||
| reason: "only a name and a version constraint are supported".to_string(), | ||
| }); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
a400769 to
284362f
Compare
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:
pixi-global.tomlunder[envs.<env>.dependencies], with fullpackage.*grammar support--build-backend <MATCHSPEC>flag for the obvious case (e.g.,pixi global install --git <url> --build-backend pixi-build-rust)--package <DOTTED_KEY>=<TOML_VALUE>escape hatch for advanced configurationpixi global syncproperly rebuilds when needed