Skip to content
This repository has been archived by the owner on Aug 2, 2020. It is now read-only.

Add support for build flavours #188

Closed
snowleopard opened this issue Jan 22, 2016 · 4 comments
Closed

Add support for build flavours #188

snowleopard opened this issue Jan 22, 2016 · 4 comments
Assignees
Milestone

Comments

@snowleopard
Copy link
Owner

The make-based build system supports a number of build flavours, collections of settings tailored for a particular use-case, e.g. quick, validate, etc.

Relevant issues: #132, #186, #187.

@snowleopard snowleopard self-assigned this Jan 22, 2016
@snowleopard snowleopard added this to the ghc-quake milestone Jan 22, 2016
snowleopard added a commit that referenced this issue Jan 24, 2016
snowleopard added a commit that referenced this issue Jan 25, 2016
@snowleopard
Copy link
Owner Author

I put build flavours in separate files (ghc/ghc@2c24fd7), so I could more easily diff them, and spot inconsistencies. YMMV

@thomie Let me respond to your comment here.

Yes, for now I am also putting different flavours in separate files. Let's see how small/big these files will eventually become. We probably wouldn't want to have multiple files each containing a single useful line and a dozen of boilerplate imports etc., but maybe this won't happen.

@thomie
Copy link

thomie commented May 17, 2016

As discussed in #243, it would be nice to be able to select a BuildFlavour from within User.hs.

Other setting in User.hs should then override settings predefined by that BuildFlavour. And command-line flags should yet again override all the previous settings.

@snowleopard
Copy link
Owner Author

The relevant bits are here:

data Flavour      = Default | Quick deriving (Eq, Show)

-- | Default values for 'CmdLineFlag.Untracked'.
defaultUntracked :: Untracked
defaultUntracked = Untracked  { flavour = Default, ... }

And here:

flavourArgs :: Args
flavourArgs = mconcat
    [ cmdFlavour == Quick ? quickFlavourArgs ]

getArgs :: Expr [String]
getArgs = fromDiffExpr $ mconcat [ defaultBuilderArgs
                                 , defaultPackageArgs
                                 , flavourArgs
                                 , userArgs ]

The trick is to implement the overriding of defaults in Settings/User.hs without introducing import cycles... Not sure how to do that yet.

@snowleopard
Copy link
Owner Author

I implemented build flavours while working on #268, so I'm closing this issue.

snowleopard added a commit that referenced this issue Jan 9, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants