Skip to content

feat: allow using build backends from source #4145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

baszalmstra
Copy link
Contributor

This PR enables using build backends from source specifications. E.g. you can build build-backends from source! We already had the machinery in place to do this but we just quite didnt have this enabled in the manifest yet. This PR now unlocks doing:

[package.build]
backend = { name = "pixi-build-cmake", path = "https://github.com/prefix-dev/pixi-build-backends", subdirectory = "crates/pixi-build-cmake" }
channels = ["https://prefix.dev/conda-forge"]

This doesnt work just quite yet because we currently have no pixi.tomls defined for any of our build backends. But that should be an easy fix!

TODO

  • Before merging this I think we should have a working test in our build testsuite.

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.

Just couple of comments, otherwise awesome!

Comment on lines -182 to -190
#[test]
fn test_disallow_source() {
assert_snapshot!(expect_parse_failure(
r#"
backend = { name = "foobar", git = "https://github.com/org/repo" }
"#
));
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe then we should expect it to parse, rather than removing test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These snapshot tests are there to snapshot the error message that is reported.

I want to add a full end-2-end test that should cover this. Or do you think we should also add explicit parsing (unit) tests?

@wolfv
Copy link
Member

wolfv commented Jul 16, 2025

Looking forward to test drive this with a few build backends that I have cooking.

@baszalmstra
Copy link
Contributor Author

@nichmor @remimimimimi I wonder if there is a way we can test this without having to resort to a complex python based end-2-end test.. Maybe you have thoughts?

@remimimimimi
Copy link
Contributor

@nichmor @remimimimimi I wonder if there is a way we can test this without having to resort to a complex python based end-2-end test.. Maybe you have thoughts?

Could write tests in rust using combination of assert_cmd and assert_fs.

@nichmor
Copy link
Contributor

nichmor commented Jul 17, 2025

@nichmor @remimimimimi I wonder if there is a way we can test this without having to resort to a complex python based end-2-end test.. Maybe you have thoughts?

How I was thinking is that we can pin the backends from pixi-build-backends in some pixi.toml that we will store in tests/data. But it will still use python e2e tests. Why you don't like it?

@baszalmstra
Copy link
Contributor Author

Because it is relatively slow, it needs to fetch repodata, fetch packages, install packages, and run external programs. That's why I introduced the in-memory backend, it allows us to completely remove that.

@nichmor
Copy link
Contributor

nichmor commented Jul 17, 2025

Because it is relatively slow, it needs to fetch repodata, fetch packages, install packages, and run external programs. That's why I introduced the in-memory backend, it allows us to completely remove that.

Yeah true - do you think we could build them also from source?

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.

4 participants