-
Notifications
You must be signed in to change notification settings - Fork 697
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
cabal --version
on a non-release build should include a Git commit
#10528
Comments
There's at least one package that provides this information automatically, but I'm not sure we want it as a dependency even if it's restricted to |
cabal --version
on a non-release build should include a Git commit.cabal --version
on a non-release build should include a Git commit
And I'm a daily user of cabal |
…the first two I found require TH, so no-go. I may have to cons up my own, although TH is by far the easiest way to do it. |
The other way to do it is custom Setup for |
There is also the option of reading the data at run-time from a data-file, although now we have to properly install cabal as a package and not just as a lone binary |
A flag could help to deal with it? I have been wanting to tackle this issue since day one of cabal-head because the current state is deeply unsatisfactory. We should implement a solution no matter what. And we can always improve the implementation down the road. |
Re data-files: they work great for |
@geekosaur TH being a no-go is a GHC-related limitation? We can control this behaviour with some good old CPP, and only enable this if we're building a |
It's about platforms that don't have the bytecode backend but do need cabal. (ARM used to fit here, I don't know what currently supported platforms do but there's something somewhere in the tree saying that TH is forbidden in the codebase for this reason.) |
I see, thank you. |
Template Haskell is a non-issue if this is hidden behind a flag |
I wonder if there's a good way to ask if TH is supported without using custom Setup (there's no |
I suppose there's also just requiring development to be on platforms with working TH, but I feel like that's poor devx. And requiring a |
Working on a first cut at this. For now I am requiring that developers either use a system with TH or use |
I have a different proposal. It's based on the assumption that we have a flag that controls whether we bake in the SHA and, hence, weather we depend on TH or not. The flag should be off by default because the common case is: you build Only in the CI we explicitly set the flag on. Now, how exactly we do it (project file or command-line; and weather to rebuild with the flag or build with it from the get-go), we can discuss further if you agree on the proposal above... |
But I (and I gather Hécate) both use |
You're not, but you're power users who can read the documentation and do the same as what CI does to get the SHA. |
Personnally I dogfood the installation of cabal-head from ghcup, so I don't really tweak the build process |
ghcup will take whatever you give it, so that's not relevant. If you need a sha, you can add a flag during build or download the artifact from GitHub. I assumed you did the latter? In that case you're covered because the GitHub artifacts will certainly have the SHA, that's the whole point. |
Yeah I'm getting it from GitHub. In any case I'm not too picky on how it's implemented, I just want to support the effort of making it available in our -head releases. :) |
I was attempting to follow a best practice outside the little Cabal ecosystem. That said, I am hard put to identify a time where I started to do something and then Artem immediately climbed my frame, and quite frankly I'm tired of it. I give up; it's his problem from now on. |
@geekosaur, I apologize for being overly eager to propose changes and share my view. I've been working on Cabal CI on and off for a couple of years, at least, and I certainly have opinions. It's okay to disagree, and I'm happy to approve alternative designs. Discussing alternatives is what makes the design better. |
(a) Maybe your first comment would have qualified as that, but your second was actively pushy. |
I'm somewhat confused. I think that unless you compile |
I believe that is currently true, but not so long ago there wasn't a bytecode linker for ARM so neither ghci nor TH worked. I don't know if the current situation will remain true for any new architectures that might show up in the future, though. (Has a BCO linker been written for RISC-V?) |
@supersven got any insight about the RISC-V situation? |
It's not really that important except as an example of the likely next platform we'll need to deal with. I would be surprised if it turns out to be the last. |
I imagine if you want to be fully future proof, you can write
|
This has been bugging me too, as a daily user of cabal-head, this would be greatly appreciated. (@Kleidukos)
(#10483 (comment) ff.)
The text was updated successfully, but these errors were encountered: