cc_wrapper crashes with ValueError on Windows when a path is on another drive
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 79/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- build-system, tooling
Research direction
Start by reading shorten_path in haskell/private/cc_wrapper.py.tpl and check how it handles paths on different Windows drives. The issue identifies the failure and the expected behavior: when os.path.relpath raises ValueError, retain the original path. Done means the wrapper no longer aborts for cross-drive paths; run the relevant cc_wrapper tests or reproduce with paths on separate drives.
Written by the indexing model from the issue text.
Description
On Windows, os.path.relpath raises ValueError: path is on mount 'D:', start on mount 'C:' when the path and the current working directory are on different drives. shorten_path in haskell/private/cc_wrapper.py.tpl calls it without a guard, so the C compiler wrapper aborts instead of linking or compiling.
To reproduce: build a Haskell target on Windows where the execroot or an include or library directory is on a different drive than the action's working directory (for example the Bazel output base on D: and a toolchain or temp directory on C:). Any cc_wrapper call that passes such a path fails with the ValueError.
Fix: treat ValueError from os.path.relpath as 'cannot shorten' and keep the original path. A PR follows.
Assisted by Claude.
- Dominant language
- Starlark
- Stars
- 279
- Forks
- 94
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 10
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tweag/rules_haskell
-
Prepare release 1.1Open
Difficulty 5/5 Over a week Newbie friendliness 20/100
tweag/rules_haskell#2467 ·
Maintainers usually reply within 1 day
-
Track CI failuresOpen
Difficulty 5/5 Over a week Newbie friendliness 20/100
tweag/rules_haskell#2456 · 96 comments ·
Maintainers usually reply within 1 day
-
type: feature request
Difficulty 5/5 Over a week Newbie friendliness 25/100
tweag/rules_haskell#2451 ·
Maintainers usually reply within 1 day
-
os:windows type: bug
Difficulty 4/5 3-5 days Newbie friendliness 50/100
tweag/rules_haskell#2447 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
tweag/rules_haskell#2426 · 1 comment ·
Maintainers usually reply within 1 day
All issues in tweag/rules_haskell
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Netcracker/qubership-authz-agent#311 ·
Maintainers usually reply within 1 day
-
deploy-image adds Recorder to the wrong reconciler when another controller name ends with the kindOpenrelease-blocker
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
kubernetes-sigs/kubebuilder#6191 ·
Maintainers usually reply within 1 day
-
Pin Python to 3.14 in the era5grib-parallel environment specificationPossibly taken @atteggiani claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
ACCESS-NRI/containerised-environments-infra#129 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
briandconnelly/data-reasoning#106 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
microsoft/skill-recorder#113 · 1 reaction ·
Maintainers usually reply within 1 day