Comments (9)
Isn't the point that list-bin
gives either zero or one answers, because if it gives multiple answers then $(cabal list-bin ...)
fails?
Are you proposing that list-bin
should be allowed to return multiple results?
from cabal.
Yes, let's please do opt-in.
--all
sounds nice to me.
from cabal.
Stack has a similar command that returns multiple exes;
$ stack ide targets --exes
cabal-install:exe:cabal
cabal-testsuite:exe:cabal-tests
cabal-testsuite:exe:setup
cabal-testsuite:exe:test-runtime-deps
solver-benchmarks:exe:hackage-benchmark
$ stack ide targets --tests
Cabal-tests:test:check-tests
Cabal-tests:test:custom-setup-tests
Cabal-tests:test:hackage-tests
Cabal-tests:test:no-thunks-test
Cabal-tests:test:parser-tests
Cabal-tests:test:rpmvercmp
Cabal-tests:test:unit-tests
cabal-benchmarks:test:cabal-benchmarks
cabal-install:test:integration-tests2
cabal-install:test:long-tests
cabal-install:test:mem-use-tests
cabal-install:test:unit-tests
cabal-install-solver:test:unit-tests
solver-benchmarks:test:unit-tests
from cabal.
Isn't the point that
list-bin
gives either zero or one answers, because if it gives multiple answers then$(cabal list-bin ...)
fails?
This is a good point.
Are you proposing that
list-bin
should be allowed to return multiple results?
Perhaps under a different command? Perhaps list-bins
like cabal-plan
?
λ cabal-plan list-bins
Cabal-tests:test:check-tests /home/andrea/code/cabal/setup-wrapper/dist-newstyle/build/x86_64-linux/ghc-9.6.4/Cabal-tests-3/t/check-tests/build/check-tests/check-tests
Cabal-tests:test:custom-setup-tests /home/andrea/code/cabal/setup-wrapper/dist-newstyle/build/x86_64-linux/ghc-9.6.4/Cabal-tests-3/t/custom-setup-tests/build/custom-setup-tests/custom-setup-tests
Cabal-tests:test:hackage-tests /home/andrea/code/cabal/setup-wrapper/dist-newstyle/build/x86_64-linux/ghc-9.6.4/Cabal-tests-3/t/hackage-tests/build/hackage-tests/hackage-tests
Cabal-tests:test:no-thunks-test /home/andrea/code/cabal/setup-wrapper/dist-newstyle/build/x86_64-linux/ghc-9.6.4/Cabal-tests-3/t/no-thunks-test/build/no-thunks-test/no-thunks-test
Cabal-tests:test:parser-tests /home/andrea/code/cabal/setup-wrapper/dist-newstyle/build/x86_64-linux/ghc-9.6.4/Cabal-tests-3/t/parser-tests/build/parser-tests/parser-tests
Cabal-tests:test:rpmvercmp /home/andrea/code/cabal/setup-wrapper/dist-newstyle/build/x86_64-linux/ghc-9.6.4/Cabal-tests-3/t/rpmvercmp/build/rpmvercmp/rpmvercmp
Cabal-tests:test:unit-tests /home/andrea/code/cabal/setup-wrapper/dist-newstyle/build/x86_64-linux/ghc-9.6.4/Cabal-tests-3/t/unit-tests/build/unit-tests/unit-tests
alex:exe:alex /home/andrea/.cabal/store/ghc-9.6.4/alex-3.5.0.0-e-alex-5a2b80e00d9a49e8478136c249dafe90ecd3b132c66d82a39fa24dd0f577ba41/bin/alex
cabal-benchmarks:test:cabal-benchmarks /home/andrea/code/cabal/setup-wrapper/dist-newstyle/build/x86_64-linux/ghc-9.6.4/cabal-benchmarks-3/t/cabal-benchmarks/build/cabal-benchmarks/cabal-benchmarks
cabal-install:exe:cabal /home/andrea/code/cabal/setup-wrapper/dist-newstyle/build/x86_64-linux/ghc-9.6.4/cabal-install-3.11.0.0/x/cabal/build/cabal/cabal
cabal-install:test:integration-tests2 /home/andrea/code/cabal/setup-wrapper/dist-newstyle/build/x86_64-linux/ghc-9.6.4/cabal-install-3.11.0.0/t/integration-tests2/build/integration-tests2/integration-tests2
cabal-install:test:long-tests /home/andrea/code/cabal/setup-wrapper/dist-newstyle/build/x86_64-linux/ghc-9.6.4/cabal-install-3.11.0.0/t/long-tests/build/long-tests/long-tests
cabal-install:test:mem-use-tests /home/andrea/code/cabal/setup-wrapper/dist-newstyle/build/x86_64-linux/ghc-9.6.4/cabal-install-3.11.0.0/t/mem-use-tests/build/mem-use-tests/mem-use-tests
cabal-install:test:unit-tests /home/andrea/code/cabal/setup-wrapper/dist-newstyle/build/x86_64-linux/ghc-9.6.4/cabal-install-3.11.0.0/t/unit-tests/build/unit-tests/unit-tests
cabal-install-solver:test:unit-tests /home/andrea/code/cabal/setup-wrapper/dist-newstyle/build/x86_64-linux/ghc-9.6.4/cabal-install-solver-3.11.0.0/t/unit-tests/build/unit-tests/unit-tests
cabal-testsuite:exe:cabal-tests /home/andrea/code/cabal/setup-wrapper/dist-newstyle/build/x86_64-linux/ghc-9.6.4/cabal-testsuite-3/build/cabal-tests/cabal-tests
cabal-testsuite:exe:setup /home/andrea/code/cabal/setup-wrapper/dist-newstyle/build/x86_64-linux/ghc-9.6.4/cabal-testsuite-3/build/setup/setup
cabal-testsuite:exe:test-runtime-deps /home/andrea/code/cabal/setup-wrapper/dist-newstyle/build/x86_64-linux/ghc-9.6.4/cabal-testsuite-3/build/test-runtime-deps/test-runtime-deps
happy:exe:happy /home/andrea/.cabal/store/ghc-9.6.4/happy-1.20.1.1-e-happy-5d2cb1f20b337ca4b455575e6d86a6d3afa94612f714745960f587f15420f050/bin/happy
hsc2hs:exe:hsc2hs /home/andrea/.cabal/store/ghc-9.6.4/hsc2hs-0.68.10-e-hsc2hs-a4946925ece439133faec67ee16e6c44532e84c9fc4949d89b66614c823a056c/bin/hsc2hs
open-browser:exe:example /home/andrea/.cabal/store/ghc-9.6.4/open-browser-0.2.1.0-e-example-16aff3a3531b1e6b7f0c4a5edaec7c5cd82d3ae582b887f63c83a7139a9b1cd0/bin/example
pretty-show:exe:ppsh /home/andrea/.cabal/store/ghc-9.6.4/pretty-show-1.10-e-ppsh-bad54a4a82951feafb98773240e419cced984c9a481befe5d0dfda946f672683/bin/ppsh
solver-benchmarks:exe:hackage-benchmark /home/andrea/code/cabal/setup-wrapper/dist-newstyle/build/x86_64-linux/ghc-9.6.4/solver-benchmarks-3/x/hackage-benchmark/build/hackage-benchmark/hackage-benchmark
solver-benchmarks:test:unit-tests /home/andrea/code/cabal/setup-wrapper/dist-newstyle/build/x86_64-linux/ghc-9.6.4/solver-benchmarks-3/t/unit-tests/build/unit-tests/unit-tests
from cabal.
Some discussion about this in
Isn't the point that list-bin gives either zero or one answers, because if it gives multiple answers then $(cabal list-bin ...) fails?
Not sure it's all that good of an idea judging by how often people ask for an ability to get a list out of it, and I'm yet to see people excited by this idea outside the old cabal team. I'd rather there was a flag that people would apply in scripting scenarios (e.g. $(cabal list-bin --force-unique ...)
) if they want today's strict behavior. A separate command altogether is also possible, perhaps, but feels a little like an overkill: it'd mostly duplicate the existing list-bin
; also it will take time to teach people to use it (the old subcommand should participate in that by issuing a suggesting to use the new one if there're multiple results).
So, I'd prefer augmenting list-bin
. If we make this change, I don't think many things will fail because the scripting use cases that work today will probably work under the new version: after all, we're making it more lenient rather than more strict (which would break more).
from cabal.
"I'm yet to see people excited by this idea outside the old cabal team" <- nobody's excited by this or asking for it because it already works, and was widely demanded, which is why the feature was implemented.
I think we can add an --all
flag to list-bin
to get the new behavior, and put that in the error message as a suggestion. But the behavior should be opt-in rather than opt-out to not disrupt any existing uses.
(Remember, existing uses always may be widespread but silent, and the only people who speak up are the ones who have new complaints -- the folks happy with how it works don't hang out on the tracker looking for tickets that might change thins for them!)
from cabal.
My point is very simple: people who are happy with the current behavior will be just as happy with the new behavior because they probably rely on the happy parth rather than on the exceptional path.
But the opt-in strategy with a suggestion sounds fine too.
from cabal.
I find the command name confusing, a list command that returns one thing, the full path to an executable. What is the history there? Is it named after the ls
shell command (a command that takes [FILE] and has a default)?
$ ls --help
Usage: ls [OPTION]... [FILE]...
List information about the FILEs (the current directory by default).
...
$ cabal --help
...
[running and testing]
list-bin List the path to a single executable.
$ cabal list-bin --help
List the path to a single executable.
Usage: cabal list-bin [FLAGS] TARGET
List the path to **a** build product.
Could we please add a cabal targets
command before we change the cabal list-bin
behaviour?
from cabal.
Yes, let's please do opt-in.
--all
sounds nice to me.
That's the all:exes all:tests all:benches
target form, isn't it?
from cabal.
Related Issues (20)
- Cabal-3.12.0.0 passes include dirs to GHC in a new order HOT 6
- build-tool-depends in Cabal regresses ghc ability to build from source distribution HOT 5
- Cabal external command requires typing Return to exit HOT 1
- Support monitoring directory recursive globs
- cabal init fails if git is not installed HOT 5
- Failure to find a program produces an incomprehensible error
- Encountered possible bug during building rpki-prover HOT 14
- Using Setup.hs build --with-ghc looses configure --ghc-option HOT 1
- Conditions don't work with flags HOT 2
- Are we validating `ghc-options` in `.cabal` files? HOT 4
- Do not pass environment variables to `happy`/`alex`, or at least allow a way to filter HOT 2
- Is the `CabalParsing` class necessary? HOT 2
- Changelog for Cabal 3.12 is missing mention of error codes
- Amend non-reinstallable packages list HOT 6
- "Use of GHC's environment variable GHC_PACKAGE_PATH is incompatible with Cabal" when running `Setup.hs test` should be a warning, not an error HOT 4
- Remember "Choose a language for" choice on `cabal init` HOT 4
- Favour non-preferred versions over deprecated versions
- [RFC] Revive cabal sandboxes (UX) HOT 2
- perf: verifyFetchedTarball called once for each package from a remote repository
- Come up with a way to build documentation for a package without rebuilding a lot HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cabal.