[GHC] #7841: Stage1Only conditional program/package building

#7841: Stage1Only conditional program/package building -----------------------------+---------------------------------------------- Reporter: elliottt | Owner: Type: feature request | Status: new Priority: normal | Component: Build System Version: 7.7 | Keywords: Stage1Only Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- This patch includes changes to allow programs and packages to be disabled by stage when building GHC. == rule/build-package.mk == * Add guards for "disable-$(dir)-$(stage)" around the rule body == rule/build-prog.mk == * Add guards for "disabled-$(dir)-$(stage)" around the rule body == mk/build.mk.default == * Add a set of package disabling definitions when $(Stage1Only) is set to "YES" == rts/ghc.mk == * Add the all_rts target as a dependency for all, causing the rts to build when packages that depend on it are disabled -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7841 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7841: Stage1Only conditional program/package building ---------------------------------+------------------------------------------ Reporter: elliottt | Owner: Type: feature request | Status: patch Priority: normal | Milestone: Component: Build System | Version: 7.7 Keywords: Stage1Only | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: None/Unknown Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | ---------------------------------+------------------------------------------ Changes (by igloo): * status: new => patch * difficulty: => Unknown -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7841#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7841: Stage1Only conditional program/package building -------------------------------+-------------------------------------------- Reporter: elliottt | Owner: Type: feature request | Status: closed Priority: normal | Milestone: Component: Build System | Version: 7.7 Resolution: worksforme | Keywords: Stage1Only Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Difficulty: Unknown Testcase: | Blockedby: Blocking: | Related: -------------------------------+-------------------------------------------- Changes (by igloo): * status: patch => closed * resolution: => worksforme Comment: Thanks for the patch. However, we already have variables like `libraries/base_dist- install_NOT_NEEDED` and `ghc_stage2_NOT_NEEDED` which I think are designed to do the same thing as your `disable-*` variables. The variables you set also look wrong to me, e.g. you define `disable- libraries/array-2` but we never build the array package with stage 2. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7841#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7841: Stage1Only conditional program/package building -------------------------------+-------------------------------------------- Reporter: elliottt | Owner: Type: feature request | Status: closed Priority: normal | Milestone: Component: Build System | Version: 7.7 Resolution: worksforme | Keywords: Stage1Only Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Difficulty: Unknown Testcase: | Blockedby: Blocking: | Related: -------------------------------+-------------------------------------------- Comment(by elliottt): It looks like libraries/base_dist-install_NOT_NEEDED would prevent base from being built at all, instead of just with a specific stage of the compiler. This should be good enough for libraries that shouldn't be built at all for the target of the stage 1 compiler, but wouldn't defining it for a utility program like hsc2hs prevent it from being built with stage 0? I hadn't noticed the guard on the call to build-package in libraries/array/ghc.mk, and just assumed that it would be built with the stage 2 compiler. In the case where stage 2 doesn't get build, what causes the RTS to build, without all_rts being a dependency of all? I'm very interested in getting some version of Stage1Only working, and am happy to do the work to implement it. Could you give me a little guidance so that I can submit a better patch? Thanks! -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7841#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7841: Stage1Only conditional program/package building -------------------------------+-------------------------------------------- Reporter: elliottt | Owner: Type: feature request | Status: closed Priority: normal | Milestone: Component: Build System | Version: 7.7 Resolution: worksforme | Keywords: Stage1Only Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Difficulty: Unknown Testcase: | Blockedby: Blocking: | Related: -------------------------------+-------------------------------------------- Comment(by igloo): Replying to [comment:3 elliottt]:
It looks like libraries/base_dist-install_NOT_NEEDED would prevent base from being built at all, instead of just with a specific stage of the compiler.
`base` is only built with one specific stage of the compiler. For packages that are built with multiple stages, the distdir is different for each one. e.g. `libraries/terminfo_dist-boot` is built with stage 0, and `libraries/terminfo_dist-install` with stage 1.
In the case where stage 2 doesn't get build, what causes the RTS to build, without all_rts being a dependency of all?
Nothing currently; I'll fix that.
I'm very interested in getting some version of Stage1Only working, and am happy to do the work to implement it. Could you give me a little guidance so that I can submit a better patch?
One way (untested) would probably be to add a check `ifneq "$(Stage1Only) $3" "YES 2"` before calling the helpers in `build-prog` and `build- package`, as well as defining `compiler_stage2_NOT_NEEDED=YES` and `ghc_stage2_NOT_NEEDED=YES`. An alternative would be to define lots of `_NOT_NEEDED` variables by iterating over `PACKAGE_STAGE2`. This would make the logic in the rules slightly simpler, but would probably be a little more verbose overall. I think the second would probably be slightly nicer on balance. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7841#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7841: Stage1Only conditional program/package building
-------------------------------+--------------------------------------------
Reporter: elliottt | Owner:
Type: feature request | Status: closed
Priority: normal | Milestone:
Component: Build System | Version: 7.7
Resolution: worksforme | Keywords: Stage1Only
Os: Unknown/Multiple | Architecture: Unknown/Multiple
Failure: None/Unknown | Difficulty: Unknown
Testcase: | Blockedby:
Blocking: | Related:
-------------------------------+--------------------------------------------
Comment(by ian@…):
commit 3d51be452cdff49aecee762c685af52ccb4ce74a
{{{
Author: Ian Lynagh
participants (1)
-
GHC