-
Notifications
You must be signed in to change notification settings - Fork 186
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
base: feature/pixi-build
Are you sure you want to change the base?
feat: add isolated build tools #2479
Conversation
/// The tool context, | ||
/// containing client, channels and gateway configuration | ||
/// that will be used to resolve and install tools. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
#[derive(Default, Debug)] | ||
pub struct ToolContext { | ||
/// The gateway configuration used to fetch repodata. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Authenticated client to use for fetching repodata. | |
/// Authenticated client used to fetch repodata. |
.recursive(true) | ||
.execute() | ||
.await | ||
.unwrap(); |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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> { |
There was a problem hiding this comment.
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"] |
There was a problem hiding this comment.
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.*" |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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"], |
There was a problem hiding this comment.
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?
Would be great to add the following follow-up PR's:
|
--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.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