Skip to content

Comments

feat: allow using build backends from source#4145

Merged
baszalmstra merged 18 commits intoprefix-dev:mainfrom
baszalmstra:feat/build-backends-from-source
Aug 4, 2025
Merged

feat: allow using build backends from source#4145
baszalmstra merged 18 commits intoprefix-dev:mainfrom
baszalmstra:feat/build-backends-from-source

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!

@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?

@lucascolley lucascolley added area:build Related to pixi build enhancement New features labels Jul 21, 2025
@nichmor nichmor marked this pull request as ready for review July 28, 2025 15:26
.into()]),
))
.await
.unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be good to validate that it also rebuilds, this seems to work locally.

Also is there any way we can make this faster? This is a 25 second 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.

That seems odd! Since its using the in-memory backend!

Copy link
Contributor

Choose a reason for hiding this comment

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

  • wdym by rebuilds? if source code change, does it automatically reinstall the backend? if this - it will be fixed in a follow up PR
  • regarding the speed - strange. I will take a look

@baszalmstra baszalmstra enabled auto-merge (squash) August 4, 2025 08:28
@baszalmstra baszalmstra merged commit 8e99c4f into prefix-dev:main Aug 4, 2025
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:build Related to pixi build enhancement New features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants