Skip to content

fix: pixi-build-r recommended dependencies - #6924

Open
fhaefele wants to merge 3 commits into
prefix-dev:mainfrom
fhaefele:fix/pixi-build-r-recommended-dependencies
Open

fix: pixi-build-r recommended dependencies#6924
fhaefele wants to merge 3 commits into
prefix-dev:mainfrom
fhaefele:fix/pixi-build-r-recommended-dependencies

Conversation

@fhaefele

Copy link
Copy Markdown

pixi-build-r treated R recommended packages as included in r-base. However, conda-forge builds r-base with [--with-recommended-packages=no] (https://github.com/conda-forge/r-base-feedstock/blob/main/recipe/build-r-base.sh#L208) and provides these packages as separate r-* artifacts.

This caused source builds to fail when their DESCRIPTION imported recommended packages. For example, NLRAA requires boot, MASS, Matrix, mgcv, and nlme. R CMD INSTALL failed because none were present in the build environment.

This change keeps only Priority: base packages in R_BUILTIN_PACKAGES. Recommended packages now become normal host and run requirements:

boot   → r-boot
MASS   → r-mass
Matrix → r-matrix
mgcv   → r-mgcv
nlme   → r-nlme

Base packages such as stats remain excluded.

Minimal reproduction:

[workspace]
name = "nlraa-reproduction"
channels = ["conda-forge"]
platforms = ["linux-64"]
preview = ["pixi-build"]

[dependencies]
r-base = ">=4.5,<4.6"

r-nlraa = {
  git = "https://github.com/femiguez/nlraa",
  rev = "d6afbf815a423077286821acc97ce44184ecb039",
  package.build.backend = {
    name = "pixi-build-r",
    version = "*",
    channels = [
      "https://prefix.dev/pixi-build-backends",
      "conda-forge",
    ],
  },
}

Run:

pixi install

Before this fix:

ERROR: dependencies ‘boot’, ‘MASS’, ‘Matrix’, ‘mgcv’, ‘nlme’ are not available

After this fix, Pixi resolves the separate conda-forge packages, builds NLRAA, and records the complete dependency graph in pixi.lock.

How Has This Been Tested?

Added a regression test using NLRAA's dependencies. It verifies that:

  • Recommended packages become r-* host requirements.
  • Recommended packages become r-* run requirements.
  • Base packages such as stats remain excluded.

Commands:

pixi run cargo test -p pixi-build-r
pixi run lint

Results:

  • All 39 pixi-build-r tests passed.
  • Full repository lint passed.
  • Built NLRAA 1.9.11 from the pinned Git commit using the fixed local backend.
  • Verified library(nlraa) succeeds.
  • Verified r-boot, r-mass, r-matrix, r-mgcv, and r-nlme are resolved from conda-forge and recorded in pixi.lock.

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: Codex, gpt-5.6-sol

Prompt:

Fix pixi-build-r so recommended R packages distributed separately by conda-
forge are added as host and run dependencies. Add regression coverage and
verify the change using NLRAA.

Checklist:

  • I have performed a self-review of my own code
  • I have added sufficient tests to cover my changes.

@fhaefele fhaefele changed the title Fix/pixi build r recommended dependencies fix: pixi-build-r recommended dependencies Aug 28, 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