Skip to content

feat: add build number and build string prefix override options#5788

Open
wolfv wants to merge 3 commits intoprefix-dev:mainfrom
wolfv:build-number-build-string-override
Open

feat: add build number and build string prefix override options#5788
wolfv wants to merge 3 commits intoprefix-dev:mainfrom
wolfv:build-number-build-string-override

Conversation

@wolfv
Copy link
Copy Markdown
Member

@wolfv wolfv commented Mar 27, 2026

Description

This is a slight modification to teh --build-string argument. In this one we allow only modifying a prefix of the build string in order to keep the variant hash intact.

  • --build-number <N>: Overrides the build number in the recipe before rendering, so the build string is automatically updated (e.g., pyh4616a5c_5 instead of pyh4616a5c_0).
  • --build-string-prefix <PREFIX>: Prepends a custom string to the final build string (e.g., pr42_pyh4616a5c_0). Useful for tagging CI builds with a git hash, PR number, or branch name.
  • Both flags work together: --build-number 5 --build-string-prefix pr42pr42_pyh4616a5c_5.

How Has This Been Tested?

I've tested it with the cpp_sdl example, eg.

cargo b --package pixi-build-cmake
export PIXI_BUILD_BACKEND_OVERRIDE=pixi-build-cmake=/Users/wolfv/Programs/pixi/target/debug/pixi-build-cmake

cargo r -- build --build-string-prefix xxx --build-number 1324
 WARN overriding build backend with: pixi-build-python=/Users/wolfv/Programs/pixi/target/debug/pixi-build-python,pixi-build-cmake=/Users/wolfv/Programs/pixi/target/debug/pixi-build-cmake
 WARN metadata cache disabled for build backend 'pixi-build-cmake' (system/path-based backends always regenerate metadata)

 ╭─ Running build for recipe: sdl_example-0.1.0-xxx_h60d57d3_1324
 │
 │ ╭─ Fetching source code
 │ │ No sources to fetch
 │ │
 │ ╰─────────────────── (took 0 seconds)
 │
 │ ╭─ Externally resolved dependencies recipe: sdl_example-0.1.0-xxx_h60d57d3_1324
 │ │
 │ │ Resolved build dependencies(sdl_example-0.1.0-xxx_h60d57d3_1324):

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.

Tools: Claude

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added sufficient tests to cover my changes.
  • I have verified that changes that would impact the JSON schema have been made in schema/model.py.

@wolfv wolfv changed the title add build number and build string prefix override options feat: add build number and build string prefix override options Mar 27, 2026
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.

1 participant