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

Should check if nix-prefetch-git is at least the required version #10

Open
expipiplus1 opened this issue Aug 31, 2016 · 3 comments
Open

Comments

@expipiplus1
Copy link
Owner

No description provided.

@DavidEGrayson
Copy link
Contributor

DavidEGrayson commented Aug 31, 2016

Nix is good at doing that! I was thinking we should aim to write a Nix expression that builds the code (or somehow uses a Hackage package for it), bundles our program with the latest version of nix-prefetch-git, and runs the tests. Perhaps we need to make a wrapper script that has the full path of nix-prefetch-git and prepends it to the PATH: this way Nix itself knows that our program depends on nix-prefetch-git and would be guaranteed to install it, and also there is no way our program would use some bad version at runtime. I think wrapper scripts like that are used for other projects too.

@expipiplus1
Copy link
Owner Author

Just putting the full path to nix-prefetch-git in the source will do this. Although this would obviously have to be done at build time as the store path isn't distributable.

The wrapper script is probably neatest though seeing as this is an executable.

@DavidEGrayson
Copy link
Contributor

Yeah, either way would work. I don't know much about Cabal/GHC but maybe we could pass a configuration option to it that says what the path of nix-prefetch-git is, and that could get baked into the executable. In C/C++ we would just use the preprocessor to do this.

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

No branches or pull requests

2 participants