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

chore(cargo): add config.toml file #3443

Closed
wants to merge 1 commit into from
Closed

Conversation

cratelyn
Copy link
Collaborator

we use the kubert crate to export a collection of metrics measuring the behavior of our asynchronous tokio runtime.

in order for this crate to compile, one must set a compile-time flag. this can be done either by setting the RUSTFLAGS environment variable, or via a toml file in .cargo/config.toml.

helpful links:

this commit introduces a file providing this rustflags flag.

note that, per the cargo reference (linked above), the environment variable takes precedence over the value provided in the config.toml file.

so, providing this flag here will allow a conventional cargo build to build the project successfully without setting any environment variables, without interfering with users' ability to provide additional compiler flags when needed.

we use the `kubert` crate to export a collection of metrics measuring
the behavior of our asynchronous tokio runtime.

in order for this crate to compile, one must set a compile-time flag.
this can be done either by setting the `RUSTFLAGS` environment variable,
or via a toml file in `.cargo/config.toml`.

helpful links:

- <https://github.com/olix0r/kubert?tab=readme-ov-file#kubert-prometheus-tokio>
- <https://docs.rs/tokio-metrics/latest/tokio_metrics/>
- <https://doc.rust-lang.org/cargo/reference/config.html#buildrustflags>

this commit introduces a file providing this `rustflags` flag.

note that, per the cargo reference (linked above), the environment
variable takes precedence over the value provided in the `config.toml`
file.

so, providing this flag here will allow a conventional `cargo build` to
build the project successfully without setting any environment
variables, without interfering with users' ability to provide additional
compiler flags when needed.

Signed-off-by: katelyn martin <kate@buoyant.io>
@olix0r
Copy link
Member

olix0r commented Dec 11, 2024

In general, I don't think we should commit .cargo/config.toml -- this file can be used for other settings that definitely should not be committed. Would it be suitable to include .cargo in our gitignore so you can safely make modifications without causing git dirtiness?

cratelyn added a commit that referenced this pull request Dec 11, 2024
this commit supercedes #3443.

we use the kubert crate to export a collection of metrics measuring the
behavior of our asynchronous tokio runtime.

in order for this crate to compile, one must set a compile-time flag.
this can be done either by setting the RUSTFLAGS environment variable,
or via a toml file in .cargo/config.toml.

helpful links:

- <https://github.com/olix0r/kubert?tab=readme-ov-file#kubert-prometheus-tokio>
- <https://docs.rs/tokio-metrics/latest/tokio_metrics/>
- <https://doc.rust-lang.org/cargo/reference/config.html#buildrustflags>

this commit adds `.cargo` to the repository's gitignore, so that people
may freely modify cargo configuration as needed when building the
project from source.

Signed-off-by: katelyn martin <kate@buoyant.io>
@cratelyn
Copy link
Collaborator Author

that works well enough for my uses! i've opened #3451, i'll go ahead and close this now.

@cratelyn cratelyn closed this Dec 11, 2024
cratelyn added a commit that referenced this pull request Dec 11, 2024
this commit supercedes #3443.

we use the kubert crate to export a collection of metrics measuring the
behavior of our asynchronous tokio runtime.

in order for this crate to compile, one must set a compile-time flag.
this can be done either by setting the RUSTFLAGS environment variable,
or via a toml file in .cargo/config.toml.

helpful links:

- <https://github.com/olix0r/kubert?tab=readme-ov-file#kubert-prometheus-tokio>
- <https://docs.rs/tokio-metrics/latest/tokio_metrics/>
- <https://doc.rust-lang.org/cargo/reference/config.html#buildrustflags>

this commit adds `.cargo` to the repository's gitignore, so that people
may freely modify cargo configuration as needed when building the
project from source.

Signed-off-by: katelyn martin <kate@buoyant.io>
cratelyn added a commit that referenced this pull request Dec 11, 2024
this commit supercedes #3443.

we use the kubert crate to export a collection of metrics measuring the
behavior of our asynchronous tokio runtime.

in order for this crate to compile, one must set a compile-time flag.
this can be done either by setting the RUSTFLAGS environment variable,
or via a toml file in .cargo/config.toml.

helpful links:

- <https://github.com/olix0r/kubert?tab=readme-ov-file#kubert-prometheus-tokio>
- <https://docs.rs/tokio-metrics/latest/tokio_metrics/>
- <https://doc.rust-lang.org/cargo/reference/config.html#buildrustflags>

this commit adds `.cargo` to the repository's gitignore, so that people
may freely modify cargo configuration as needed when building the
project from source.

Signed-off-by: katelyn martin <kate@buoyant.io>
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