Skip to content

Commit 82886bc

Browse files
Merge branch 'stable2512' into backport-11425-to-stable2512
2 parents 426dda2 + 453e552 commit 82886bc

File tree

4 files changed

+85
-12
lines changed

4 files changed

+85
-12
lines changed

.github/workflows/release-80_publish-crates.yml

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ on:
4040
required: false
4141
type: string
4242
default: prdoc
43+
publish_jobs:
44+
description: 'Number of parallel publish jobs (0 = sequential publishing, >0 = parallel with N jobs).'
45+
required: false
46+
type: string
47+
default: '0'
4348

4449
permissions:
4550
contents: write
@@ -251,6 +256,13 @@ jobs:
251256
cargo update --workspace --offline || cargo update --workspace
252257
echo "Cargo.lock updated"
253258
259+
- name: Verify workspace compiles
260+
if: inputs.resume_from == 'full' || inputs.resume_from == 'apply'
261+
run: |
262+
echo "Checking that rewritten manifests compile..."
263+
cargo check --workspace --all-targets 2>&1
264+
echo "Workspace compiles successfully"
265+
254266
- name: Commit version bumps
255267
if: inputs.resume_from == 'full' || inputs.resume_from == 'apply'
256268
shell: bash
@@ -279,7 +291,7 @@ jobs:
279291
280292
if [ "$REGISTRY" = "staging.crates.io" ]; then
281293
cat >> ~/.cargo/config.toml << 'EOF'
282-
[registries.crates-io]
294+
[registries.staging]
283295
index = "sparse+https://index.staging.crates.io/"
284296
EOF
285297
else
@@ -293,18 +305,30 @@ jobs:
293305
if: inputs.resume_from != 'push'
294306
shell: bash
295307
env:
296-
PARITY_PUBLISH_CRATESIO_TOKEN: ${{ inputs.registry == 'staging.crates.io' && secrets.STAGING_CRATES_IO_API_TOKEN || secrets.CRATES_IO_API_TOKEN }}
308+
PARITY_PUBLISH_CRATESIO_TOKEN: ${{ secrets.CRATES_IO_API_TOKEN }}
309+
PARITY_PUBLISH_STAGING_CRATESIO_TOKEN: ${{ secrets.STAGING_CRATES_IO_API_TOKEN }}
297310
DRY_RUN: ${{ inputs.dry_run }}
298311
REGISTRY: ${{ inputs.registry }}
312+
PUBLISH_JOBS: ${{ inputs.publish_jobs }}
299313
run: |
314+
PARALLEL_ARGS=""
315+
if [ "$PUBLISH_JOBS" -gt 0 ] 2>/dev/null; then
316+
echo "Parallel publishing enabled with $PUBLISH_JOBS jobs"
317+
PARALLEL_ARGS="-j $PUBLISH_JOBS --no-verify"
318+
fi
319+
320+
STAGING_ARG=""
321+
if [ "$REGISTRY" = "staging.crates.io" ]; then
322+
STAGING_ARG="--staging"
323+
fi
300324
301325
if [ "$DRY_RUN" = true ]; then
302326
echo "DRY RUN - Not actually publishing crates"
303327
echo "Target registry: $REGISTRY"
304-
parity-publish apply -p -d
328+
parity-publish apply -p -d $STAGING_ARG $PARALLEL_ARGS
305329
else
306330
echo "Publishing crates to $REGISTRY..."
307-
parity-publish apply -p
331+
parity-publish apply -p $STAGING_ARG $PARALLEL_ARGS
308332
echo "Crates published successfully to $REGISTRY!"
309333
fi
310334
@@ -331,6 +355,7 @@ jobs:
331355
if: failure()
332356
env:
333357
CRATES_RELEASE_BRANCH: ${{ steps.derive_branch.outputs.CRATES_RELEASE_BRANCH }}
358+
GITHUB_TOKEN: ${{ github.token }}
334359
run: |
335360
echo "Job failed. Pushing branch '$CRATES_RELEASE_BRANCH' to origin (paritytech-release) to preserve state for resume..."
336361
# Restore origin to the fork repo in case it was changed by the upstream push step

prdoc/pr_10749.prdoc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
title: '[pallet-revive] fixtures compilation fix for rust 1.92.0'
2+
doc:
3+
- audience: Runtime Dev
4+
description: |-
5+
Fix this error after upgrading to rustc 1.92.0:
6+
7+
```
8+
error: panic_immediate_abort is now a real panic strategy! Enable it with `panic = "immediate-abort"` in Cargo.toml, or with the compiler flags `-Zunstable-options -Cpanic=immediate-abort`. In both cases, you still need to build core, e.g. with `-Zbuild-std`
9+
--> /Users/robert/.rustup/toolchains/1.92.0-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/panicking.rs:36:1
10+
```
11+
crates:
12+
- name: pallet-revive-fixtures
13+
bump: patch
14+
- name: pallet-revive
15+
bump: patch

