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

Is the .cargo/config.toml necessary in CI? #134

Closed
PaulRBerg opened this issue Nov 22, 2023 · 2 comments
Closed

Is the .cargo/config.toml necessary in CI? #134

PaulRBerg opened this issue Nov 22, 2023 · 2 comments

Comments

@PaulRBerg
Copy link

Requiring users to have a .cargo/config.toml file with the following content:

[build]
target = "x86_64-unknown-linux-musl"

Is quite a bad developer experience.

A better approach would be to manage environment-specific configurations in a way that doesn't interfere with the local development process.

But maybe I misunderstood how this works and there's no need for this file if the user doesn't intend to make a prebuilt deployment from their local machine?

We only want to deploy from CI.

@dglsparsons
Copy link
Collaborator

If you only want this to kick in as part of CI, i'd recommend writing the .cargo/config.toml file as part of your Github Actions.

e.g.

      - name: Write cargo config (forces a specific target)
        run: mkdir .cargo && printf "[build]\ntarget = \"x86_64-unknown-linux-musl\"\n" > .cargo/config.toml

It's not an easy one to workaround, as the configuration is Rust-specific. We'd have to have the ability to pass target info through the CLI, into the builder API, and then through to the cargo commands that are run. And of course, this would only apply to Rust builds at that point.

I get that this is not ideal, but it's well-documented in the README.

@PaulRBerg
Copy link
Author

Thanks, @dglsparsons. Writing the file in CI is precisely what we ended up doing.

get that this is not ideal, but it's well-documented in the README.

Yes, but the way it is currently explained leads to a bad local developer experience (because of that .cargo/config.toml file).

IMO, the README should be updated to recommend creating the Cargo file programmatically, as suggested here.

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

No branches or pull requests

2 participants