* [ruby-core:124892] [Ruby Feature#21929] Add configure script options for instrumenting Rust builds
@ 2026-02-27 17:39 jprokop (Jarek Prokop) via ruby-core
0 siblings, 0 replies; only message in thread
From: jprokop (Jarek Prokop) via ruby-core @ 2026-02-27 17:39 UTC (permalink / raw)
To: ruby-core; +Cc: jprokop (Jarek Prokop)
Issue #21929 has been reported by jprokop (Jarek Prokop).
----------------------------------------
Feature #21929: Add configure script options for instrumenting Rust builds
https://bugs.ruby-lang.org/issues/21929
* Author: jprokop (Jarek Prokop)
* Status: Open
----------------------------------------
Ruby at this moment optionally includes Rust bits. Right now this touches mostly YJIT and ZJIT.
Rust is a compiled language with various compile flags at various stages and approaches.
My ask is to provide a way to instrument compilation similarly as with C at the moment so that packagers and distributions
can be fully and easily compliant with their guidelines on compilation flags.
Currently, for production build of Ruby, `rustc` tool is used, which is instrumented differently from `cargo` in debug builds.
In my PR motivated by the described goal: https://github.com/ruby/ruby/pull/15695
I have focused on providing `rustc` with our distribution flags, during the PR
it was mentioned that there are flags related to security https://github.com/ruby/ruby/pull/15695#discussion_r2663651764
that should be present even when providing distribution flags.
This is not too different from C, as there are also security flags,
such as configure script enabling the arm64's BTI and PAC when possible.
`rustc` of version 1.92, at the time of the PR uses the last mention of a flag.
Ideally `rustc` would know `RUSTFLAGS`, but as far as I can tell, the enviroment variable only affects `cargo`.
In Fedora the current guidance recommends using `%build_rustflags` https://docs.fedoraproject.org/en-US/packaging-guidelines/Rust/#_compiler_flags
which expands to `-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cstrip=none -Cforce-frame-pointers=yes --cap-lints=warn`
The best result is each part of Rust in Ruby would receive the flags defined during `configure` time.
In cases where complication flags should conflict, in Fedora distribution flags take precedence:
https://docs.fedoraproject.org/en-US/packaging-guidelines/Rust/#_building_with_cargo_internally
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-02-27 17:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-27 17:39 [ruby-core:124892] [Ruby Feature#21929] Add configure script options for instrumenting Rust builds jprokop (Jarek Prokop) via ruby-core
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).