Closed fabiosky closed 4 years ago
Description of changes: Have the rust global build script build.rs generate the cargo config file.
build.rs
The cargo config file will contain the intersection of:
In this way, we prevent invalid instructions being executed on machines that do not support them.
I tested this on a RHEL6 machine (without avx support) and the generated cargo file looks the following:
[build] rustflags = ["-g","-C","target-feature=+sse2"]
cargo test works fine.
cargo test
Instead, on another machine with avx2 support the following config file is generated:
[build] rustflags = ["-g","-C","target-feature=+sse2,+avx,+avx2"]
@nacho can you give a look at this? I also tried this patch on Windows and it is working fine.
This sounds weird... are we user build.rs gets executed before cargo itself reads the config?
Description of changes: Have the rust global build script
build.rs
generate the cargo config file.The cargo config file will contain the intersection of:
In this way, we prevent invalid instructions being executed on machines that do not support them.
I tested this on a RHEL6 machine (without avx support) and the generated cargo file looks the following:
cargo test
works fine.Instead, on another machine with avx2 support the following config file is generated: