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

Some env setup steps are duplicated #2459

Closed
sjakobi opened this issue Aug 9, 2016 · 4 comments
Closed

Some env setup steps are duplicated #2459

sjakobi opened this issue Aug 9, 2016 · 4 comments

Comments

@sjakobi
Copy link
Member

sjakobi commented Aug 9, 2016

~> stack path -v
Version 1.1.3, Git revision 49d96c9cbbd34ab33af02f3957b33fdd9575a7f8 (dirty) (3945 commits) x86_64 hpack-0.14.0
...
2016-08-09 15:27:07.043895: [debug] Checking whether stack was built with libgmp4 @(stack_BSx6FTAIDJFC2EPDshToqJ:Stack.Config src/Stack/Config.hs:334:5)
2016-08-09 15:27:07.044312: [debug] Run process: /usr/bin/ldd /home/simon/.local/bin/stack @(stack_BSx6FTAIDJFC2EPDshToqJ:System.Process.Read src/System/Process/Read.hs:271:3)
2016-08-09 15:27:07.055798: [debug] Process finished in 11 ms: /usr/bin/ldd /home/simon/.local/bin/stack @(stack_BSx6FTAIDJFC2EPDshToqJ:System.Process.Read src/System/Process/Read.hs:271:3)
2016-08-09 15:27:07.055984: [debug] Stack was not built with libgmp4 @(stack_BSx6FTAIDJFC2EPDshToqJ:Stack.Config src/Stack/Config.hs:338:14)
2016-08-09 15:27:07.056088: [info] Run from outside a project, using implicit global project config @(stack_BSx6FTAIDJFC2EPDshToqJ:Stack.Config src/Stack/Config.hs:469:13)
2016-08-09 15:27:07.061531: [info] Using resolver: nightly-2016-08-06 from implicit global project's config file: /home/simon/.stack/global-project/stack.yaml @(stack_BSx6FTAIDJFC2EPDshToqJ:Stack.Config src/Stack/Config.hs:483:32)
2016-08-09 15:27:07.061719: [debug] Trying to decode /home/simon/.stack/build-plan-cache/x86_64-linux/nightly-2016-08-06.cache @(stack_BSx6FTAIDJFC2EPDshToqJ:Data.Store.VersionTagged src/Data/Store/VersionTagged.hs:68:5)
2016-08-09 15:27:07.084105: [debug] Success decoding /home/simon/.stack/build-plan-cache/x86_64-linux/nightly-2016-08-06.cache @(stack_BSx6FTAIDJFC2EPDshToqJ:Data.Store.VersionTagged src/Data/Store/VersionTagged.hs:72:13)
2016-08-09 15:27:07.085371: [debug] Checking whether stack was built with libgmp4 @(stack_BSx6FTAIDJFC2EPDshToqJ:Stack.Config src/Stack/Config.hs:334:5)
2016-08-09 15:27:07.085513: [debug] Run process: /usr/bin/ldd /home/simon/.local/bin/stack @(stack_BSx6FTAIDJFC2EPDshToqJ:System.Process.Read src/System/Process/Read.hs:271:3)
2016-08-09 15:27:07.097725: [debug] Process finished in 12 ms: /usr/bin/ldd /home/simon/.local/bin/stack @(stack_BSx6FTAIDJFC2EPDshToqJ:System.Process.Read src/System/Process/Read.hs:271:3)
2016-08-09 15:27:07.097923: [debug] Stack was not built with libgmp4 @(stack_BSx6FTAIDJFC2EPDshToqJ:Stack.Config src/Stack/Config.hs:338:14)
2016-08-09 15:27:07.098027: [info] Run from outside a project, using implicit global project config @(stack_BSx6FTAIDJFC2EPDshToqJ:Stack.Config src/Stack/Config.hs:469:13)
...
@sjakobi sjakobi added this to the P2: Should milestone Aug 9, 2016
@sjakobi sjakobi changed the title libgmp4 check during env setup happens twice Some env setup steps are duplicated Aug 9, 2016
@sjakobi
Copy link
Member Author

sjakobi commented Aug 9, 2016

Another symptom:

~/s/gitit> stack install
Warning (added by new or init): Specified resolver could not satisfy all dependencies. Some external packages have been added as dependencies.
You can suppress this message by removing it from stack.yaml

Warning (added by new or init): Specified resolver could not satisfy all dependencies. Some external packages have been added as dependencies.
You can suppress this message by removing it from stack.yaml
...

@mgsloan
Copy link
Contributor

mgsloan commented Aug 9, 2016

Yeah, that doesn't look so good!

@sjakobi
Copy link
Member Author

sjakobi commented Aug 10, 2016

git bisect lead me to this line from #2270:

The addition of loadCompilerVersion causes the BuildConfig to be loaded twice (via lcLoadBuildConfig).

To resolve this I'm thinking of the following:

  • Figure out the cheapest way to get the wanted compiler (bcWantedCompiler only uses bcWantedMiniBuildPlan, so we shouldn't need to compute the entire BuildConfig).
  • Reuse as much of the configuration found in the first step as possible in the construction of the BuildConfig to avoid duplicate work.

This sounds rather inelegant and like quite a bit of work to me, so if someone can think of an alternative resolution, please chime in!

Pinging @YPares.

@sjakobi
Copy link
Member Author

sjakobi commented Aug 14, 2016

Figure out the cheapest way to get the wanted compiler (bcWantedCompiler only uses bcWantedMiniBuildPlan, so we shouldn't need to compute the entire BuildConfig).

Actually I can't really find any potential for savings here: The compiler version seems to depend on virtually all the other information that goes into the BuildConfig. (Here's the relevant code)

@borsboom borsboom modified the milestones: P1: Must, P2: Should Aug 15, 2016
@borsboom borsboom self-assigned this Aug 16, 2016
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

3 participants