Closed adamreichold closed 4 years ago
Out of curiosity, does this solve any real-world problems for you? If so, can you describe that?
Yes, we just changed the atomic
crate to use autocfg
to probe for the availability of the Atomic{U,I}{8,16,32,64,128}
in core
. For amd64, one needs to set RUSTFLAGS=-Ctarget-feature=+cx16 -Zcrate-attr=feature(integer_atomics)
to get access to the Atomic{U,I}128
types which is currently not possible as this is not a cross build scenario w.r.t. the current definition even if --target
is given explicitly and hence we had to resort to build for AArch64 to test this.
@cuviper Just a friendly ping if there is anything that still needs to be changed here?
This looks good, although I wish we had a test. I'm not sure how we would do that though -- maybe a workspace crate that can use a real build script, driving with and without --target
in the CI script?
I hope you have at least verified that it works in your scenario?
I hope you have at least verified that it works in your scenario?
Yes, I have checked that this allows me to pass RUSTFLAGS
into the probes using cargo --target ${HOST}
but ...
This looks good, although I wish we had a test. I'm not sure how we would do that though -- maybe a workspace crate that can use a real build script, driving with and without
--target
in the CI script?
... I will add a unit test by factoring out the detection logic. I think the direct feedback during development is more important than the accuracy of testing an actual Cargo invocation.
I think the direct feedback during development is more important than the accuracy of testing an actual Cargo invocation.
Fair -- I probably lean too often on black-box testing.
Thanks! I'll go ahead and publish 1.0.1 from here.
bors r+
This checks the output directory for the
$CARGO_TARGET_DIR/$TARGET
pattern making use ofMAIN_SEPARATOR
to try to handle Windows. It will also fail if either the path or that pattern are not valid UFT-8, but it will then fall back to the current behavior. (So this basically tries to implement https://github.com/cuviper/autocfg/pull/10#issuecomment-527575030.)