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

Approach of copying subdirs for git extra-deps breaks in the presence of relative symlinks #45

Open
isomorpheme opened this issue Feb 15, 2024 · 2 comments · May be fixed by #46
Open

Comments

@isomorpheme
Copy link

isomorpheme commented Feb 15, 2024

In stack.yaml I have something like:

- git: https://github.com/tensorflow/haskell.git
  commit: 925c2e95151c0ea1592c26b51a5d98e4ca4a2fe7
  subdirs:
  - tensorflow
  - tensorflow-proto

I see that this leads to a different src derivation for each subdir here:

cp -r "${rawSrc}/${haskPkgLock.subdir}" "$out"

But for this repo, that leads to a failing build, because the tensorflow-proto subdir has a relative symlink third_party in it that points to ../third_party - this symlink becomes dangling when only the subdir is copied to the store. (third_party itself happens to have a submodule in it, but that's #44.)

@isomorpheme isomorpheme linked a pull request Feb 16, 2024 that will close this issue
@cdepillabout
Copy link
Owner

@isomorpheme Thanks for submitting this, and sorry for taking so long to get to this!

I'm not sure what to do here. This just seems like a tricky corner case. Do you have any suggestions on how to handle this?

It feels like to me that a "nice" solution here probably doesn't exist. The best we could do is add some sort of hook that allows the user to go in and manually fix up the repo definition. But at that point, the user could just add their own overlay on top of the overlay produced by stacklock2nix, so the additional hook seems somewhat pointless.

@cdepillabout
Copy link
Owner

Oh wait, I see that you already have a suggestion in #46! Let me take a look at that

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 a pull request may close this issue.

2 participants