-
Notifications
You must be signed in to change notification settings - Fork 709
cabal install
rebuilds all dependencies after a cabal build
#7745
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
Comments
More info: output of `cabal --store-dir D:\ws\haskell\cabal-test\sr install say --lib --package-env . -v3` (it installs the lib with unit id f56dd8dcb828e676e2fe979752cedce7d5e3ea47)
Output of `cabal --store-dir D:\ws\haskell\cabal-test\sr build -v3` (unit id 9d85f3e60b43742f757835053a7ea996c1c596e4)
I dont see anything on how the unit id is being computed |
@jneira interesting! and you can confirm this is windows only? (or at least not linux?) One thing I would suggest to investigate further is to hack up the
|
no, I assumed it works in Linux from some comments in the linked issues will try to trace the cause in the code places you are pointing, many thanks |
I can confirm that on os x I can't reproduce.
will only create one installation of ghc 8.10.4, cabal-install 3.6.2.0 |
UpdatedIt reproduces consistently on MacOS with a pretty complex project (Agda), and with the toy project too. ghc 9.0.1 and 8.10.7, cabal-install 3.6.2.0. Trying to reproduce what @gbaz did, I clearly see that $ pwd
/Users/ur20980/src/test-dr
$ cabal --store-dir $HOME/src/test-dr/store build
Resolving dependencies...
Build profile: -w ghc-9.0.1 -O1
In order, the following will be built (use -v for more details):
- say-0.1.0.1 (lib) (requires build)
- test-dr-0.1.0.0 (exe:test-dr) (first run)
Starting say-0.1.0.1 (lib)
Building say-0.1.0.1 (lib)
Installing say-0.1.0.1 (lib)
Completed say-0.1.0.1 (lib)
Configuring executable 'test-dr' for test-dr-0.1.0.0..
Preprocessing executable 'test-dr' for test-dr-0.1.0.0..
Building executable 'test-dr' for test-dr-0.1.0.0..
[1 of 1] Compiling Main ( app/Main.hs, /Users/ur20980/src/test-dr/dist-newstyle/build/x86_64-osx/ghc-9.0.1/test-dr-0.1.0.0/x/test-dr/build/test-dr/test-dr-tmp/Main.dyn_o )
Linking /Users/ur20980/src/test-dr/dist-newstyle/build/x86_64-osx/ghc-9.0.1/test-dr-0.1.0.0/x/test-dr/build/test-dr/test-dr ...
$ cabal --store-dir $HOME/src/test-dr/store install
Wrote tarball sdist to
/Users/ur20980/src/test-dr/dist-newstyle/sdist/test-dr-0.1.0.0.tar.gz
Resolving dependencies...
Build profile: -w ghc-9.0.1 -O1
In order, the following will be built (use -v for more details):
- say-0.1.0.1 (lib) (requires build)
- test-dr-0.1.0.0 (exe:test-dr) (requires build)
Starting say-0.1.0.1 (lib)
Building say-0.1.0.1 (lib)
Installing say-0.1.0.1 (lib)
Completed say-0.1.0.1 (lib)
Starting test-dr-0.1.0.0 (exe:test-dr)
Building test-dr-0.1.0.0 (exe:test-dr)
Installing test-dr-0.1.0.0 (exe:test-dr)
Completed test-dr-0.1.0.0 (exe:test-dr)
Symlinking 'test-dr' to '/Users/ur20980/.cabal/bin/test-dr'
$
Here's cabal-version: 2.4
name: test-dr
version: 0.1.0.0
-- A short (one-line) description of the package.
-- synopsis:
-- A longer description of the package.
-- description:
-- A URL where users can report bugs.
-- bug-reports:
-- The license under which the package is released.
-- license:
-- author:
-- maintainer:
-- A copyright notice.
-- copyright:
-- category:
extra-source-files: CHANGELOG.md
executable test-dr
main-is: Main.hs
-- Modules included in this executable, other than Main.
-- other-modules:
-- LANGUAGE extensions used by modules in this package.
-- other-extensions:
build-depends: base ^>=4.15.0.0
, say
hs-source-dirs: app
default-language: Haskell2010 Forcing GHC to 8.8.4 via $ cabal --store-dir $HOME/src/test-dr/store build
Resolving dependencies...
Build profile: -w ghc-8.8.4 -O1
In order, the following will be built (use -v for more details):
- say-0.1.0.1 (lib) (first run)
- test-dr-0.1.0.0 (exe:test-dr) (first run)
Configuring library for say-0.1.0.1..
Preprocessing library for say-0.1.0.1..
Building library for say-0.1.0.1..
[1 of 2] Compiling Paths_say ( /Users/ur20980/src/test-dr/dist-newstyle/build/x86_64-osx/ghc-8.8.4/say-0.1.0.1/build/autogen/Paths_say.hs, /Users/ur20980/src/test-dr/dist-newstyle/build/x86_64-osx/ghc-8.8.4/say-0.1.0.1/build/Paths_say.o )
[2 of 2] Compiling Say ( src/Say.hs, /Users/ur20980/src/test-dr/dist-newstyle/build/x86_64-osx/ghc-8.8.4/say-0.1.0.1/build/Say.o )
Configuring executable 'test-dr' for test-dr-0.1.0.0..
Preprocessing executable 'test-dr' for test-dr-0.1.0.0..
Building executable 'test-dr' for test-dr-0.1.0.0..
[1 of 1] Compiling Main ( app/Main.hs, /Users/ur20980/src/test-dr/dist-newstyle/build/x86_64-osx/ghc-8.8.4/test-dr-0.1.0.0/x/test-dr/build/test-dr/test-dr-tmp/Main.dyn_o )
Linking /Users/ur20980/src/test-dr/dist-newstyle/build/x86_64-osx/ghc-8.8.4/test-dr-0.1.0.0/x/test-dr/build/test-dr/test-dr ...
$ cabal --store-dir $HOME/src/test-dr/store install
Wrote tarball sdist to
/Users/ur20980/src/test-dr/dist-newstyle/sdist/say-0.1.0.1.tar.gz
Wrote tarball sdist to
/Users/ur20980/src/test-dr/dist-newstyle/sdist/test-dr-0.1.0.0.tar.gz
Resolving dependencies...
Build profile: -w ghc-8.8.4 -O1
In order, the following will be built (use -v for more details):
- say-0.1.0.1 (lib) (requires build)
- test-dr-0.1.0.0 (exe:test-dr) (requires build)
Starting say-0.1.0.1 (lib)
Building say-0.1.0.1 (lib)
Installing say-0.1.0.1 (lib)
Completed say-0.1.0.1 (lib)
Starting test-dr-0.1.0.0 (exe:test-dr)
Building test-dr-0.1.0.0 (exe:test-dr)
Installing test-dr-0.1.0.0 (exe:test-dr)
Completed test-dr-0.1.0.0 (exe:test-dr)
Symlinking 'test-dr' to '/Users/ur20980/.cabal/bin/test-dr'
|
@jneira perhaps, editing the title of this issue to remove "windows" would make sense? |
cabal install
rebuilds all dependencies after a cabal build
in windowscabal install
rebuilds all dependencies after a cabal build
@mouse07410 thanks for take time to reproduce it in another os, i've removed the windows label and changed the title as you noted
|
My -- This config file was generated using the following versions
-- of Cabal and cabal-install:
-- Cabal library version: 3.6.1.0
-- cabal-install version: 3.6.0.0
repository hackage.haskell.org
url: http://hackage.haskell.org/
-- secure: True
-- root-keys:
-- key-threshold: 3
-- default-user-config:
-- ignore-expiry: False
-- http-transport:
-- nix: False
-- local-no-index-repo:
remote-repo-cache: /Users/ur20980/.cabal/packages
-- logs-dir: /Users/ur20980/.cabal/logs
world-file: /Users/ur20980/.cabal/world
-- store-dir:
-- active-repositories:
-- verbose: 1
-- compiler: ghc
-- library-vanilla: True
-- library-profiling:
shared: True
-- static:
executable-dynamic: True
-- executable-static: False
-- profiling:
-- flags:
extra-include-dirs: /opt/local/include,/usr/local/include
-- deterministic:
-- cid:
extra-lib-dirs: /usr/lib,
/opt/local/lib/liconv,
/opt/local/lib,
/usr/local/lib
-- extra-framework-dirs:
extra-prog-path: /Users/ur20980/.cabal/bin
-- instantiate-with:
-- symlink-bindir:
build-summary: /Users/ur20980/.cabal/logs/build.log
-- build-log:
remote-build-reporting: none
-- report-planning-failure: False
-- per-component: True
-- one-shot: False
-- run-tests:
jobs: $ncpus
-- keep-going: False
-- install-method:
installdir: /Users/ur20980/.cabal/bin
-- username:
-- password:
-- password-command:
-- builddir: |
I think i've found the possible cause, thanks to @gbaz's tip
cabal/cabal-install/src/Distribution/Client/ProjectBuilding.hs Lines 1019 to 1021 in 9ef1331
The definitive check would be remove our (@mouse07410 and mine) entries for both fields to check it make the issue go away and add one entry in the @gbaz case to check it makes reproduce the rebuild in his case. |
Possible actions to fix if we double check that is the cause:
|
Oh wait the bug is cabal install is duplicating entries no cabal build pruning them 🤣 sorry for the confusion |
|
To clarify: you've confirmed the root cause, right? |
The cause and the bug had been reported here: #6906 🤦 |
yeah, the issue i've just linked confirm it too |
So it is esentially a duplicate of #6906: "Those who cannot remember the past are condemned to repeat it." |
Splendid. This seems like a very juicy and (let's hope) relatively low hanging fruit. Even just time saved diagnosing offshoots of this problems again and again is significant and could be used elsewhere. |
Describe the bug
cabal install
rebuilds all dependencies after acabal build
in windowsTo Reproduce
Steps to reproduce the behavior:
say
cabal build
but no usingcabal install
cabal-plan diff
does not output anything, from other tests it seems it is broken in windows, including in the msys2 shellcabal install
say
is the same in the temp build dircabal info
for all the three build dirs involved:cabal info
Summary: the unit id for say (
f56dd8dcb828e676e2fe979752cedce7d5e3ea47
from the temp build dir is different from the other two (9d85f3e60b43742f757835053a7ea996c1c596e4
). Both are installed in the store dir.cabal-plan diff
does not output anything (and afaik it should at least in the first case)Expected behavior
cabal install
should only rebuild local packages like in linuxSystem information
cabal
: 3.6.2.0 but is reproduced for sure with 3.6.0.0 and 3.4.0.0 and afair with any cabal version i tried since 2.4.0.0ghc
versions: 8.6.5 and 8.10.7, but probably with anyAdditional context
@fgaz @gbaz i hope there is enough info to at least demonstrate the behaviour, let me know if more info or tests are needed
The text was updated successfully, but these errors were encountered: