pre-commit-ci / issues

public issues for https://pre-commit.ci
16 stars 3 forks source link

Rust based hooks with foreign repos fail. #173

Closed Swiftb0y closed 1 year ago

Swiftb0y commented 1 year ago

While trying to evaluate pre-commit CI, I encountered an issue with Rust and hooks that don't use repo: local.

The error is basically the same as in #121 but in this case it wouldn't really make sense to use repo: local as a workaround.

This PR demos the problem: https://github.com/Swiftb0y/pre-commit.ci-evaluation/pull/2 This is the corresponding pre-commit.ci run: https://results.pre-commit.ci/run/github/607242900/1677514766.DnAk-Np0RdaiZRFwB1axrg

asottile commented 1 year ago

iirc if you need a specific rustc you need to also specify language_version

Swiftb0y commented 1 year ago

Removing all version specifications works, but specifying language_version explicitly doesn't work unfortunately.

asottile commented 1 year ago

hmmm that probably points at a pre-commit issue itself -- when it sets up a custom rustup toolchain it should override RUSTUP_HOME while installing: https://github.com/pre-commit/pre-commit/blob/294590fd124484a786ba90423fa5d89536a6de98/pre_commit/languages/rust.py#L153-L156

Swiftb0y commented 1 year ago

Makes sense. What are the next steps now? Fixing the problem in pre-commit? I'm afraid I'm personally not comfortable enough with python to fix this myself.

asottile commented 1 year ago

yeah there'll need to be some fix in pre-commit

asottile commented 1 year ago

should be fixed now

Swiftb0y commented 1 year ago

Thank you for the quick fix. Do you know when pre-commit.ci will get updated to the new pre-commit version?

asottile commented 1 year ago

it already has

Swiftb0y commented 1 year ago

Ah yes thank you very much. I figured something was wrong because my test run was queued for 35 minutes but it passed now.

asottile commented 1 year ago

yeah github packages is/was down -- #174