Commit 3b700ee
authored
fix(l1): fix the crates.io publish failure and make the workflow re-runnable (#6899)
**Motivation**
The first real `Publish crates to crates.io` run published `ethrex-rlp`,
`ethrex-crypto`, `ethrex-sdk-contract-utils`, then **failed on the 4th
crate, `ethrex-trie`**:
```
error: unused import: `std::arch::x86_64::*`
--> nibbles.rs:198:9
= note: `-D unused-imports` implied by `-D warnings`
error: failed to verify package tarball
```
Three distinct problems surfaced:
1. **The crate failure.** `use std::arch::x86_64::*` is only used inside
a `#[cfg(target_feature = "ssse3")]` block. The publish verify build
runs under `-D warnings` (injected by `setup-rust-toolchain`), and that
`RUSTFLAGS` *also overrides* the `+ssse3` target-feature set in
`.cargo/config.toml` — so SSSE3 is off, the import is unused, and `-D
warnings` turns it into a hard error.
2. **The dry-run was useless.** `cargo publish --dry-run` over an
unpublished workspace makes every dependent fail dependency resolution
(its siblings aren't on the index yet) *before it compiles*; the
tolerant logic reported success while testing nothing. That's why the
trie failure wasn't caught.
3. **Re-runs weren't idempotent.** The workflow matched `"already
exists"`, but modern cargo emits `"already uploaded"` — so a re-run
would fail on `ethrex-rlp` (already published) instead of skipping it.
**Description**
- **`crates/common/trie/nibbles.rs`**: move `use std::arch::x86_64::*`
into the `#[cfg(target_feature = "ssse3")]` block so it is only present
when its intrinsics are.
- **`publish.yml` — disable `-D warnings`** (`rustflags: ""` on
`setup-rust-toolchain`). Publishing already-reviewed, separately-linted
code should not deny warnings; this also stops `RUSTFLAGS` from
clobbering the config.toml target-features during the verify build.
Neutralizes the entire warning class for all crates.
- **`publish.yml` — idempotent re-runs**: match `already
(uploaded|exists)` so re-running skips versions already on crates.io.
- **`publish.yml` — a dry-run that works**: replace `cargo publish
--dry-run` with `cargo package --no-verify --list` (tarball file set, no
index lookup) + `cargo check` (compile with default features). Both run
against workspace path deps, so they validate every crate without
anything being published.
**Validation**
- Reproduced the trie failure locally under the exact verify conditions
(`--target x86_64-unknown-linux-gnu`, `RUSTFLAGS=-D warnings`);
confirmed the fix compiles clean there and the import is still used when
SSSE3 is on.
- Audited every `std::arch` / `target_feature` site in the publish set:
only `ethrex-trie` (fixed) and `ethrex-crypto` (already published OK)
have arch-gated code.
- Ran the new dry-run on a real x86_64 CI runner: all 16 crates pass
(`cargo check` green for each).
**How to re-run the publish after merge**
1. **Actions → Publish crates to crates.io → Run workflow**, `dry_run`
checked (default) → verifies all 16 without publishing.
2. Re-run with `dry_run` off → publishes; the 3 already-published crates
are skipped, `ethrex-trie` onward publish.
**Checklist**
- [ ] Updated `STORE_SCHEMA_VERSION` (crates/storage/lib.rs) if the PR
includes breaking changes to the `Store` requiring a re-sync. — N/A.1 parent 1a55752 commit 3b700ee
2 files changed
Lines changed: 19 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
33 | 39 | | |
34 | 40 | | |
35 | 41 | | |
| |||
59 | 65 | | |
60 | 66 | | |
61 | 67 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
70 | 76 | | |
71 | 77 | | |
72 | 78 | | |
73 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
74 | 82 | | |
75 | 83 | | |
76 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
199 | | - | |
200 | 198 | | |
201 | 199 | | |
202 | 200 | | |
| |||
207 | 205 | | |
208 | 206 | | |
209 | 207 | | |
| 208 | + | |
210 | 209 | | |
211 | 210 | | |
212 | 211 | | |
| |||
0 commit comments