Skip to content
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

[stable2407] Backport #5632 #5633

Merged
merged 2 commits into from
Sep 9, 2024
Merged

[stable2407] Backport #5632 #5633

merged 2 commits into from
Sep 9, 2024

Conversation

github-actions[bot]
Copy link

@github-actions github-actions bot commented Sep 7, 2024

Backport #5632 into stable2407 (cc @clangenb).

…5632)

The macro hygiene for the `format_runtime_string!` macro was broken
since #5010, which
resulted in the following build error under certain circumstances:

```console
  error[E0433]: failed to resolve: use of undeclared crate or module `alloc`
      --> /home/clang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/frame-benchmarking-36.0.0/src/v1.rs:1738:2
       |
  1738 | /     sp_runtime::format_runtime_string!(
  1739 | |         "\n* Pallet: {}\n\
  1740 | |         * Benchmark: {}\n\
  1741 | |         * Components: {:?}\n\
  ...    |
  1750 | |         error_message,
  1751 | |     )
       | |_____^ use of undeclared crate or module `alloc`
       |
       = note: this error originates in the macro `sp_runtime::format_runtime_string` (in Nightly builds, run with -Z macro-backtrace for more info)

  For more information about this error, try `rustc --explain E0433`.
```

This bug has been known already, but hasn't been fixed so far, see
#5213 and
https://substrate.stackexchange.com/questions/11786/use-of-undeclared-crate-or-module-alloc-when-upgrade-to-v1-13-0.

I have made a mini rust crate that can reproduce the bug, and it also
shows that this PR will fix the issue:
https://github.com/clangenb/sp-runtime-string-test.

(cherry picked from commit 96fecc3)
@github-actions github-actions bot added the A3-backport Pull request is already reviewed well in another branch. label Sep 7, 2024
@ggwpez ggwpez added the T1-FRAME This PR/Issue is related to core FRAME, the framework. label Sep 7, 2024
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Copy link
Author

github-actions bot commented Sep 7, 2024

This pull request is amending an existing release. Please proceed with extreme caution,
as to not impact downstream teams that rely on the stability of it. Some things to consider:

  • Backports are only for 'patch' or 'minor' changes. No 'major' or other breaking change.
  • Should be a legit fix for some bug, not adding tons of new features.
  • Must either be already audited or trivial (not sure audit).
Emergency Bypass

If you really need to bypass this check: add validate: false to each crate
in the Prdoc where a breaking change is introduced. This will release a new major
version of that crate and all its reverse dependencies and basically break the release.

@ggwpez ggwpez merged commit e7f404c into stable2407 Sep 9, 2024
150 of 163 checks passed
@ggwpez ggwpez deleted the backport-5632-to-stable2407 branch September 9, 2024 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A3-backport Pull request is already reviewed well in another branch. T1-FRAME This PR/Issue is related to core FRAME, the framework.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants