Skip to content

Conversation

@tdejager
Copy link
Contributor

@tdejager tdejager commented Nov 3, 2025

This adds the SourceCodeLocation struct that holds both the location of the manifest and the potential build-source, which is generally the actual source-code itself.

E.g given this pixi.toml (imagine it being part of a workspace with a pixi.toml):

workspace/proj/pixi.toml

[package]
source = "./bar"

Then we get:

  • manifest_source = workspace/proj
  • build_source = ./bar

Which when called using the source_code() method gives you: workspace/proj/bar, in this specific case.

We can use this structure when to pass around and decide if we need the location to the manifest, or to the source code. Like when caching we need to check the source code to see if we need to do rebuilds. For example, in my plotjugger PR constant rebuilds would occur: facontidavide/PlotJuggler#1201. This PR also fixes that behavior.

AI Disclosure

  • I found and fixed the bug as well as create the SourceCodeLocation, I let codex then propagate that struct throughout the codebase.

@tdejager tdejager changed the title fix: use type to better capture cache data fix: better out-of source caching and source code propagation Nov 3, 2025
Copy link
Contributor

@remimimimimi remimimimimi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Crazy good, code looks much better now! Just couple of comments.

@lucascolley lucascolley added the bug Something isn't working label Nov 3, 2025
@baszalmstra
Copy link
Contributor

I changed the code significantly. I'm trying to make sure that the pinned build_source_spec is always completely resolved and doesn't depend on the manifest_source anymore. That way, when dealing with a pinned build_source_spec, we can just use it as is without having to convert it in different locations.

@tdejager What is the best way to test this?

@tdejager
Copy link
Contributor Author

tdejager commented Nov 4, 2025

There was a PR on the suite I made: prefix-dev/pixi-build-testsuite#91

And for a real-world test you can try my PR on PlotJuggler. Can find the link if you want but I'm on mobile.

Note that there are also some unit test in pixi that test parts of this, but does not call any builds.

@baszalmstra
Copy link
Contributor

I changed the code to always make the source_build PinnedSourceSpec relative to the workspace instead of to some undefined root. This works well, but it looks very strange in the lockfile. If you have a git dependency which has a out-of-source build the entire git url is repeated in the package_build_source field. I think it makes sense to store the path relative to the location only in the lock-file.

@tdejager
Copy link
Contributor Author

tdejager commented Nov 4, 2025

I looked at the changes :) is now the preferred_source an alternative to the build_source or is it only used for the pinning during a pixi update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants