Skip to content

scx_cake: bump version + scx_cargo to fix crates.io install#3604

Open
rrnewton wants to merge 1 commit into
sched-ext:mainfrom
rrnewton:fix/scx-cake-cargo-bump-1-1-3
Open

scx_cake: bump version + scx_cargo to fix crates.io install#3604
rrnewton wants to merge 1 commit into
sched-ext:mainfrom
rrnewton:fix/scx-cake-cargo-bump-1-1-3

Conversation

@rrnewton

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #3583 / commits 97cf25f + 11cb5f2 that landed the symlink-based path fix for scx_cake (the same pattern scx_cosmos adopted in commit 605c7d2). That fix resolved the original

clang: error: no such file or directory: '../../../lib/arena.bpf.c'

blocking cargo install scx_cake from crates.io for 1.1.1. However, scx_cake 1.1.2 still cannot install from crates.io for a closely-related but distinct reason — surfaced only by cargo package -p scx_cake (verify step) end-to-end against the published deps:

src/bpf/lib/sdt_alloc.bpf.c:45:2: error: call to undeclared function 'scx_err_loc'

Why

Unlike scx_cosmos (which only bundles pmu.bpf.c), scx_cake bundles sdt_alloc.bpf.c and sdt_task.bpf.c — both of which now use the scx_err_loc / scx_err / scx_out_loc macros introduced in commit 73b4543 (lib: move allocators to BPF streams reporting, 2026-05-13). Those macros live in scheds/include/lib/alloc/bpf_helpers_local.h, which ships inside the scx_cargo crate's bpf_h tarball.

But the scx_cargo on crates.io is still 1.1.1 (published 2026-05-13, before the streams refactor). Its bundled bpf_helpers_local.h predates the macros, so any cake 1.1.2 install from crates.io against the published scx_cargo 1.1.1 fails clang at sdt_alloc.

Fix

Re-publish scx_cargo with the current (post-streams) bpf_h, and bump scx_cake to consume it:

  • rust/scx_cargo: 1.1.11.1.2 (no code change — bpf_h is a symlink to ../../scheds/include, resolved at cargo package time, so the bump alone carries the updated bpf_helpers_local.h to crates.io)
  • scheds/rust/scx_cake: 1.1.21.1.3, and bump build-dep scx_cargo "1.1.1""1.1.2"
  • Cargo.lock updated to match

Release ordering

scx_cargo 1.1.2 must be published to crates.io before scx_cake 1.1.3 so cargo can resolve the new build-dep version.

Test plan

Local pre-publish simulation (the published scx_cargo 1.1.2 doesn't exist yet, so the standard cargo package --verify chicken-and-eggs — the workaround mirrors what cargo install will do post-publish):

  • cargo build -p scx_cake clean (workspace path deps)

  • cargo package -p scx_cargo -p scx_cake --no-verify produces both tarballs

  • Extract both tarballs side-by-side under /tmp/cake-install-sim/:

    • scx_cargo-1.1.2/bpf_h/lib/alloc/bpf_helpers_local.h contains scx_err_loc
    • scx_cake-1.1.3/src/bpf/lib/ contains all 8 lib .bpf.c files referenced by build.rs
  • In extracted scx_cake-1.1.3/, inject

    [workspace]
    
    [patch.crates-io]
    scx_cargo = { path = "../scx_cargo-1.1.2" }

    then cargo build — succeeds end-to-end. scx_err_loc resolves via the new bpf_h tar that scx_cargo 1.1.2 ships, and all add_source("src/bpf/lib/*.bpf.c") paths resolve inside the flat extracted tarball. This is the most faithful local simulation of cargo install scx_cake post-publish: the contents inside the extracted tarballs are exactly what the registry would serve.

  • Reviewer / release engineer: publish scx_cargo 1.1.2 first, then scx_cake 1.1.3, then cargo install scx_cake from a clean toolchain to confirm crates.io install path.

Commits 97cf25f ("scx_cake: fix lib paths") + 11cb5f2 ("scx_cake:
bump version") landed the symlink-based path fix for scx_cake — the
same pattern as scx_cosmos commit 605c7d2. That fixed the original
`clang: error: no such file or directory: '../../../lib/arena.bpf.c'`
that blocked installing scx_cake 1.1.1 from crates.io.

However scx_cake 1.1.2 still cannot install from crates.io. Unlike
scx_cosmos (which only bundles pmu.bpf.c), scx_cake bundles
sdt_alloc.bpf.c and sdt_task.bpf.c, both of which now use the
scx_err_loc/scx_err/scx_out_loc macros introduced in commit 73b4543
("lib: move allocators to BPF streams reporting", 2026-05-13).
Those macros live in scheds/include/lib/alloc/bpf_helpers_local.h, which
ships inside the scx_cargo crate's bpf_h tarball. But the scx_cargo
crate on crates.io is still 1.1.1 (published 2026-05-13, before the
streams refactor), so its bundled bpf_helpers_local.h lacks those
macros — making any cake 1.1.2 install from crates.io fail with:

  src/bpf/lib/sdt_alloc.bpf.c:45:2: error: call to undeclared
    function 'scx_err_loc'

Fix this by re-publishing scx_cargo with the current (post-streams)
bpf_h, and bumping cake to consume it:

  * rust/scx_cargo: 1.1.1 -> 1.1.2  (no code change, picks up the new
    bpf_helpers_local.h via the bpf_h -> ../../scheds/include symlink
    that gets resolved at `cargo package` time)
  * scheds/rust/scx_cake: 1.1.2 -> 1.1.3, build-dep scx_cargo "1.1.1"
    -> "1.1.2"

Validation
----------
Local validation simulates the post-publish state without actually
publishing:

  1. cargo package -p scx_cargo -p scx_cake --no-verify   # both build
  2. extract both tarballs side by side under /tmp/cake-install-sim/
  3. in extracted scx_cake-1.1.3/, inject
       [patch.crates-io]
       scx_cargo = { path = "../scx_cargo-1.1.2" }
  4. cargo build  # succeeds: scx_err_loc resolves via the new bpf_h
                  # tar that scx_cargo 1.1.2 ships

(Step 3 is the post-extract simulation of how cargo install will
resolve scx_cargo 1.1.2 from crates.io once published — the contents
inside the extracted tarballs are exactly what the registry would
serve.)

Release ordering: scx_cargo 1.1.2 must be published before scx_cake
1.1.3 so cargo can resolve the new build-dep version.

Signed-off-by: Ryan Newton <rrnewton@gmail.com>
rrnewton added a commit to rrnewton/dev-sched-test that referenced this pull request May 27, 2026
tg fix-scx-cake-crate-packaging closed. Branch renamed to
fix/scx-cake-cargo-bump-1-1-3, pushed to rrnewton/scx, PR opened
sched-ext/scx#3604 against sched-ext/scx:main.
Worktree retained pending review/merge.

@sirlucjan sirlucjan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks Ryan

@rrnewton rrnewton added this pull request to the merge queue May 27, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 27, 2026
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