You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suppose the current project has a foo executable that has been built already (e.g. via cabal v2-build foo). Then cabal v2-run foo --dry-run will re-run dependency solving and display a "the following would be built" message without actually building anything (as expected), but then will run the existing executable.
Is this intended? I would expect cabal v2-run foo --dry-run to behave like cabal v2-build foo --dry-run, i.e. print out the dependencies to be built but not actually run anything. I can't see documentation in the manual for --dry-run, and the --help text says
--dry-run Do not install anything, only print what would be installed.
Tested with cabal 3.4 on Linux.
The text was updated successfully, but these errors were encountered:
% /opt/cabal/3.2/bin/cabal run initialization --dry-run
Resolving dependencies...
Build profile: -w ghc-8.6.5 -O1
In order, the following would be built (use -v for more details):
- splitmix-0.1.0.3 (lib) (cannot read state cache)
- splitmix-0.1.0.3 (test:initialization) (first run)
/code/public-haskell/splitmix/dist-newstyle/build/x86_64-linux/ghc-8.6.5/splitmix-0.1.0.3/t/initialization/build/initialization/initialization: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
I.e. it indeed doesn't build, but it runs (and if there's something, it will succeed).
I can imagine the use case for that, but --dry-run is not a flag I'd imagine for that. Also because, cabal test --dry-run doesn't run test suites...
% /opt/cabal/3.2/bin/cabal test initialization --dry-run
Resolving dependencies...
Build profile: -w ghc-8.6.5 -O1
In order, the following would be built (use -v for more details):
- splitmix-0.1.0.3 (lib) (cannot read state cache)
- splitmix-0.1.0.3 (test:initialization) (first run)
That said, cabal v2-build, cabal v2-run, cabal v2-test with --dry-run would all do the same, so if v2-build works, use that for now.
Suppose the current project has a
foo
executable that has been built already (e.g. viacabal v2-build foo
). Thencabal v2-run foo --dry-run
will re-run dependency solving and display a "the following would be built" message without actually building anything (as expected), but then will run the existing executable.Is this intended? I would expect
cabal v2-run foo --dry-run
to behave likecabal v2-build foo --dry-run
, i.e. print out the dependencies to be built but not actually run anything. I can't see documentation in the manual for--dry-run
, and the--help
text saysTested with cabal 3.4 on Linux.
The text was updated successfully, but these errors were encountered: