Skip to content

Conversation

@baszalmstra
Copy link
Contributor

@baszalmstra baszalmstra commented Nov 28, 2025

Description

When a package specifies a build source via [package.build.source], the license-file and readme files should be validated against the appropriate directory:

  • Git or URL source: skip validation (files are in remote location)
  • Path source: validate against the resolved path directory
  • No source: validate against the manifest directory (default behavior)

Previously, pixi would always validate these files against the manifest directory, causing false "file does not exist" errors when the files were expected to be in a different location.

Fixes: #4985

An akward side note is that the license can now never be relative to the pixi.toml. Im not sure if thats desired.

How Has This Been Tested?

There are a large number of unit tests that test different edge cases.

I also user tested this by making a new pixi project and point it to another source folder on my disk. The error disappeared.

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 Opus 4.5

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.

When a package specifies a build source via `[package.build.source]`,
the license-file and readme files should be validated against the
appropriate directory:

- Git or URL source: skip validation (files are in remote location)
- Path source: validate against the resolved path directory
- No source: validate against the manifest directory (default behavior)

Previously, pixi would always validate these files against the manifest
directory, causing false "file does not exist" errors when the files
were expected to be in a different location.

Fixes: prefix-dev#4985
@baszalmstra baszalmstra force-pushed the claude/fix-license-validation-016vTgxoBoGWBbVBQddYMmhe branch from ec08326 to 9ead74c Compare November 28, 2025 11:04
@baszalmstra
Copy link
Contributor Author

While testing this it now looks like the LICENSE cannot be found at all during the build when using an out of source build. I think the reason is that we do not pass the full path to the license to the backend. Will need some more investigation.

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.

bug(build): license-file does not work with git source

2 participants