-
Notifications
You must be signed in to change notification settings - Fork 696
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
Add status
command to cabal
#7500
Conversation
If the intent is for these to be machine-readable, would it make sense to dump them out in JSON or similar by default? |
What's wrong with reading |
Personally, I think it is a bit troublesome to find Additionally, what is the simplest/efficient way to generate However, I can see how appealing it would be to not have to introduce a new command... |
So it the replacement od |
Not only from
Basically yes, but intended to be a bit more general.
Yep, ideally a quick way to query for project metadata, in this case project compiler and targets. |
@Mergifyio update |
Command
|
Some slight bikeshedding since we closed the old status pr in favor of this. I'd prefer the name be something like "status" (now available!) or "build-info" or the like, since I imagine end users and not just ides might want this. Also I'd encourage taking a look at this |
I did not have time yet to revisit this PR. |
@fendor ping, would be great to see this in 3.8 if possible |
I think to get this over the finish line, we need the following resolved:
|
Thanks for the update
I would say that it should generate the info if it is needed instead throw an error or show staled info.
I would say that human readable, as tools could access the undelying info (build-info and plan.json). that said it could have some flag to make it seudo machine readable.
Sounds good |
I agree with @gbaz that |
6504c2f
to
bcda142
Compare
e5a68bc
to
2ee5327
Compare
Lightweight command that can query for very basic information in a cabal project. In particular, information about the compiler for the project and the location of the so-called `build-info` field. Other flags are bound to follow.
This is more flexible than giving the user the build-info file directly, since this information is redundant as it is located in plan.json. There we can even express some more conditions. If the target is not a local dependency, the user can check that. If the user needs the build-info, then they can look it up in plan.json.
2ee5327
to
0995649
Compare
0995649
to
c780f34
Compare
❌ Base branch update has failedrefusing to allow a GitHub App to create or update workflow |
Closing as discussed in https://hackmd.io/mQjghm2zRgWgcyD4XKhBqA A new PR will follow soonish, depending on the holidays. |
Lightweight command that can query for very basic information
in a cabal project.
In particular, information about the compiler for the project and the
unit-id a given target belongs to.
Other flags are bound to follow.
A document that lays out the plan in more detail: https://gist.github.com/fendor/796b373aba26e12dbdecf7e40af78b32
This is the second part to #7489. It allows IDEs and hie-bios to quickly query for certain project meta information, in this case compiler information and what unit a target string belongs to.
Example:
Target strings that resolve to the same component are listed both times.
Main advantage:
Disadvantage:
Alternatives:
cabal build --dry-run
to generateplan.json
and then parse that one.plan.json
given a target string?cabal build --dry-run --targets
or something like that, but it feels like terrible UX.Missing:
Old PR description, here for completeness
Lightweight command that can query for very basic information
in a cabal project.
In particular, you can list all targets in your project or print
information about the compiler. Other flags are bound to follow.
This is the second part to #7489. It allows IDEs and hie-bios to quickly query for certain project meta information, in this case compiler information and available targets.
Example:
> cabal ide --project-compiler Resolving dependencies... Compiler: ghc Version: 8.10.2 Path: /home/hugin/.ghcup/bin/ghc-8.10.2
> cabal ide --targets lib:Cabal lib:cabal-testsuite exe:setup exe:cabal-tests lib:cabal-install exe:cabal test:long-tests test:integration-tests2 test:memory-usage-tests test:unit-tests lib:cabal-install-solver test:unit-tests lib:solver-benchmarks exe:hackage-benchmark test:unit-tests lib:Cabal-QuickCheck lib:Cabal-tree-diff lib:Cabal-described test:no-thunks-test test:rpmvercmp test:hackage-tests test:custom-setup-tests test:check-tests test:parser-tests test:unit-tests test:cabal-benchmarks lib:cabal-doctest
Main advantage:
Disadvantage:
Alternatives:
cabal build --dry-run
to generateplan.json
and then parse that one.plan.json
?cabal build --dry-run --targets
or something like that, but it feels like terrible UX.Missing:
[ ] Documentation[ ] Test-cases