Skip to content

Conversation

@zmitchell
Copy link
Member

@zmitchell zmitchell commented Jun 17, 2025

Note: the pure build will fail until flox/flox#3250 is solved.

This adds an impure build to vendor dependencies that can later be used in the Rust pure build. Creating the vendored dependencies is easy, but using the dependencies in the build requires creating a config file for Cargo to read. Cargo reads some environment variables at runtime, just not these variables in particular.

@zmitchell zmitchell force-pushed the zmitchell/3261-rust-pure-build branch from 73b323f to 358876f Compare June 17, 2025 17:12
@ysndr
Copy link
Contributor

ysndr commented Jun 19, 2025

I pushed a change to use the --config to pass an additional config file with the vendor data.
I think that fits better into the workflow of users that already hava a .cargo/config.toml where it becomes a bit annoying to merge a hand written toml back in to.
cargo --config <file> should instead overlay/add to the existing config leaving other config options in place.

It would have been nice if we could use the config generated by cargo vendor directly, but that refers to $out which for impure builds is not the same as ${deps} accessed by a consuming build :/

@ysndr ysndr force-pushed the zmitchell/3261-rust-pure-build branch from 199c892 to 66fff01 Compare June 19, 2025 13:32

# This build vendors dependencies in a build with the sandbox off
# so that we can use the network to fetch dependencies.
[build.deps]
Copy link
Contributor

Choose a reason for hiding this comment

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

I've used prefixed names for the Go and Ruby projects that the intermediate packages and store paths have more recognisable names when switching between projects in this repo.

Suggested change
[build.deps]
[build.quotes-app-rs-deps]

zmitchell and others added 2 commits June 23, 2025 12:12
This adds an impure build to vendor dependencies that can later be used
in the Rust pure build. Creating the vendored dependencies is easy, but
using the dependencies in the build requires creating a config file for
Cargo to read. Cargo reads _some_ environment variables at runtime,
just not these variables in particular.
@ysndr ysndr force-pushed the zmitchell/3261-rust-pure-build branch from 66fff01 to a031f9c Compare June 23, 2025 10:12
Copy link
Contributor

@dcarley dcarley left a comment

Choose a reason for hiding this comment

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

LGTM and passing tests. Do think we should rename the build before merging though.

@ysndr
Copy link
Contributor

ysndr commented Jun 23, 2025

renamed the deps build for consistency

@ysndr ysndr marked this pull request as ready for review June 23, 2025 11:26
@ysndr ysndr merged commit 88f3dd5 into main Jun 23, 2025
1 check passed
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