substrate/frame/revive/fixtures/src/builder.rs

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,37 @@ pub fn create_cargo_toml<'a>(
195195

196196
/// Invoke cargo build to compile contracts to RISC-V ELF.
197197
pub fn invoke_build(current_dir: &Path) -> Result<()> {
198-
let encoded_rustflags = ["-Dwarnings"].join("\x1f");
198+
// Necessary to make this work with both 1.92+ and versions before 1.92 of rustc.
199+
let immediate_abort = {
200+
let mut cmd = Command::new("rustc");
201+
if let Ok(tc) = env::var(OVERRIDE_RUSTUP_TOOLCHAIN_ENV_VAR) {
202+
cmd.arg(format!("+{tc}"));
203+
}
204+
let out = cmd.arg("--version").output().context("rustc --version failed")?;
205+
let ver = String::from_utf8(out.stdout).context("utf8 from rustc --version failed")?;
206+
let ver_num = ver
207+
.split_whitespace()
208+
.nth(1)
209+
.ok_or_else(|| anyhow::anyhow!("unexpected rustc --version output: {ver}"))?;
210+
let mut parts = ver_num.split('.');
211+
let major: u32 = parts
212+
.next()
213+
.ok_or_else(|| anyhow::anyhow!("missing major version"))?
214+
.parse()
215+
.context("invalid major version")?;
216+
let minor: u32 = parts
217+
.next()
218+
.ok_or_else(|| anyhow::anyhow!("missing minor version"))?
219+
.parse()
220+
.context("invalid minor version")?;
221+
major > 1 || (major == 1 && minor >= 92)
222+
};
223+
224+
let encoded_rustflags = if immediate_abort {
225+
["-Dwarnings", "-Zunstable-options", "-Cpanic=immediate-abort"].join("\x1f")
226+
} else {
227+
["-Dwarnings"].join("\x1f")
228+
};
199229

200230
let mut args = polkavm_linker::TargetJsonArgs::default();
201231
args.is_64_bit = true;
@@ -211,8 +241,11 @@ pub fn invoke_build(current_dir: &Path) -> Result<()> {
211241
.args([
212242
"build",
213243
"--release",
214-
"-Zbuild-std=core",
215-
"-Zbuild-std-features=panic_immediate_abort",
244+
if immediate_abort {
245+
"-Zbuild-std=core -Zbuild-std-features=panic_immediate_abort"
246+
} else {
247+
"-Zbuild-std=core"
248+
},
216249
])
217250
.arg("--target")
218251
.arg(polkavm_linker::target_json_path(args).unwrap());

substrate/frame/revive/src/tests/pvm.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ fn deploy_and_call_other_contract() {
679679
),
680680
source: ALICE,
681681
dest: callee_account.clone(),
682-
transferred: 2156,
682+
transferred: contract_base_deposit(&callee_addr),
683683
}),
684684
topics: vec![],
685685
},
@@ -2084,7 +2084,7 @@ fn instantiate_with_zero_balance_works() {
20842084
event: RuntimeEvent::Balances(pallet_balances::Event::TransferAndHold {
20852085
source: ALICE,
20862086
dest: Pallet::<Test>::account_id(),
2087-
transferred: 777,
2087+
transferred: get_code_deposit(&code_hash),
20882088
reason: <Test as Config>::RuntimeHoldReason::Contracts(
20892089
HoldReason::CodeUploadDepositReserve,
20902090
),
@@ -2131,7 +2131,7 @@ fn instantiate_with_zero_balance_works() {
21312131
),
21322132
source: ALICE,
21332133
dest: account_id,
2134-
transferred: 337,
2134+
transferred: contract_base_deposit(&addr),
21352135
}),
21362136
topics: vec![],
21372137
},
@@ -2173,7 +2173,7 @@ fn instantiate_with_below_existential_deposit_works() {
21732173
event: RuntimeEvent::Balances(pallet_balances::Event::TransferAndHold {
21742174
source: ALICE,
21752175
dest: Pallet::<Test>::account_id(),
2176-
transferred: 777,
2176+
transferred: get_code_deposit(&code_hash),
21772177
reason: <Test as Config>::RuntimeHoldReason::Contracts(
21782178
HoldReason::CodeUploadDepositReserve,
21792179
),
@@ -2229,7 +2229,7 @@ fn instantiate_with_below_existential_deposit_works() {
22292229
),
22302230
source: ALICE,
22312231
dest: account_id.clone(),
2232-
transferred: 337,
2232+
transferred: contract_base_deposit(&addr),
22332233
}),
22342234
topics: vec![],
22352235
},

0 commit comments

Comments
 (0)