Skip to content

Work around rustc bug on nightly and make benchmarks not run test code #1301

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 14, 2022

Conversation

TheBlueMatt
Copy link
Collaborator

No description provided.

Apparently rustc doesn't (actually) provide any kind of
compilation-stability guarantees, despite their claims. Here we
work around rustc being unstable by making the trait call explicit.

See also rust-lang/rust#93599
`cargo bench` sets `cfg(test)`, causing us to hit some test-only
code in the router when benchmarking, throwing off our benchmarks
substantially. Here we swap from the `unstable` feature to a more
clearly internal feature (`_bench_unstable`) and also checking for
it when enabling test-only code.
@TheBlueMatt TheBlueMatt force-pushed the 2022-02-router-no-test branch from fe92120 to c8e3078 Compare February 10, 2022 22:28
@jkczyz jkczyz self-requested a review February 10, 2022 22:32
@@ -24,7 +24,7 @@ max_level_trace = []
# Allow signing of local transactions that may have been revoked or will be revoked, for functional testing (e.g. justice tx handling).
# This is unsafe to use in production because it may result in the counterparty publishing taking our funds.
unsafe_revoked_tx_signing = []
unstable = []
_bench_unstable = []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just call this _bench? Presumably we'd still want this when no longer unstable.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well the only reason we have a feature is because its unstable. If cargo bench weren't unstable we'd remove the feature entirely (though there's some indication cargo bench will never be stabilized).

@TheBlueMatt TheBlueMatt merged commit 963f8d9 into lightningdevkit:main Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants