Skip to content

Commit 84fdffd

Browse files
luhenryclaude
andcommitted
docs: reinforce cibuildwheel {package} vs {project} gotcha
Expand gotcha 5 with the case that just cost a second CI cycle: when you extract an sdist into a subdir and run `cibuildwheel ./<subdir>`, the sdist's own bundled tests/ are under {package}, not {project}. Document the exit-code-4 "no tests ran" symptom and the local-repro trap (running `cibuildwheel .` from inside the extracted dir masks the mismatch; reproduce from the parent dir). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 9dcfc52 commit 84fdffd

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

CLAUDE.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,21 @@ workflow. Don't hand-write the docs YAML unless you need a `comment`/`warning`.
146146
once on x86. Only the actual bdist needs `ubuntu-24.04-riscv`. Building a codegen
147147
toolchain (e.g. protoc via Bazel) on riscv is a dead-end; don't attempt it.
148148

149-
5. **cibuildwheel `{project}` vs `{package}` (this cost a full CI cycle).**
149+
5. **cibuildwheel `{project}` vs `{package}` (this cost a full CI cycle — twice).**
150150
`{project}` = the dir where cibuildwheel was invoked (copied to `/project` in the
151151
container). `{package}` = the package path you passed on the CLI (e.g.
152-
`cibuildwheel ./protobuf` → `/project/protobuf`). If you stage extra files (a test
153-
wheel, a runner script) *inside the package dir you pass*, reference them via
154-
**`{package}`**. Symptom of getting it wrong: test step fails with code **127**,
155-
`bash: /project/.../run.sh: No such file or directory`.
152+
`cibuildwheel ./protobuf` → `/project/protobuf`). When you extract an sdist into a
153+
subdir and run `cibuildwheel ./<subdir>`, **everything inside that subdir —
154+
including the sdist's own bundled `tests/` — is under `{package}`, not
155+
`{project}`**. Reference staged helper files (a test wheel, a runner script) *and*
156+
the test suite via **`{package}`** (`pytest {package}/tests`). Symptoms of getting
157+
it wrong: test step fails with code **127** `bash: /project/.../run.sh: No such
158+
file or directory` (missing script), or code **4** `file or directory not found:
159+
/project/tests` + `no tests ran` (pytest pointed at the wrong dir → collects
160+
nothing). **Local-repro trap:** if you validate by `cd`-ing into the extracted dir
161+
and running `cibuildwheel .`, then `{project}` == the sdist root and
162+
`{project}/tests` works — masking the bug. Reproduce the CI shape exactly: invoke
163+
`cibuildwheel ./<subdir>` **from the parent dir**, so `{project}` ≠ `{package}`.
156164

157165
6. **Running a real test suite through cibuildwheel:**
158166
- Stage helper files inside the package dir (cibuildwheel copies that tree into

0 commit comments

Comments
 (0)