Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add context back to repo url strings #2261

Merged
merged 3 commits into from
Oct 16, 2024
Merged

Conversation

hamishmack
Copy link
Collaborator

This should fixes a source of errors that look like this:

curl: (37) Couldn't open file /nix/store/7g8b1vz8nlai5zkjzfps25jl7fvdjk3s-source/package/contra-tracer-0.1.0.2.tar.gz

Reproducing this issue turned out to be difficult because if the sha256 is in the nix cache there is no error. To reproduce the issue:

  • Remove the addContext call.
  • Build a project with repository in cabal.project with an inputMap.
  • Force the src derivation to rebuild.

We can force the src derivation to rebuild by giving it invalid sha256 (ignore the hash mismatch errors, if it has a hash then the download worked):

# sha256 = p.pkg-src-sha256;
sha256 = __substring 0 (__stringLength p.pkg-src-sha256 - 6) p.pkg-src-sha256 + "000000";

This should fixes a source of errors that look like this:

```
curl: (37) Couldn't open file /nix/store/7g8b1vz8nlai5zkjzfps25jl7fvdjk3s-source/package/contra-tracer-0.1.0.2.tar.gz
```

Reproducing this issue turned out to be difficult because if the `sha256` is in the nix cache there is no error.  To reproduce the issue:

* Remove the `addContext` call.
* Build a project with `repository` in `cabal.project` with an `inputMap`.
* Force the `src` derivation to rebuild.

We can force the src derivation to rebuild by giving it invalid `sha256` (ignore the hash mismatch errors, if it has a hash then the download worked):

```
# sha256 = p.pkg-src-sha256;
sha256 = __substring 0 (__stringLength p.pkg-src-sha256 - 6) p.pkg-src-sha256 + "000000";
```
Copy link
Collaborator

@angerman angerman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a comment.

lib/load-cabal-plan.nix Show resolved Hide resolved
hamishmack and others added 2 commits October 16, 2024 17:04
Co-authored-by: Moritz Angermann <moritz.angermann@gmail.com>
@hamishmack hamishmack merged commit 82d4d20 into master Oct 16, 2024
837 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants