-
Notifications
You must be signed in to change notification settings - Fork 701
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
Need a way to embed git revision into executable when running cabal install #7355
Comments
The problem occurs here: IntersectMBO/cardano-node#1127 |
This shouldn't work! As it stands, you have an undeclared data dependency on the This is made somewhat inconvenient because Cabal fails to support globbing files without extensions or otherwise including the full contents of a directory in extra-source-files: ../.git/HEAD
, ../.git/refs/heads/master to your cabal file. |
Does the above comment suffice to close this? |
The solution proposed by @typedrat is unfortunately not working for me, although I think it makes sense that it should. I'll try to troubleshoot what could be happening under the hood but not sure if I'll reach something. |
Describe the bug
When
cabal install
is run, instead of building in place, it copies to source to some other location and builds from that location. For example on my Mac it builds from somewhere like this:/private/var/folders/zh/ln41q4zs52x2fd61rxccmq640000gn/T/cabal-install.-79645/dist-newstyle/tmp/src-79645/cardano-config-0.1.0.0
As a result, whilst libraries like
gitrev
allow you to embed the git revision when you runcabal build
, this does not work withcabal install
.There needs to be some mechanism to allow the build to capture the git revision when
cabal install
is used.To Reproduce
On any project that uses
gitrev
or some similar git revision embedding library, runcabal v2-install
.Then observe that the the git revision is not embedded.
Expected behavior
The git revision should be embedded, or if not, some other mechanism needs to be provided to make this possible
System information
cabal-3.4
Additional context
N/A
The text was updated successfully, but these errors were encountered: