Add a new recipe¶
-
Pick a sibling recipe with a similar shape (CMake project? Header-only? Python package?) and copy its directory:
-
Edit
recipes/<new-pkg>/recipe.yaml: context.version— current upstream release.source.url— tarball URL (GitHubarchive/refs/tags/, GitLab CERN-/archive/, etc.). Template it on${{ version }}like the surrounding recipes so Renovate can update it automatically.source.sha256—curl -fsSL <url> | sha256sum.requirements.{build,host,run}— declare every sibling recipe this package depends on by name. rattler-build resolves the build order from these lists, so this is the only place to express ordering.- Compiled packages request the sysroot in
requirements.buildasif: linux/then: sysroot_${{ target_platform }} 2.17.*, not${{ stdlib('c') }}.stdlib('c')would change the hash of every compiled package and rebuild the whole linux-64 channel. build.skip— if the package isn't meant for linux-aarch64, addtarget_platform != "linux-64". Otherwise the arm64 CI job builds it too (see Platforms).tests:— at minimum apackage_contents:block listing the headers / libs / CMake configs the build is expected to produce. For runtime-executable packages add ascript:test that runs a Python import orroot -l -qinvocation.about:— populatehomepage,repository,summary,description,license(SPDX),license_file.-
extra.recipe-maintainers:— your GitHub handle, plus at least one co-maintainer where possible. -
Adjust the build script for the build system in use. Most recipes have a
build.sh; noarch and simple packages (for exampleganga,genie-data,field-service) put the script inline inrecipe.yamlinstead. -
If the package links ROOT, add a
variants.yamlwithroot_cxx_standardand the sharedroot_basepin. Copy it from a sibling such asrecipes/fairship/variants.yaml; see ROOT C++ standard variants. -
From the repo root, build the package locally:
-
Run the linters before you commit (see Linting below):
-
Open a PR. CI calls the reusable
rattler-build-and-upload.ymlworkflow, which runsrattler-build build --recipe-dir recipes/ --skip-existing=alland skips every package whose exact build already exists in the configured channels. PR builds don't upload; the built.condafiles are attached to the run asconda-packages-<platform>artifacts for 7 days, so you can install them for testing. Uploads toprefix.dev/ship-experiment/stablehappen only onmain(push or manual dispatch). -
After merge, decide whether the recipe is an upstream candidate and update the table.
Linting¶
ship-conda-recipes uses the same prek setup as the other SHiP
repositories (see Linting & git hooks).
Install the hooks once with pixi run -e lint install-hooks. The
hooks run:
- yamllint on every YAML file;
- shellcheck on
recipes/*/build.sh; reuse lint, so new files need an SPDX licence header or an entry inREUSE.toml;- the
variant-lockstepcheck onrecipe.yamlandvariants.yaml; - commitizen on the commit message (Conventional Commits).
Notes¶
- Recipe directory name must equal the
package.nameinrecipe.yaml. rattler-build's cross-recipe dependency resolution keys off the name inrequirements:. - Don't add the recipe to a separate manifest file: there isn't
one. The
requirements:block is the single source of truth for dependency order. - For the recipe currently under the most churn there is a
build-<name>pixi task shortcut (at the momentbuild-aegir).pixi run build-allbuilds the whole channel locally the same way CI does.