Skip to content

fix(pixi-build-r): resolve license file to absolute path#6215

Merged
baszalmstra merged 1 commit into
prefix-dev:mainfrom
baszalmstra:claude/magical-franklin-zHyHJ
May 26, 2026
Merged

fix(pixi-build-r): resolve license file to absolute path#6215
baszalmstra merged 1 commit into
prefix-dev:mainfrom
baszalmstra:claude/magical-franklin-zHyHJ

Conversation

@baszalmstra
Copy link
Copy Markdown
Contributor

Description

Fixes the pixi-build-r backend so it can build CRAN-style R packages whose DESCRIPTION declares License: <SPDX> + file LICENSE (the vast majority of CRAN), including when the package source is fetched via package.build.source.git.

Previously these builds failed at the final step with No license files were copied, even though the package itself compiled. Plain License: <SPDX> packages were unaffected.

How Has This Been Tested?

  • Added unit tests in crates/pixi_build_r/src/metadata.rs covering MIT + file LICENSE, bare file LICENSE, and non-standard filenames like LICENCE.
  • Ran cargo test -p pixi-build-r (35 passed, 0 failed). Existing insta snapshots are unchanged.
  • Manually verified against an R package using License: <SPDX> + file LICENSE with a git source: pixi install now completes and the resulting conda package contains the LICENSE file under info/licenses/. The path-source case still works.

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 added sufficient tests to cover my changes.

The R backend emits no `source:` block; the build script invokes
`R CMD INSTALL` directly against the package source root. rattler-build's
license-copy step looks for `license_file` entries inside the recipe's
work directory, which is empty in this configuration, so a bare
`LICENSE` filename (as returned by `parse_r_license` for the very common
`License: <SPDX> + file LICENSE` form) is never found and the build
fails with "No license files were copied".

Resolve the filename against `manifest_root` (the same path used as
`source_dir` for `R CMD INSTALL`) so the emitted `license_file` is an
absolute path that rattler-build can locate without a source directory.
This mirrors the fix already applied in `pixi-build-python`.
@baszalmstra baszalmstra requested a review from wolfv May 26, 2026 13:50
@baszalmstra baszalmstra added the R Related to the R language label May 26, 2026
@baszalmstra baszalmstra merged commit 4eb94e3 into prefix-dev:main May 26, 2026
43 of 73 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

R Related to the R language

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants