Repository navigation
fix(tooling): release builds without the tooling feature skip process dev flags and ambient OTEL timing - #1775
Merged
Merged
Conversation
… dev flags and ambient OTEL timing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #589
Problem
toolingfeature,Args::parse()andArgs::parse_process()(crates/rune/src/tooling/args.rs) still parsedstd::env::args()for Rune's developer flags. A shipped app would print Rune's--helpand exit0, exit2on a malformed flag value like--size large, fail on--snap, or panic on non-UTF-8 arguments.tooling::interaction::gate::decide(crates/rune/src/tooling/interaction/gate.rs) enabled interaction timing, watchdog stack sampling, and OTLP span export in any build when an ambientOTEL_EXPORTER_OTLP_ENDPOINTpointed at loopback.Ecosystem convention
crates/tauri/Cargo.toml:216,crates/tauri-runtime-wry/src/lib.rs:1472)#[cfg(any(debug_assertions, feature = "devtools"))]; never interceptsstd::env::args().crates/gpui/Cargo.toml:36,crates/gpui/src/element.rs:34)#[cfg(any(feature = "inspector", debug_assertions))]; never interceptsstd::env::args().Cargo.toml:47-53,src/application.rs:190-215)debugandtesterCargo features (off by default); never interceptsstd::env::args().Cargo.toml:158-165,468-477)devandtrace_*Cargo features (off by default); never interceptsstd::env::args().packages/desktop/src/webview.rs:25,564-570,launch.rs:103)debug_assertions/devtoolsfeature.internal/core/graphics/rendering_metrics_collector.rs:65-78)std::env::args(); only its ownSLINT_DEBUG_PERFORMANCEenv var opts into release perf metrics.docs/tutorial/fuses.md:5-75) & Flutter (docs.flutter.dev/testing/build-modes)specification/protocol/exporter.md:24-35,opentelemetry-otlp/src/lib.rs:228)OTEL_EXPORTER_OTLP_ENDPOINTconfigures an exporter the app enabled; it never auto-enables tracing in a shipped app.Changes
flowchart LR P[Process argv & env] --> G{debug_assertions OR feature tooling/hot?} G -- yes --> Parse[Parse Rune dev flags + allow loopback OTEL endpoint] G -- no --> Ship[All process args -> extra_args; ignore OTEL unless RUNE_PERF=1] E[App::args / run_windows_with_args] --> Explicit[Args::parse_from still parses explicit list]crates/rune/src/tooling/args.rs: Addeddev_tooling_enabled()(cfg!(any(feature = "tooling", feature = "hot", debug_assertions))) andArgs::parse_process_argv. When off,Args::parse()andArgs::parse_process()skip Rune flag parsing, leave every process argument inextra_args(), and returnfalsefromis_headless(). Process arguments are decoded viastd::env::args_os()lossily so non-UTF-8 arguments do not panic. ExplicitArgs::parse_from(App::args,run_windows_with_args) still parses the list the app passed.crates/rune/src/tooling/interaction/gate.rs: Gated ambient loopbackOTEL_EXPORTER_OTLP_ENDPOINTauto-enable ondev_tooling_enabled(). ExplicitRUNE_PERF=1still turns interaction timing on in any build, andRUNE_PERF=0still wins.crates/rune/Cargo.toml,crates/rune/README.md,scripts/native-pacing/README.md,crates/rune/examples/pacing.rs: Documented the release-build rule and added--features toolingto the--profile perfpacingexample commands. All other repo scripts and examples that pass Rune flags in release/perf builds already enabletooling(directly, viakeys-overlay, or viaframe-profile).crates/rune/src/tooling/args_tests.rs,crates/rune/src/tooling/interaction/tests.rs: Added unit tests covering process argument pass-through withouttooling(including--helpand malformed values), lossy non-UTF-8 decoding, and ignoring ambientOTEL_EXPORTER_OTLP_ENDPOINTwithouttooling.changelog/unreleased/2026-11-24-release-dev-tooling-gate.md: Added changelog fragment.Verification
tooling::args_tests,tooling::interaction,tooling::window_tests, and--test extra_argson Windows).cargo check -p rune --no-default-features --target wasm32-unknown-unknown,cargo check -p rune -p rune-kit --testson macOS arm64 and Linux aarch64,cargo check -p rune --releaseon macOS arm64, andscripts/file-size.sh.pacingcapture.