diff --git a/.github/workflows/upstreaming-investigator.lock.yml b/.github/workflows/upstreaming-investigator.lock.yml index abc4dddcd5a4..df63bf43cd0b 100644 --- a/.github/workflows/upstreaming-investigator.lock.yml +++ b/.github/workflows/upstreaming-investigator.lock.yml @@ -1,4 +1,4 @@ -# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"221d65bee18fc708430267f76f7674cd1ee3eac1223ed5597b42958f6b36f98a","body_hash":"7c1737a5a28360a69072cb16e8d8159ae11f6edd17bb9f537b4031713c8f25ed","compiler_version":"v1.2.2","agent_id":"pi","agent_model":"anthropic/claude-sonnet-5-5","engine_versions":{"pi":"1.5.0"}} +# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"221d65bee18fc708430267f76f7674cd1ee3eac1223ed5597b42958f6b36f98a","body_hash":"b0ac10c526dd1b59b15203320f96209f37c55f2d0ea29be9eac44253e6837ef6","compiler_version":"v1.2.2","agent_id":"pi","agent_model":"anthropic/claude-sonnet-5-5","engine_versions":{"pi":"1.5.0"}} # gh-aw-manifest: {"version":1,"secrets":["ANTHROPIC_API_KEY","COPILOT_GITHUB_TOKEN","GH_AW_DEFAULT_OTLP_ENDPOINT","GH_AW_DEFAULT_OTLP_HEADERS","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN","RISEPROJECT_APP_PRIVATE_KEY"],"actions":[{"repo":"actions/checkout","sha":"3d3c42e5aac5ba805825da76410c181273ba90b1","version":"v7.0.1"},{"repo":"actions/create-github-app-token","sha":"64ab729a6294000f5aa4a4bc0b73d1f32bc45510","version":"v3.3.0"},{"repo":"actions/download-artifact","sha":"9000827ccba6bdab643e8b6fd33ac0654aef8333","version":"v8.0.2"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"949feb2413d6458794dcd2491c4babbbce0c15c1","version":"v7.1.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"actions/upload-artifact","sha":"cf430e030ddbb5b0abf93d22962f4752f3646cd9","version":"v7.0.2"},{"repo":"astral-sh/setup-uv","sha":"20cfd1bf945f4377ade1205e4dbc17946fc9a30d","version":"v10.0.1"},{"repo":"github/gh-aw-actions/setup","sha":"53d0749e19424a918acd82b4d140264ce48f2f14","version":"v1.2.2"}],"containers":[{"image":"ghcr.io/github/gh-aw-node","digest":"sha256:8735428c2d4e602f90781ba0c571c400e8ff93c7ee1508a75d71f87e34e415cc","pinned_image":"ghcr.io/github/gh-aw-node@sha256:8735428c2d4e602f90781ba0c571c400e8ff93c7ee1508a75d71f87e34e415cc"},{"image":"ghcr.io/github/github-mcp-server:v2.1.0","digest":"sha256:f6056fc10bfffcc8c81a6417a2e9ca12808647e8dd6049642a4feaadee0e0f8a","pinned_image":"ghcr.io/github/github-mcp-server:v2.1.0@sha256:f6056fc10bfffcc8c81a6417a2e9ca12808647e8dd6049642a4feaadee0e0f8a"},{"image":"ghcr.io/riseproject-dev/sw-ecosystem/project-graph-mcp:latest"}],"mcp_servers":[{"name":"github","tools":["get_commit","get_file_contents","get_latest_release","get_me","get_pull_request","get_pull_request_comments","get_pull_request_diff","get_pull_request_files","get_pull_request_review_comments","get_pull_request_reviews","get_pull_request_status","get_release_by_tag","get_tag","issue_read","list_branches","list_commits","list_issue_types","list_issues","list_pull_requests","list_releases","list_starred_repositories","list_tags","pull_request_read","search_code","search_issues","search_pull_requests","search_repositories"]},{"name":"github-authenticated","tools":["actions_list","get_commit","get_file_contents","get_latest_release","get_me","get_pull_request","get_pull_request_comments","get_pull_request_diff","get_pull_request_files","get_pull_request_review_comments","get_pull_request_reviews","get_pull_request_status","get_release_by_tag","get_tag","issue_read","list_branches","list_commits","list_issue_types","list_issues","list_pull_requests","list_releases","list_starred_repositories","list_tags","pull_request_read","search_code","search_issues","search_pull_requests","search_repositories"]},{"name":"project-graph","tools":["project_graph_query"]},{"name":"safeoutputs","tools":["noop","report_incomplete","report_missing_data","report_missing_tool","upload_artifact"]},{"name":"work-queue","tools":["work_queue_claim_finish","work_queue_dispatch_next","work_queue_explain","work_queue_read","work_queue_submit"]}],"threat_detection":{"mode":"disabled"},"admission":false,"work_queue":{"worker":true,"logical_contract":"326b3240d146cc134cfc7c2345af10f216fffde999dc581fc45af17237e649a8"},"agent_metadata":{}} # This file was automatically generated by gh-aw (v1.2.2). DO NOT EDIT. To debug this workflow, load the skill at https://github.com/github/gh-aw/blob/main/debug.md # diff --git a/.github/workflows/upstreaming-investigator.md b/.github/workflows/upstreaming-investigator.md index 99274202fee5..2f96d892ce2b 100644 --- a/.github/workflows/upstreaming-investigator.md +++ b/.github/workflows/upstreaming-investigator.md @@ -403,6 +403,17 @@ You MUST investigate the project's upstream history, not just its checkout: distinguish build/runtime/optional dependencies where the data supports it, report omissions/conflicts explicitly, and never invent edges. A missing project or tool failure is not an empty or complete dependency graph. +7. Audit every direct and transitive build and test dependency against both + public PyPI and `https://pypi.riseproject.dev/simple` for the proposed + riscv64 interpreter and libc matrix. Inspect actual filenames and wheel tags, + not only package-page existence. Read relevant CI logs for unexpected sdist + downloads. When public PyPI lacks a compatible wheel but the RISE index has + one, record the exact package/version/interpreter evidence and identify the + workflow environment that must receive both + `PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple` and + `PIP_PREFER_BINARY=true`. The latter prefers an available wheel but preserves + a source fallback. Distinguish pip/cibuildwheel resolution from uv, which + requires its corresponding `UV_*` index settings as well. For every research category, record the exact queries, source URLs, findings, search scope and whether pagination/discussion review is complete. Link concrete @@ -463,7 +474,11 @@ call: `{"path": "upstreaming-out"}` (the native handler names the artifact approve scope, with evidence: - release coverage: which platforms and architectures the latest release ships wheels for on PyPI, and whether riscv64 is already there; - - build backend and native dependencies; + - build backend and native dependencies, plus build/test dependency wheel + availability across the target matrix. For any dependency without a + compatible public-PyPI wheel, state whether the RISE index has a compatible + wheel and where the paired `PIP_EXTRA_INDEX_URL` and `PIP_PREFER_BINARY` + settings must propagate; - release graph: the workflows and jobs that build, test and publish wheels, and how they are triggered; - existing architecture precedent: the nearest aarch64/s390x/ppc64le diff --git a/.github/workflows/upstreaming-worker.lock.yml b/.github/workflows/upstreaming-worker.lock.yml index a52acb8f9939..5ed8fee29f8a 100644 --- a/.github/workflows/upstreaming-worker.lock.yml +++ b/.github/workflows/upstreaming-worker.lock.yml @@ -1,4 +1,4 @@ -# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"f679f53df8bef4798d2652565464f0a94991cccf0fc695772d9dec94dc6c615d","body_hash":"c2baea3582364d048cf2d83f3eaae073738dda88c35c483d78b99c7d2d6689b9","compiler_version":"v1.2.2","strict":true,"agent_id":"pi","agent_model":"anthropic/claude-opus-5-5","engine_versions":{"pi":"1.5.0"}} +# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"f679f53df8bef4798d2652565464f0a94991cccf0fc695772d9dec94dc6c615d","body_hash":"74be6e59b87e8a8c5d747d3ff8f5d51b486aa885ad6de1de083ee0cfbe583a35","compiler_version":"v1.2.2","strict":true,"agent_id":"pi","agent_model":"anthropic/claude-opus-5-5","engine_versions":{"pi":"1.5.0"}} # gh-aw-manifest: {"version":1,"secrets":["ANTHROPIC_API_KEY","COPILOT_GITHUB_TOKEN","GH_AW_DEFAULT_OTLP_ENDPOINT","GH_AW_DEFAULT_OTLP_HEADERS","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN","RISEPROJECT_APP_PRIVATE_KEY","RISEPROJECT_UPSTREAMING_APP_PRIVATE_KEY"],"actions":[{"repo":"actions/checkout","sha":"3d3c42e5aac5ba805825da76410c181273ba90b1","version":"v7.0.1"},{"repo":"actions/create-github-app-token","sha":"64ab729a6294000f5aa4a4bc0b73d1f32bc45510","version":"v3.3.0"},{"repo":"actions/download-artifact","sha":"9000827ccba6bdab643e8b6fd33ac0654aef8333","version":"v8.0.2"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"949feb2413d6458794dcd2491c4babbbce0c15c1","version":"v7.1.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"actions/upload-artifact","sha":"cf430e030ddbb5b0abf93d22962f4752f3646cd9","version":"v7.0.2"},{"repo":"astral-sh/setup-uv","sha":"20cfd1bf945f4377ade1205e4dbc17946fc9a30d","version":"v10.0.1"},{"repo":"github/gh-aw-actions/setup","sha":"53d0749e19424a918acd82b4d140264ce48f2f14","version":"v1.2.2"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.29.11","digest":"sha256:8774a73c351395b41d2ad0af4ddb4689007c67de3cd08bd9f43bb8a0e300690e","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.29.11@sha256:8774a73c351395b41d2ad0af4ddb4689007c67de3cd08bd9f43bb8a0e300690e"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.29.11","digest":"sha256:88d2d0e315a504d93fd4fb8847fd0f6b7f4469f41a6fc6047b3dc9654c56ab2c","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.29.11@sha256:88d2d0e315a504d93fd4fb8847fd0f6b7f4469f41a6fc6047b3dc9654c56ab2c"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.29.11","digest":"sha256:861739ecf924dd2db5e5fb652db2ad82aaafd1615623297ddabc8f41a36b2847","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.29.11@sha256:861739ecf924dd2db5e5fb652db2ad82aaafd1615623297ddabc8f41a36b2847"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.5.6","digest":"sha256:342cd624e1f179d91be2de7a146fc4f387092e62e6c8a47506d7932e113d2311","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.5.6@sha256:342cd624e1f179d91be2de7a146fc4f387092e62e6c8a47506d7932e113d2311"},{"image":"ghcr.io/github/gh-aw-node","digest":"sha256:8735428c2d4e602f90781ba0c571c400e8ff93c7ee1508a75d71f87e34e415cc","pinned_image":"ghcr.io/github/gh-aw-node@sha256:8735428c2d4e602f90781ba0c571c400e8ff93c7ee1508a75d71f87e34e415cc"},{"image":"ghcr.io/github/github-mcp-server:v2.1.0","digest":"sha256:f6056fc10bfffcc8c81a6417a2e9ca12808647e8dd6049642a4feaadee0e0f8a","pinned_image":"ghcr.io/github/github-mcp-server:v2.1.0@sha256:f6056fc10bfffcc8c81a6417a2e9ca12808647e8dd6049642a4feaadee0e0f8a"}],"mcp_servers":[{"name":"github","tools":["get_commit","get_file_contents","get_latest_release","get_me","get_pull_request","get_pull_request_comments","get_pull_request_diff","get_pull_request_files","get_pull_request_review_comments","get_pull_request_reviews","get_pull_request_status","get_release_by_tag","get_tag","issue_read","list_branches","list_commits","list_issue_types","list_issues","list_pull_requests","list_releases","list_starred_repositories","list_tags","pull_request_read","search_code","search_issues","search_pull_requests","search_repositories"]},{"name":"github-authenticated","tools":["actions_list","get_commit","get_file_contents","get_pull_request","get_pull_request_comments","get_pull_request_diff","get_pull_request_files","get_pull_request_review_comments","get_pull_request_reviews","get_pull_request_status","issue_read","list_commits","list_issues","list_pull_requests","pull_request_read","search_code","search_issues","search_pull_requests"]},{"name":"safeoutputs","tools":["noop","report_incomplete","report_missing_data","report_missing_tool","upload_artifact"]},{"name":"work-queue","tools":["work_queue_claim_finish","work_queue_dispatch_next","work_queue_explain","work_queue_read","work_queue_submit"]}],"threat_detection":{"mode":"enabled"},"admission":false,"work_queue":{"worker":true,"logical_contract":"056b332b022951fc3d1ae91c58cb202ea509dcef2a5d2c296a6cc0a9f8abc00a"},"agent_metadata":{}} # This file was automatically generated by gh-aw (v1.2.2). DO NOT EDIT. To debug this workflow, load the skill at https://github.com/github/gh-aw/blob/main/debug.md # diff --git a/.github/workflows/upstreaming-worker.md b/.github/workflows/upstreaming-worker.md index 0ac7699a49c4..242ed6116415 100644 --- a/.github/workflows/upstreaming-worker.md +++ b/.github/workflows/upstreaming-worker.md @@ -401,7 +401,24 @@ and analogous changes in the proposal diagnosis. emulation/cross-build path cannot support riscv64. Follow the nearest existing architecture precedent rather than preferring RISE runners. When required by the selected topology, use `manylinux_2_39_riscv64` and - `musllinux_1_2_riscv64` images. + `musllinux_1_2_riscv64` images. Before finalizing any build or test workflow, + inspect its dependency declarations and CI logs for packages downloaded as + sdists on riscv64. Check public PyPI and the RISE simple index for compatible + wheels across every affected interpreter and libc. When public PyPI lacks a + compatible build or test dependency wheel but + `https://pypi.riseproject.dev/simple` has one, add both + `PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple` and + `PIP_PREFER_BINARY=true` to the narrowest environment that reaches that pip + resolver. Use the ordinary job or step `env` for native pip, `CIBW_ENVIRONMENT` + for build resolution inside cibuildwheel, and `CIBW_TEST_ENVIRONMENT` for test + dependency resolution; set both scopes when both phases need the registry. + Do not use `PIP_ONLY_BINARY`: source fallback must remain available where the + RISE index has no matching wheel. If the project invokes uv, retain the two + requested `PIP_*` settings and also configure uv's corresponding extra-index + and index-strategy settings because uv does not read pip's index variables. + Record package names, versions, tags, index evidence and propagation scope in + `diagnosis` and verify from CI that the dependency resolves as a wheel rather + than an sdist. 3. Temporary fork-only changes that let CI run on the fork (for example removing `if: github.repository == 'owner/repo'`) go in a separate commit whose subject starts with `{debug}`. Never when `upstream_facing` is true. diff --git a/SESSIONLOG.md b/SESSIONLOG.md index 9e9b749b7b89..bd668996340a 100644 --- a/SESSIONLOG.md +++ b/SESSIONLOG.md @@ -30,3 +30,4 @@ - Aligned the controller's cheap comment filter with first-nonblank-line command parsing so blank-line-prefixed commands are both acknowledged and reconciled. - Added a hash-pinned gh-aw v1.2.2 console guard that preserves canonical agent evidence while preventing untrusted model or MCP text from being parsed as GitHub Actions workflow commands. - Replaced console-byte rewriting with GitHub's native stop-commands protocol: trusted pre/post agent steps bracket exact output with a random step-output token and always restore command processing. +- Required investigator and worker dependency audits to use the RISE simple index plus `PIP_PREFER_BINARY=true` when public PyPI lacks compatible riscv64 build/test wheels, and updated both mirrored porting-skill paths with resolver-scope guidance. diff --git a/skills/python-project-porting/SKILL.md b/skills/python-project-porting/SKILL.md index 225327b1be43..3dcd72bf3a9b 100644 --- a/skills/python-project-porting/SKILL.md +++ b/skills/python-project-porting/SKILL.md @@ -83,6 +83,13 @@ or a repeated ask. Follow them exactly; the reference files explain the why. - **Default to NO comments in workflows** — they are read as reference. One "why" line only for a genuine non-obvious deviation; never narrate standard steps. - **Never set `CIBW_BUILD_VERBOSITY`** — drop it if you inherit it from a template. +- **Do not source-build a dependency when a compatible RISE wheel exists.** Audit actual + build and test resolver logs plus both simple indexes for the complete target matrix. When + public PyPI lacks a compatible wheel but `https://pypi.riseproject.dev/simple` has one, + pass both `PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple` and + `PIP_PREFER_BINARY=true` to the exact build/test resolver environment. Prefer-binary keeps + source fallback for matrix rows the registry does not cover; never replace it with a broad + `PIP_ONLY_BINARY`. For uv commands, also set the equivalent `UV_*` index configuration. - **Start from upstream's own build/test workflow, then delete** everything that isn't Linux glibc/musl, and only then apply the riscv64 changes. Jobs consuming the setup matrix must use `${{ matrix.platform }}` in build selectors, names, and artifact names instead of @@ -151,13 +158,19 @@ name, repo, version, upstream build docs — come from the invoking prompt): 4. **Map the git tag to the Python version** (see gotcha 3). Take the tag as the workflow input; derive `package_version` from the built sdist filename. -5. **Identify native deps** the bdist needs at build time. Three cases: (a) none - bundled → add `CIBW_BEFORE_BUILD` to build them in-container (cffi builds libffi +5. **Identify native and Python deps** the bdist needs at build time. Three native cases: + (a) none bundled → add `CIBW_BEFORE_BUILD` to build them in-container (cffi builds libffi that way); (b) the sdist bundles its C sources (protobuf bundles upb/utf8_range) → no before-build needed; (c) the dep is another Python wheel we already ship → - `pip install` it from our registry in `CIBW_BEFORE_BUILD` (see gotcha 17). - -6. **Wire up real testing** — mirror how upstream tests its wheels (gotcha 6). + `pip install` it from our registry in `CIBW_BEFORE_BUILD` (see gotcha 17). For Python + build dependencies, inspect resolver logs and wheel tags on both indexes. If public PyPI + has no compatible wheel but RISE does, propagate the paired `PIP_EXTRA_INDEX_URL` and + `PIP_PREFER_BINARY=true` settings into the build environment. + +6. **Wire up real testing**: mirror how upstream tests its wheels (gotcha 6). Audit every + direct and transitive test dependency the same way. Put the paired pip settings in the + test environment when they avoid an unnecessary riscv64 sdist build, and confirm in CI + that the resolver selected a wheel. 7. **Validate locally, then push** (gotcha 9). Open a PR; the `pull_request` path trigger runs CI for every pending version. Watch, triage, iterate. diff --git a/skills/python-project-porting/references/gotchas-index.md b/skills/python-project-porting/references/gotchas-index.md index 98b70399e230..dff0f59ba807 100644 --- a/skills/python-project-porting/references/gotchas-index.md +++ b/skills/python-project-porting/references/gotchas-index.md @@ -1383,9 +1383,9 @@ The porting gotchas (566 of them) live in [`references/gotchas/`](gotchas/), spl - **353** — Gotcha 30's registry check has moved off redirects: unhosted packages now answer plain `404`, not `302` — the check logic is unaffected, but scripts written against the old behavior may misread it. -- **354** — `PIP_PREFER_BINARY` (not `PIP_ONLY_BINARY`) is the fix when our registry - hosts a wheel for only *some* matrix interpreters and an unpinned test dependency - keeps resolving to a newer, wheel-less release. +- **354**: Pair the RISE `PIP_EXTRA_INDEX_URL` with `PIP_PREFER_BINARY=true` (not + `PIP_ONLY_BINARY`) when public PyPI lacks a compatible build/test dependency wheel or an + unpinned dependency otherwise resolves to a newer, wheel-less release. - **375** — `uv` can reject a real `abi3` wheel resolved by name from an index as "has no usable wheels" even though the identical wheel installs fine as a local file. - **399** — A dependency we already publish can satisfy a dependent's *runtime* link and still diff --git a/skills/python-project-porting/references/gotchas/dependencies-and-registry.md b/skills/python-project-porting/references/gotchas/dependencies-and-registry.md index 0cc7796469fd..54af81c265cb 100644 --- a/skills/python-project-porting/references/gotchas/dependencies-and-registry.md +++ b/skills/python-project-porting/references/gotchas/dependencies-and-registry.md @@ -691,12 +691,18 @@ To pull up one entry: `grep -n '^N\. ' references/gotchas/dependencies-and-regis version has to line up" bit for it exactly: PyPI's latest was newer than what we host, so pip took that and built it from source, costing ~45 minutes per job (and cp314t has no registry wheel at any pandas version, so it always builds from source regardless). - `CIBW_TEST_ENVIRONMENT: PIP_PREFER_BINARY=1` (test-phase only, per gotcha 12) tells pip - to prefer an *older* wheel-backed version over a newer sdist-only one — it dropped - cp312/cp313/cp314 to a few seconds (the registry wheel resolves) while leaving cp314t's - from-source fallback intact, which had already been confirmed to build cleanly, just - slowly. `PIP_ONLY_BINARY` would have been wrong here — it hard-fails cp314t instead of - letting it fall back to source. + The reusable setting is the pair + `PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple` and + `PIP_PREFER_BINARY=true`: the first makes the RISE wheel a candidate, while the second + lets an older compatible wheel beat a newer sdist-only release. Put both in + `CIBW_TEST_ENVIRONMENT` for cibuildwheel test dependency resolution, in + `CIBW_ENVIRONMENT` for build dependency resolution, or in the job/step `env` for a + native pip invocation. Set both scopes when both phases resolve affected dependencies. + In the clevercsv case, the test-phase setting dropped cp312/cp313/cp314 to a few seconds + while leaving cp314t's from-source fallback intact, which had already been confirmed to + build cleanly, just slowly. `PIP_ONLY_BINARY` would have been wrong here because it + hard-fails cp314t instead of letting it fall back to source. Always confirm wheel filenames/tags on + both indexes before the change and confirm the resolver selects a wheel in CI afterward. 375. **`uv` (0.12.13, riscv64) can reject a real, `--only-binary`-eligible `abi3` wheel as "has no usable wheels" when it is resolved *by name from an index*, even though the diff --git a/skills/python-project-porting/references/workflow-anatomy.md b/skills/python-project-porting/references/workflow-anatomy.md index a9c7f087f41d..da9013bc40cc 100644 --- a/skills/python-project-porting/references/workflow-anatomy.md +++ b/skills/python-project-porting/references/workflow-anatomy.md @@ -99,8 +99,14 @@ through `outputs:`; name the artifact `-${{ env.X_VERSION }}-sdist`, upload UV env vars (`UV_EXTRA_INDEX_URL`, `UV_INDEX_STRATEGY`, `UV_ONLY_BINARY`) are **only** needed if the workflow has steps that actually invoke `uv` (e.g. an sdist-build job on `ubuntu-latest` that uses `setup-uv`). For pure cibuildwheel build-from-checkout workflows with no `uv` steps, -skip them entirely — pass the registry to the container via -`CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/` instead. +skip them entirely. When a build or test dependency has no compatible wheel on public PyPI +but does have one on the RISE index, pass both +`PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple` and `PIP_PREFER_BINARY=true` to +the resolver. Use `CIBW_ENVIRONMENT` for build resolution and `CIBW_TEST_ENVIRONMENT` for +test dependency resolution, setting both when both phases need the registry. Prefer-binary +allows source fallback on uncovered matrix rows; do not replace it with a broad +`PIP_ONLY_BINARY`. Confirm actual filenames and tags on both indexes before adding the env, +and confirm the CI resolver log selects a wheel afterward. Newer workflows start with an SPDX header: ``` diff --git a/upstreaming/INTEGRATION.md b/upstreaming/INTEGRATION.md index 38ee83b4f402..bec56296d551 100644 --- a/upstreaming/INTEGRATION.md +++ b/upstreaming/INTEGRATION.md @@ -160,8 +160,14 @@ and broadening `inputs.upload` with `github.event_name == 'push'`. The worker contract now explicitly forbids both patterns and any unrelated event, upload, retention or release behavior change. It also requires per-file commit history, issue/PR/review research and policy evidence before editing changelogs or other -policy-sensitive files. Existing PR CI that builds but intentionally does not -upload artifacts is left unchanged; any extra acceptance evidence belongs in a +policy-sensitive files. Investigation and development also audit direct and +transitive build/test dependency resolution across public PyPI and the RISE +index. When public PyPI has no compatible wheel but RISE does, the proposed +workflow passes both +`PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple` and +`PIP_PREFER_BINARY=true` to the narrowest applicable build/test resolver scope, +retaining source fallback for uncovered rows and recording wheel-tag evidence. +Existing PR CI that builds but intentionally does not upload artifacts is left unchanged; any extra acceptance evidence belongs in a separate trusted probe. The first repair performed the required history analysis and produced the correct rewrite, but built-in GitHub research labels reproduced the pinned gateway's queue-finish DIFC incompatibility. Current local workflow diff --git a/upstreaming/tests/test_workflow_contracts.py b/upstreaming/tests/test_workflow_contracts.py index 328a6635bf57..fc27bc6ded15 100644 --- a/upstreaming/tests/test_workflow_contracts.py +++ b/upstreaming/tests/test_workflow_contracts.py @@ -209,6 +209,21 @@ def test_worker_brackets_untrusted_output_with_stop_commands(self): self.assertIn("printf '::%s::", after["run"]) self.assertNotIn("gh_aw_log_guard", (WF / "upstreaming-worker.md").read_text()) + def test_prompts_require_rise_wheels_for_missing_build_and_test_dependencies(self): + investigator = (WF / "upstreaming-investigator.md").read_text() + worker = (WF / "upstreaming-worker.md").read_text() + for text in (investigator, worker): + self.assertIn("PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple", text) + self.assertIn("PIP_PREFER_BINARY=true", text) + self.assertIn("public PyPI", text) + self.assertIn("CIBW_ENVIRONMENT", worker) + self.assertIn("CIBW_TEST_ENVIRONMENT", worker) + skill = (ROOT / "skills/python-project-porting/SKILL.md").read_text() + self.assertIn("Do not source-build a dependency when a compatible RISE wheel exists", skill) + self.assertIn("PIP_PREFER_BINARY=true", skill) + gotchas = (ROOT / "skills/python-project-porting/references/gotchas/dependencies-and-registry.md").read_text() + self.assertIn("The reusable setting is the pair", gotchas) + def test_worker_forbids_unrelated_fork_ci_debug_changes(self): worker = source("upstreaming-worker") self.assertNotIn("github", worker["tools"])