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

cabal --version on a non-release build should include a Git commit #10528

Open
geekosaur opened this issue Nov 5, 2024 · 14 comments
Open

cabal --version on a non-release build should include a Git commit #10528

geekosaur opened this issue Nov 5, 2024 · 14 comments

Comments

@geekosaur
Copy link
Collaborator

geekosaur commented Nov 5, 2024

I wonder if cabal --version on a non-release build should include a Git commit. (@geekosaur)

This has been bugging me too, as a daily user of cabal-head, this would be greatly appreciated. (@Kleidukos)

(#10483 (comment) ff.)

@geekosaur
Copy link
Collaborator Author

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.validate.project.

@geekosaur geekosaur changed the title cabal --version on a non-release build should include a Git commit. cabal --version on a non-release build should include a Git commit Nov 5, 2024
@geekosaur
Copy link
Collaborator Author

geekosaur commented Nov 5, 2024

And I'm a daily user of cabal HEAD too, but I do my own (usually weekly) builds of HEAD and 3.12.

@geekosaur
Copy link
Collaborator Author

…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.

@geekosaur
Copy link
Collaborator Author

The other way to do it is custom Setup for cabal-install, but that bugs me.

@Kleidukos
Copy link
Member

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

@Kleidukos
Copy link
Member

@ulysses4ever
Copy link
Collaborator

There's at least one package that provides this information automatically, but I'm not sure we want it as a dependency

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.

@ulysses4ever
Copy link
Collaborator

Re data-files: they work great for cabal install but don't work at all with cabal build. Which may cost us another build at CI time. I'd try to avoid all that.

@Kleidukos
Copy link
Member

@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 -head release, no?

@geekosaur
Copy link
Collaborator Author

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.)

@Kleidukos
Copy link
Member

I see, thank you.

@ulysses4ever
Copy link
Collaborator

Template Haskell is a non-issue if this is hidden behind a flag

@geekosaur
Copy link
Collaborator Author

I wonder if there's a good way to ask if TH is supported without using custom Setup (there's no impl for it and you can't check simply by adding a template-haskell dependency, AFAICT you need ghc --info). (I want to be able to fall back if TH isn't available. Again, I'm not sure simply gating template-haskell on a flag is good enough here, I don't know if we get a stub template-haskell on platforms without a bytecode linker.)

@geekosaur
Copy link
Collaborator Author

I suppose there's also just requiring development to be on platforms with working TH, but I feel like that's poor devx.

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

3 participants