%build_rustflags was used in %cargo_prep, which is executed in %prep,
when %buildsubdir is not set yet. To avoid this, insertion of flags is
moved to an environment variable that is set for %cargo_build and
%cargo_test.
The linker flag gets passed to rustc, and resulting binaries seem to have
note as expected.
It is simply impossible to fight against people putting
#![deny(warnings)] into the code…
Closes: https://pagure.io/fedora-rust/rust2rpm/issue/98
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
This has good impact on performance and binary size at cost of
compilation time. As nice side effect, it fixes bug which breaks
compilation of binaries in Fedora Rawhide.
For example, ffsend binary went from 107M to 70M.
References: https://bugzilla.redhat.com/show_bug.cgi?id=1701339
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
On systems where rustup is used, simple rpmbuild will use rustc from system,
but rustdoc will be taken from PATH which might be different from system.
Given this, doc-tests or anything related to rustdoc will fail with mis-mathching
rustc version.
Merges: https://pagure.io/fedora-rust/rust2rpm/pull-request/38
Since rustc doesn't allow `-g` and `-Cdebuginfo` options to mix, we need
to make sure we're consistent with the option crates may set in their
own `[profile] debug` settings. Cargo used to send `-g` for that, but
switched to `-Cdebuginfo` in version 0.17.0.
Fixes#32.