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

Array merging (eg rustflags) appears to be in reverse order #17

Closed
nipunn1313 opened this issue Apr 8, 2024 · 2 comments
Closed

Array merging (eg rustflags) appears to be in reverse order #17

nipunn1313 opened this issue Apr 8, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@nipunn1313
Copy link

nipunn1313 commented Apr 8, 2024

According to https://doc.rust-lang.org/nightly/cargo/reference/config.html#hierarchical-structure -

If a key is specified in multiple config files, the values will get merged together. Numbers, strings, and booleans will use the value in the deeper config directory taking precedence over ancestor directories, where the home directory is the lowest priority. Arrays will be joined together with higher precedence items being placed later in the merged array.

I am finding that if I place some rustflags in ~/.cargo/config.toml and some in $myrepo/.cargo/config.toml, then cargo and cargo-config2 merge in reverse order - with I believe cargo implementing the spec behavior, and cargo-config2 doing it in reverse.

I have a repro here
https://github.com/nipunn1313/cargo_config_array_merge_repro

@taiki-e
Copy link
Owner

taiki-e commented Apr 9, 2024

Fixed in 0.1.24. Thanks for the report!

@nipunn1313
Copy link
Author

confirmed that the fix works on my repro!

nipunn1313 added a commit to nipunn1313/maturin that referenced this issue Apr 9, 2024
Picks up the fix to taiki-e/cargo-config2#17
which was leading to spurious recompiles.
messense pushed a commit to PyO3/maturin that referenced this issue Apr 9, 2024
Picks up the fix to taiki-e/cargo-config2#17
which was leading to spurious recompiles.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants