Repository navigation
minimal-crates: shorten the target dir path length to avoid os error 206 - #11
Merged
Merged
Conversation
Nightly cargo calls rustc w/ the -L flag, explicitly listing the target path of each dependency. With all of those directory paths listed, rustc's command line call can push the length of the command over Windows' 32,767 character limit. Building in the runner's temp dir keeps it shorter, and the runner cleans it up after each job.
Arqu
approved these changes
Nov 20, 2026
Collaborator
|
you're aware you need to update the tags for this to take effect:
|
Collaborator
|
? |
Arqu
added a commit
that referenced
this pull request
Nov 26, 2026
#13) ## Description A caller that patches in a private GitHub repository cannot run `minimal-crates.yaml`. The workflow takes no secrets, and the caller's `env` does not reach a called workflow, so cargo fetches the repository without credentials and fails: ``` fatal: could not read Username for 'https://github.com': No such file or directory error: failed to load source for dependency `noq` ``` This PR: - Adds an optional `GIT_TOKEN` secret to `minimal-crates.yaml`. - Sets the token in the workflow-level `env`, so every job uses it. With `GIT_TOKEN`, git rewrites `https://github.com/` to carry the token (`GIT_CONFIG_*` env vars). Cargo fetches with the git CLI so that the rewrite applies. - Resets `credential.helper` to empty. With credentials in the URL, git gives them to the credential helpers to store after each successful fetch. On macOS, Homebrew git's `osxkeychain` helper blocks during `actions/checkout`, which runs with a temporary `HOME`, and the job hangs. - Without `GIT_TOKEN`, `GIT_CONFIG_COUNT` is `0` and no URL changes. The only change for current callers is that cargo fetches git dependencies with the git CLI. - Documents in the README that every shared workflow takes `GIT_TOKEN`. A new shared workflow, such as `cargo-deny.yaml` in #12, must take it too. Usage: ```yaml min-crates: uses: "n0-computer/workflows/.github/workflows/minimal-crates.yaml@v2" secrets: GIT_TOKEN: ${{ secrets.MY_PRIVATE_REPO_TOKEN }} ``` ## Testing - With git and the same `GIT_CONFIG_*` values, with global config off and a system config whose `credential.helper` blocks (like Homebrew's `osxkeychain`): - A private repository, a public repository and the `actions/checkout` case (its `extraheader` plus the token in the URL) each fetch in about 1 s. Git does not call the helper. - Without the `credential.helper` reset, git calls the helper's `store` after each fetch and hangs. This matches the macOS hang in CI. - `zizmor --offline .`: no findings. - `actionlint`: same findings as on `main` (runner labels, `$/` action refs, the Windows `cargo check` step). None comes from this change. - A private caller with a private git dependency ran this workflow in CI. Before the `credential.helper` reset, Ubuntu and Windows passed and macOS hung in `actions/checkout`. At 507db95, Ubuntu, macOS and Windows pass. ## Release After merge: tag `v2.0.1` and move `v2`. `v2` does not have #11 yet, so this release also ships the Windows target dir fix.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Nightly cargo calls rustc w/ the -L flag, explicitly listing the target path of each dependency. With all of those directory paths listed, rustc's command line call can drive the length of the command over Windows' 32,767 character limit.
Building in the runner's temp dir keeps it shorter, and the runner cleans it up after each job.