aboutsummaryrefslogtreecommitdiff
path: root/lib/Distribution/Helper.hs
Commit message (Collapse)AuthorAgeFilesLines
* Refactor Program versions handlingDaniel Gröber2020-05-101-1/+1
| | | | | | This mainly renames the program version getters to get* and make them consistenly return Version directly. Such that wrappers like GhcVersion have to be added at the callsites of the relevant functions.
* Only pass pjUnits to compile module instead of whole PlanJsonDaniel Gröber2020-05-021-4/+3
|
* Fix Cabal version selection for build-type:CustomDaniel Gröber2020-05-021-79/+91
| | | | | | | | | | | | | | | | Previously we would pick up Stack's Cabal version with ghc-pkg on the global package-db. This however ignores that Stack also supports custom Setup.hs with the Cabal version from the snapshot instead. In cabal v2-build we have a similar problem. We used to assume that plan.json's cabal-lib-version is used uniformly across units but this is similarly untrue. To fix both of these we re-stage the cabal version query to after reconfiguring a unit, then we can just lookup the Cabal version in setup-config. Fixes #95
* Ignore setup components from plan.json in readUnitInfoDaniel Gröber2020-05-021-1/+14
| | | | | | Cabal includes the Setup.hs executable as a component in plan.json, however there isn't a target to build it directly so we just ignore it for not when reading unit info.
* Move CabalVersion and related types into a new moduleDaniel Gröber2020-05-021-1/+2
|
* Revert "Fix Cabal version selection for Stack (esp. build-type:Custom)"Daniel Gröber2020-02-111-33/+55
| | | | This reverts commit 04c2d34f1874bc198288d33c784bc26f89280ee2.
* Fix Cabal version selection for Stack (esp. build-type:Custom)Daniel Gröber2020-01-111-55/+33
| | | | | | Previously we would pick up Stack's Cabal version with ghc-pkg on the global package-db. This however ignores that Stack also supports custom Setup.hs with the Cabal version from the snapshot instead.
* Restore lost [Note Stack Cabal Version]Daniel Gröber2019-12-211-0/+14
|
* Store piPackages in sorted orderDaniel Gröber2019-11-031-2/+2
| | | | | | Stack and Cabal are likely to have different orderings here. This has caused a difference in behaviour depending on the build-tool used downstream in HIE so for sanity's sake just sort the list.
* Change license to Apache2Daniel Gröber2019-09-291-11/+6
| | | | | | | | All contributors have agreed on public record at https://github.com/DanielG/cabal-helper/issues/76 Fixes #76
* Add support for symlink farming as a workaround for StackDaniel Gröber2019-09-291-57/+7
| | | | | | | | We want to be able to have the build tool use exactly the compiler and related executables we choose. Stack doesn't really like that mode of operation and insists on getting everything from PATH itself so this commit adds support for creating a temporary symlink farm to convince Stack to use the executables we want it to use.
* Remove Compat.ProgramDb moduleDaniel Gröber2019-09-291-2/+7
|
* Fix division factor for helper compilation timerDaniel Gröber2019-09-171-1/+1
| | | | Turns out I'm an idiot and 10eX is actually 10^(x+1).
* Fix some warningsDaniel Gröber2019-09-171-2/+0
|
* Update some code docsDaniel Gröber2019-09-171-3/+2
|
* Implement cabal v2 backpack unit workaroundDaniel Gröber2019-09-171-1/+5
| | | | See https://github.com/haskell/cabal/issues/6201 for details about the bug
* Make caching more fine grainedDaniel Gröber2019-09-171-102/+191
| | | | | | | | | | | | | | | | | Previously we only had a cache for the project info and each unit info. However adding support for passing overridden compiler paths to build tools introduces a nasty data dependency: to fully configure 'Program's we (used to) need ProjInfo which needs an already configured 'Programs' in readProjInfo (ugh). After at least four failed attempts at untangling this I arrived at this solution. Simply splitting up the caches into some smaller parts does the trick and as a side product forced me to add an abstraction for the caching logic so as to not reapeat myself even more. Relatedly runQuery is not just a field accessor anymore but actualy does some IO of itself to manage the cache and make already configured 'Program's available to the rest of the library.
* Export qeCallProcessDaniel Gröber2019-09-171-0/+1
| | | | Seems to have been missed when it was added.
* Add verbose logging support for readProcess callsDaniel Gröber2019-09-171-10/+3
|
* Break cycle between 'Package' and 'Unit'Daniel Gröber2019-09-171-1/+1
|
* Add exported interface for running build-toolsDaniel Gröber2019-09-171-58/+92
|
* Introduce Package abstractonDaniel Gröber2019-09-171-41/+78
| | | | | After lamenting the fact that we don't have this in the docs I figured it really ought to be an exposed abstraction.
* Remove crusty old helper codeDaniel Gröber2019-09-171-8/+15
| | | | | | | | | | | | - Inplace component inlining really always was a nasty cludge, now that we have proper build-system support we can get rid of it. - GHC options subsets aren't really needed, we can split these up after parsing the options using the ghc library. - Dropped GHC 7.10, it seems unsupportable without the inplace component inlining, possibly a Stack/lib:Cabal bug, but it is quite old so time for it to go anyway. This is the second thing commit it was holing up too!
* Fix ProjLoc to source directory correspondenceDaniel Gröber2019-09-171-13/+7
| | | | | We cannot always assume `takeDirectory cfg_file` will be the project source directory!
* Refactor ProjType to be more inductiveDaniel Gröber2019-09-171-0/+1
| | | | This allows discriminating Stack vs. Cabal at the type level more easily.
* Allow passing override-env to process functionsDaniel Gröber2019-09-171-9/+13
| | | | | Unfortunately we need this to pass a custom GHC executable path to stack, since it doesn't have an option to override it on the commandline (yet?).
* Merge CompPrograms back into ProgramsDaniel Gröber2019-09-171-11/+6
| | | | | We need to support passing down the path to ghc to new-build/stack in order to support using a non-default 'ghc' executable.
* Flesh out project discovery APIDaniel Gröber2019-09-171-1/+1
|
* Update API docs of main typesDaniel Gröber2019-09-171-7/+15
|
* Split SProjType along build-tool lineDaniel Gröber2019-09-171-12/+14
| | | | | | | This makes it much easier to deal with differences between the build tools as we can now have functions that only make sense for Cabal and statically enforce this by passing a 'SCabalProjType pt' as evidence that $pt \in {V1, V2}$.
* Support cabal-file not being in pkgdir with cabal-v1Daniel Gröber2019-09-171-3/+3
|
* Revert compilerVersion being project-scopeDaniel Gröber2019-05-271-6/+1
| | | | | Turns out the Setup header has the compiler version used to build Setup, not the version the project is configured to use.
* Fix QueryEnv not being compatible with ExDaniel Gröber2019-05-051-1/+2
|
* Fix getHelper ignoring withProgs environmentDaniel Gröber2019-04-011-4/+1
|
* Add ProjLocV1Dir for easier forward portingDaniel Gröber2019-04-011-7/+9
|
* Expose missing ChLibraryName in public APIDaniel Gröber2019-04-011-0/+1
|
* Make compilerVersion accessor project-scope for V1 projectsDaniel Gröber2019-04-011-9/+21
|
* Improve export list order for docsDaniel Gröber2019-03-311-1/+2
|
* Fix missing CompPrograms exportDaniel Gröber2019-03-311-1/+2
|
* Promote 'Ex' to exported APIDaniel Gröber2019-03-311-0/+1
| | | | We will need it for the project discovery module later.
* docsDaniel Gröber2019-03-291-5/+12
|
* Add demoteSProjTypeDaniel Gröber2019-02-111-0/+1
|
* Shortcut helper compilation when Cabal version is already availableDaniel Gröber2019-02-091-20/+29
| | | | | This is mostly an optimization for Nix which already sets up the environment correctly, so we should reward its users :)
* Add log-level to verbosity conditionalDaniel Gröber2019-01-301-6/+10
|
* Fix ghc-pkg guessing logic when using v2-installDaniel Gröber2019-01-301-5/+7
|
* Fix getHelperExe not using correct stack programsLuke Lau2019-01-261-39/+42
| | | | | In turn fixes errors when building cabal-helper exe for stack projects where the resolver uses a different ghc version than system.
* Add support and test coverage for mulit-pkg projectsDaniel Gröber2019-01-261-39/+67
|
* CommentsDaniel Gröber2019-01-221-5/+4
| | | | [ci skip]
* Reintroduce type conventions: s/proj_type/pt/ s/cache/c/Daniel Gröber2019-01-221-0/+15
|
* Fix warningDaniel Gröber2019-01-221-1/+1
|