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

GHC incorrectly concludes rebuild unnecessary, even when ghc-options have changed #3891

Open
edsko opened this issue Sep 24, 2016 · 11 comments

Comments

@edsko
Copy link
Contributor

edsko commented Sep 24, 2016

Steps:

  1. Compile your program (using new-build). Realize it has a space leak.
  2. Change cabal.project to:
package ingest
  ghc-options: -fno-full-laziness
  1. Call new-build again:
# cabal new-build
In order, the following will be built (use -v for more details):
 - ingest-0.1.0.0 (lib) --enable-profiling (configuration changed)
 - ingest-0.1.0.0 (exe:ingest) --enable-profiling (configuration changed)
Configuring component lib from ingest-0.1.0.0
Preprocessing library ingest-0.1.0.0...
Configuring component exe:ingest from ingest-0.1.0.0
Preprocessing executable 'ingest' for ingest-0.1.0.0...

Note that although it detected "configuration changed", nothing actually got recompiled. The change only takes effect after I manually delete the dist-newstyle directory and rebuild again.

@ezyang
Copy link
Contributor

ezyang commented Sep 24, 2016

Judging from the log output, it is likely we are invoking GHC, but GHC does not consider that recompilation is necessary. So technically this is an upstream bug. But that's not an excuse, we should do something here.

@edsko
Copy link
Contributor Author

edsko commented Sep 24, 2016

FWIW, with the traditional build this works just fine (and I use that all the time when debugging low level issues).

@ezyang
Copy link
Contributor

ezyang commented Sep 24, 2016

OK, well, never mind then!

@edsko
Copy link
Contributor Author

edsko commented Sep 26, 2016

Hmmm, it seems I was wrong about ti working with traditional build. Not sure why I concluded that. It doesn't work with traditional build either :) Apologies.

@ezyang
Copy link
Contributor

ezyang commented Sep 26, 2016

OK relabeled ;)

@dcoutts dcoutts changed the title Changing ghc-options does not trigger recompile (new-build) Changing ghc-options does not trigger recompile for local packages Sep 26, 2016
@ezyang ezyang added this to the Triaged milestone Sep 28, 2016
@phadej
Copy link
Collaborator

phadej commented Oct 18, 2016

  • 17:29 dcoutts phadej: ok, so what we discussed previously with hvr and others was that we need a distinction between options to programs that affect the outcomes (and so must be included in the hashes), and options that do not like logging verbosity, or RTS opts
  • 17:35 dcoutts phadej: you'll see there's the existing program options which gets included into the elaborated package config, and into the package id hashes
  • 17:35 dcoutts we'd want a separate set of options that live in the BuildSettings
  • 17:36 dcoutts the BuildSettings is for things like -v -j etc that do not affect the outcome of the build
  • 17:36 dcoutts so we'd keep a set of program options in there, so they don't get tracked as part of config
  • 17:37 dcoutts and combine the two when invoking Setup.hs to build stuff
  • 17:38 dcoutts and of course need a new name scheme for the CLI
  • 17:38 dcoutts --${prog}-options vs ?
  • 17:38 dcoutts phadej: and while you're at it, if you can make the prog options only apply to the local packages, like all other options, that'd be a very useful bug fix
  • 17:39 dcoutts it's really annoying at the moment that --ghc-options accidentally applies to all deps
  • 17:39 phadej it is
  • 17:39 phadej I'll copy paste this log i

nto memo, and refine it into issue later today/tomorrow

@phadej phadej self-assigned this Oct 18, 2016
@phadej
Copy link
Collaborator

phadej commented Oct 18, 2016

E.g. atm it triggers the rebuild, but a bit too big one...

@ezyang ezyang changed the title Changing ghc-options does not trigger recompile for local packages GHC incorrectly concludes rebuild unnecessary, even when ghc-options have changed Nov 11, 2016
@ezyang
Copy link
Contributor

ezyang commented Nov 11, 2016

@phadej, the conversation you pasted in this ticket is not relevant to the original issue of the ticket (which is a GHC bug.) Maybe a different ticket should be opened?

@phadej
Copy link
Collaborator

phadej commented Nov 15, 2016

@ezyang it related to #3883, there cabal rebuild everything even not necessary, and here's the opposite.

@jneira
Copy link
Member

jneira commented May 1, 2022

This has been resolved by #7973, thanks all!

@jneira jneira closed this as completed May 1, 2022
@jneira
Copy link
Member

jneira commented May 2, 2022

I misunderstood the linked pr which not affected the caching of ghc-options only made them be applied to local packages
sorry for the noise!

@jneira jneira reopened this May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants