Commit graph

9 commits

Author SHA1 Message Date
1b14d44d57 Allow easy overriding of the opt-level/debuginfo/codegen-units flags
Some crates use debuginfo=0 or debuginfo=1 to reduce memory pressure during
builds. This should make this easy.

Fixes https://pagure.io/fedora-rust/rust2rpm/issue/181
2022-02-22 12:05:49 +01:00
0aa82d22b0 Add comment about unused macro 2022-02-22 11:28:52 +01:00
e1f911661f Include linker flags for package note in %build_rustflags
%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.
2022-02-15 17:25:09 +01:00
Igor Gnatenko
a6bde5599a
Pass --cap-lints=warn to the RUSTFLAGS
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>
2019-12-03 19:11:20 +01:00
Igor Gnatenko
ecc850755e
macros: Use %{build_rustflags} convention
But keep %__global_rustflags around for compatibility.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-04-23 21:14:51 +02:00
Igor Gnatenko
3076bbaa3a
macros: Pass -Ccodegen-units=1 in RUSTFLAGS
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>
2019-04-23 21:14:51 +02:00
Martin Sehnoutka
2c556e1473 macros: explicitly set rustdoc
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
2017-06-23 13:41:42 +02:00
Josh Stone
23b334286c Switch rustflags from -g to -Cdebuginfo=2
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.
2017-03-30 10:37:25 -07:00
Igor Gnatenko
74beb9388f move RPM stuff into subdirectory
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2017-02-05 18:15:28 +01:00
Renamed from macros.rust (Browse further)