Skip to content
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

feat: add isolated build tools #2479

Open
wants to merge 8 commits into
base: feature/pixi-build
Choose a base branch
from

Conversation

nichmor
Copy link
Contributor

@nichmor nichmor commented Nov 14, 2024

  • This PR aims to add support of isolated build tools. This means that user don't need anymore to have some of the build backends installed in the system, pixi will take care of it.
  • we also introduce --with-system option for pixi build. This mean that pixi instead of installing these tools, will use the one present in system. It was not possible to use these features previously.
  • it also introduce channels in build table. This means that user can specify some private / or different channels to get their build tools. This is also handy for us because we host currently our build tools on pixi-build-backends channel.

It cache the env based on the command, spec and channels.

This is also a small demo of end-2-end result

Screen.Recording.2024-11-13.at.18.57.38.mov

@nichmor nichmor marked this pull request as ready for review November 14, 2024 15:02
/// The tool context,
/// containing client, channels and gateway configuration
/// that will be used to resolve and install tools.

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change


#[derive(Default, Debug)]
pub struct ToolContext {
/// The gateway configuration used to fetch repodata.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// The gateway configuration used to fetch repodata.
/// The gateway configuration that is used to fetch repodata.

pub struct ToolContext {
/// The gateway configuration used to fetch repodata.
pub gateway_config: ChannelConfig,
/// Authenticated client to use for fetching repodata.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// Authenticated client to use for fetching repodata.
/// Authenticated client used to fetch repodata.

.recursive(true)
.execute()
.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.

Maybe get rid of these unwrap's

cache_dir: &Path,
context: ToolContext,
) -> miette::Result<IsolatedTool> {
let gateway = Gateway::builder()
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to because the in-memory cache is not shared otherwise.

}

impl BuildSection {
pub fn channels_url(&self, config: &ChannelConfig) -> Result<Vec<Url>, ParseChannelError> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could use docs

@@ -7,6 +7,7 @@ platforms = ["win-64", "linux-64", "osx-arm64", "osx-64"]

[build]
build-backend = "pixi-build-cmake"
channels = ["https://prefix.dev/graf", "https://fast.prefix.dev/conda-forge"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Revert this :)

@@ -21,7 +21,9 @@ platforms = ["linux-64", "osx-arm64", "osx-64", "win-64"]
flask-hello-world-pyproject = { path = ".", editable = true }

[tool.pixi.dependencies]
flask = "2.*"
# flask = "2.*"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add this back?

[build]
build-backend = "pixi-build-python"
channels = [
"file:///Users/graf/projects/oss/pixi-build-backends/output",
Copy link
Contributor

Choose a reason for hiding this comment

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

Lets not add local paths.

parsed_manifest["tool"]["pixi"]["host-dependencies"] = {"hatchling": "*"}
parsed_manifest["tool"]["pixi"]["build"] = {
"build-backend": "pixi-build-python",
"channels": ["https://prefix.dev/graf", "https://fast.prefix.dev/conda-forge"],
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use the other channel here?

@tdejager
Copy link
Contributor

Would be great to add the following follow-up PR's:

  • Re-use environments if they are already installed.
  • Report progress when installing build tools.

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.

2 participants