summaryrefslogtreecommitdiff
path: root/utils
Commit message (Collapse)AuthorAgeFilesLines
* hpc: Output a legend at the top of output filesSantiago Munin2017-05-041-0/+7
| | | | | | | | | | | | Updates hpc submodule. Reviewers: austin, bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #11799 Differential Revision: https://phabricator.haskell.org/D3465
* Prefer #if defined to #ifdefBen Gamari2017-04-289-66/+66
| | | | Our new CPP linter enforces this.
* Bump process to 1.6Ben Gamari2017-04-272-2/+2
| | | | Also bumps Cabal submodule due to version bound bump.
* Update Cabal submodule, with necessary wibbles.Edward Z. Yang2017-04-262-10/+4
| | | | | | | | | | | | Test Plan: validate Reviewers: bgamari, austin Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3501
* Update hsc2hs submodule to 0.68.2Ben Gamari2017-04-261-0/+0
|
* cpp: Use #pragma once instead of #ifndef guardsBen Gamari2017-04-2321-84/+21
| | | | | | | | | | | | | | This both says what we mean and silences a bunch of spurious CPP linting warnings. This pragma is supported by all CPP implementations which we support. Reviewers: austin, erikd, simonmar, hvr Reviewed By: simonmar Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3482
* Haddock submodule update.Edward Z. Yang2017-04-221-0/+0
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* utils/debugNCG: remove old toolSergei Trofimovich2017-04-213-445/+0
| | | | | | | | | | | | Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Reviewers: simonmar, austin, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3476
* cross-build 'unlit' and 'hp2ps' for stage2 installSergei Trofimovich2017-04-082-3/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | In navive build case it does not matter much if we build 'unlit' and 'hp2ps' tools with ghc-stage0 or ghc-stage1: both GHCs are native compilers and both tools are written in C (have no haskell code). But in cross-case the difference is substantial: In Stag1Only=YES case we need to install native tools built by ghc-stage0/${host}-cc. In Stag1Only=NO case we need to install cross-built tools built by ghc-stage1/${target}-cc. Before this change GHC did not have a rule to build cross-built 'unlit' and 'hp2ps'. The change adds cross-built 'unlit' and 'hp2ps' as 'dist-install' targets. 'inplace/lib/bin/unlit.bin' target is unchanged and still contains native binary. As a result this change allows cross-building and packaging whole GHC for target platform! Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* fix 'make install' for cross-stage2Sergei Trofimovich2017-04-081-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When cross-built GHC is being installed one of latest steps is to register installed libraries with 'ghc-pkg'. GHC uses freshly installed 'ghc-pkg' and 'ghc-stage2' for that. Tested as: ./configure --target=aarch64-unknown-linux-gnu make install DESTDIR=$(pwd)/__s2 STRIP_CMD=: Before the change install failed on ghc-pkg execution phase: ".../ghc-cross/__s2/usr/local/lib/ghc-8.3.20170406/bin/ghc-pkg" \ --force \ --global-package-db \ ".../ghc-cross/__s2/usr/local/lib/ghc-8.3.20170406/package.conf.d" \ update rts/dist/package.conf.install /bin/sh: .../ghc-cross/__s2/usr/local/lib/ghc-8.3.20170406/bin/ghc-pkg: \ No such file or directory To avoid breakage we use 'ghc' and 'ghc-pkg' built by stage0. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Test Plan: run 'make install' on stage2 crosscompiler Reviewers: rwbarton, austin, bgamari Subscribers: thomie, snowleopard Differential Revision: https://phabricator.haskell.org/D3432
* add $(CrossCompilePrefix) to 'runghc' and 'ghci'Sergei Trofimovich2017-04-061-5/+5
| | | | | | | | | | When Stage1Only=YES install mode is used one of rare tools that lack $(CrossCompilePrefix) prefix are 'runghc' and 'ghci'. This causes file collisions when multiple GHC crosscompilers are installed in system. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* hp2ps: install shell wrapperSergei Trofimovich2017-04-032-2/+5
| | | | | | | | | | | | | | | | | | Before this change we installed hp2ps both to inplace/bin/ and ${prefix}/bin/ In both cases we added $(CrossCompilePrefix) as a binary prefix. It's incorrect for inplace install as none of inplace binaries are prefixed. The change it to track 'hp2ps' as unprefixed binary. $(CrossCompilePrefix) prefix is only added to the installed shell wrapper. Now 'hp2ps' is handled in a similar way to 'hpc' and 'ghc-pkg'. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* Show valid substitutions for typed holesMatthías Páll Gissurarson2017-03-291-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea is to implement a mechanism similar to PureScript, where they suggest which identifiers in scope would fit the given hole. In PureScript, they use subsumption (which is what we would like here as well). For subsumption, we would have to check each type in scope whether the hole is a subtype of the given type, but that would require `tcSubType` and constraint satisfiability checking. Currently, `TcSimplify` uses a lot of functions from `TcErrors`, so that would require more of a rewrite, I will hold on with that for now, and submit the more simpler type equality version. As an example, consider ``` ps :: String -> IO () ps = putStrLn ps2 :: a -> IO () ps2 _ = putStrLn "hello, world" main :: IO () main = _ "hello, world" ``` The results would be something like ``` • Found hole: _ :: [Char] -> IO () • In the expression: _ In a stmt of a 'do' block: _ "hello, world" In the expression: do _ "hello, world" • Relevant bindings include main :: IO () (bound at test.hs:13:1) ps :: String -> IO () (bound at test.hs:7:1) ps2 :: forall a. a -> IO () (bound at test.hs:10:1) Valid substitutions include putStrLn :: String -> IO () (imported from ‘Prelude’ at test.hs:1:1-14 (and originally defined in ‘System.IO’)) putStr :: String -> IO () (imported from ‘Prelude’ at test.hs:1:1-14 (and originally defined in ‘System.IO’)) ``` We'd like here for ps2 to be suggested as well, but for that we require subsumption. Reviewers: austin, bgamari, dfeuer, mpickering Reviewed By: dfeuer, mpickering Subscribers: mpickering, Wizek, dfeuer, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3361
* Bump haddock submoduleBen Gamari2017-03-231-0/+0
|
* Haddock submodule update.Edward Z. Yang2017-03-221-0/+0
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* mkUserGuidePart: Remove duplicate -XDeriveGeneric entryÖmer Sinan Ağacan2017-03-201-7/+0
|
* Save renamed syntax when signature merging.Edward Z. Yang2017-03-171-0/+0
| | | | | | | | | | | | | | | | | Summary: This is required to make Haddock work correctly. Comes with a Haddock submodule update for better rendering. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: bgamari, austin Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3335
* Bump hsc2hs submoduleBen Gamari2017-03-151-0/+0
|
* Bump hsc2hs submoduleBen Gamari2017-03-151-0/+0
| | | | | Fixes #13388. Also updates the expected output for T12504, which previously contained a redundant LINE pragma.
* Introduce and use EnumSet in DynFlagsBen Gamari2017-03-151-0/+0
| | | | | | | | | | | | | | | This factors out a repeated pattern found in DynFlags, where we use an IntSet and Enum to represent sets of flags. Requires bump of haddock submodule. Test Plan: validate Reviewers: austin, goldfire Subscribers: rwbarton, thomie, snowleopard Differential Revision: https://phabricator.haskell.org/D3331
* Fix #13337.Richard Eisenberg2017-03-141-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The big change is the introduction of solveSomeEqualities. This is just like solveEqualities, but it doesn't fail if there are unsolved equalities when it's all done. Anything unsolved is re-emitted. This is appropriate if we are not kind-generalizing, so this new form is used when decideKindGeneralizationPlan says not to. We initially thought that any use of solveEqualities would be tied to kind generalization, but this isn't true. For example, we need to solveEqualities a bunch in the "tc" pass in TcTyClsDecls (which is really desugaring). These equalities are all surely going to be soluble (if they weren't the "kc" pass would fail), but we still need to solve them again. Perhaps if the "kc" pass produced type- checked output that is then desugared, solveEqualities really would be tied only to kind generalization. Updates haddock submodule. Test Plan: ./validate, typecheck/should_compile/T13337 Reviewers: simonpj, bgamari, austin Reviewed By: simonpj Subscribers: RyanGlScott, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3315
* Add `-fmax-errors` flagCharles Cooper2017-03-132-7/+13
| | | | | | | | | | | | | | | | This commit adds a command line option to limit the number of errors displayed. It also moves the documentation for `reverse-errors` into the `Warnings` section. https://ghc.haskell.org/trac/ghc/ticket/13326 Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3323
* unlit: replace the SHEBANG with an empty linePhil Ruffwind2017-03-131-0/+3
| | | | | | | | | | | | | | | This corrects the line numbers for literate code after a shebang. Fixes #13414. Test Plan: validate Reviewers: austin, bgamari, trofi Reviewed By: bgamari, trofi Subscribers: trofi, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3333
* configure.ac: Bump version to 8.3ghc-8.3-startBen Gamari2017-03-091-0/+0
| | | | Bumps haddock submodule
* ghc-pkg: Consider .conf files when computing package db mtimeAndrzej Rybczak2017-03-071-64/+21
| | | | | | | | | | | | | | | We can no longer use the mtime of the containing directory since it now contains a lock file in addition to the .cache and .conf files. Fixes #13375. Test Plan: Validate on Windows Reviewers: austin, arybczak Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3289
* Typos in comments and manualGabor Greif2017-03-061-1/+1
|
* Drop HAVE_containers_050 from bootstrap flagsBen Gamari2017-03-041-1/+0
| | | | Cabal now sets this itself if MIN_VERSION_containers isn't defined.
* Print out sub-libraries of packages more nicely.Edward Z. Yang2017-03-021-2/+13
| | | | | | | | | | | | | | | | | | Previously, we would print out the munged package name which looked like z-bkpcabal01-z-p-0.1.0.0. Now it looks like: bkpcabal01-0.1.0.0:p. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, bgamari, austin Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3235
* Properly acquire locks on not yet existing package databasesAndrzej Rybczak2017-03-021-8/+15
| | | | | | | | | | Reviewers: austin, bgamari, angerman Reviewed By: bgamari, angerman Subscribers: angerman, thomie Differential Revision: https://phabricator.haskell.org/D3259
* Add flag allowing convenient disabling of terminfo supportBen Gamari2017-02-283-4/+23
| | | | | | | | | | | | | This is a common thing that users who cross-compile must fight against. It turns out that it's pretty straightforward to make is convenient. Test Plan: Cross compile without a target `ncurses` available Reviewers: danharaj, hvr, erikd, austin, rwbarton Subscribers: rwbarton, thomie, snowleopard Differential Revision: https://phabricator.haskell.org/D3177
* Add support for concurrent package db access and updatesAndrzej Rybczak2017-02-261-131/+259
| | | | | | | | | | Trac issues: #13194 Reviewers: austin, hvr, erikd, bgamari, dfeuer, duncan Subscribers: DemiMarie, dfeuer, thomie Differential Revision: https://phabricator.haskell.org/D3090
* Update OverloadedLabels docs and document HasFieldAdam Gundry2017-02-261-0/+7
| | | | | | | | | | | | Test Plan: n/a Reviewers: bgamari, austin Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3144
* Correct Windows libdir assumptions.Tamar Christina2017-02-231-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GHC and ghc-pkg make some pretty hard assumptions about where they're running on Windows. They assume that they are always running from `foo/bin/ghc.exe` and that to find the `lib` folder they can drop `bin/ghc.exe` from the base path and append `lib`. This is already false for the testsuite, which when testing thenbindist has one test which puts the binaries in `inplace/test spaces`. For some reason before this was either being skipped or mysteriously passing. But as of `2017.02.11` our luck ran out. the testsuite triggers a failure such as those in #13310 Let's soften the assumption and just check that `../lib` exists instead. 80 chars Test Plan: ./validate Reviewers: austin, erikd, bgamari Reviewed By: bgamari Subscribers: thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D3158
* Bump Cabal submoduleBen Gamari2017-02-205-6/+5
| | | | We are now tracking the 2.0 branch.
* Tweaks and typos in manual, note refs, commentsGabor Greif2017-02-091-1/+1
|
* Remove unnecessary use of -DGENERICS flagRyan Scott2017-02-061-1/+1
| | | | | This flag was only needed for old versions of binary, and now that we've upgraded to binary-0.8.4.1, it is no longer necessary.
* Fix comment (old file names) in mk/ and utils/Takenobu Tani2017-02-042-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | There ware some old file names (.lhs, ...) at comments. * mk/config.mk.in - compiler/hsSyn/HsExpr.lhs -> HsExpr.hs * utils/ghc-pkg/Main.hs - compiler/main/Packages.lhs -> Packages.hs * utils/genapply/Main.hs - CgRetConv.lhs -> * REMOVE THIS COMMENT (OLDER FILE THAN GHC6) * - Constants.lhs -> Constants.hs - compiler/codeGen/CgCallConv.lhs -> compiler/codeGen/StgCmmLayout.hs - Apply.hc -> Apply.cmm - HeapStackCheck.hc -> HeapStackCheck.cmm Reviewers: mpickering, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3077
* Ditch static flagsSylvain Henry2017-02-021-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch converts the 4 lasting static flags (read from the command line and unsafely stored in immutable global variables) into dynamic flags. Most use cases have been converted into reading them from a DynFlags. In cases for which we don't have easy access to a DynFlags, we read from 'unsafeGlobalDynFlags' that is set at the beginning of each 'runGhc'. It's not perfect (not thread-safe) but it is still better as we can set/unset these 4 flags before each run when using GHC API. Updates haddock submodule. Rebased and finished by: bgamari Test Plan: validate Reviewers: goldfire, erikd, hvr, austin, simonmar, bgamari Reviewed By: simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2839 GHC Trac Issues: #8440
* Spelling fixesGabor Greif2017-02-022-4/+4
|
* Bump hsc2hs submoduleBen Gamari2017-01-261-0/+0
|
* Make type import/export API Annotation friendlyAlan Zimmerman2017-01-262-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: At the moment an export of the form type C(..) is parsed by the rule ``` | 'type' oqtycon {% amms (mkTypeImpExp (sLL $1 $> (unLoc $2))) [mj AnnType $1,mj AnnVal $2] } ``` This means that the origiinal oqtycon loses its location which is then retained in the AnnVal annotation. The problem is if the oqtycon has its own annotations, these get lost. e.g. in type (?)(..) the parens annotations for (?) get lost. This patch adds a wrapper around the name in the IE type to (a) provide a distinct location for the adornment annotation and (b) identify the specific adornment, for use in the pretty printer rather than occName magic. Updates haddock submodule Test Plan: ./validate Reviewers: mpickering, dfeuer, bgamari, austin Reviewed By: dfeuer Subscribers: dfeuer, thomie, mpickering Differential Revision: https://phabricator.haskell.org/D3016 GHC Trac Issues: #13163
* Warn on missing home modulesYuras Shumovich2017-01-201-0/+9
| | | | | | | | | | | | | | | | | | | | Introduce a warning, -Wmissing-home-modules, to warn about home modules, not listed in command line. It is usefull for cabal when user fails to list a module in `exposed-modules` and `other-modules`. Test Plan: make TEST=MissingMod Reviewers: mpickering, austin, bgamari Reviewed By: bgamari Subscribers: simonpj, mpickering, thomie Differential Revision: https://phabricator.haskell.org/D2977 GHC Trac Issues: #13129
* Update levity polymorphismRichard Eisenberg2017-01-191-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit implements the proposal in https://github.com/ghc-proposals/ghc-proposals/pull/29 and https://github.com/ghc-proposals/ghc-proposals/pull/35. Here are some of the pieces of that proposal: * Some of RuntimeRep's constructors have been shortened. * TupleRep and SumRep are now parameterized over a list of RuntimeReps. * This means that two types with the same kind surely have the same representation. Previously, all unboxed tuples had the same kind, and thus the fact above was false. * RepType.typePrimRep and friends now return a *list* of PrimReps. These functions can now work successfully on unboxed tuples. This change is necessary because we allow abstraction over unboxed tuple types and so cannot always handle unboxed tuples specially as we did before. * We sometimes have to create an Id from a PrimRep. I thus split PtrRep * into LiftedRep and UnliftedRep, so that the created Ids have the right strictness. * The RepType.RepType type was removed, as it didn't seem to help with * much. * The RepType.repType function is also removed, in favor of typePrimRep. * I have waffled a good deal on whether or not to keep VoidRep in TyCon.PrimRep. In the end, I decided to keep it there. PrimRep is *not* represented in RuntimeRep, and typePrimRep will never return a list including VoidRep. But it's handy to have in, e.g., ByteCodeGen and friends. I can imagine another design choice where we have a PrimRepV type that is PrimRep with an extra constructor. That seemed to be a heavier design, though, and I'm not sure what the benefit would be. * The last, unused vestiges of # (unliftedTypeKind) have been removed. * There were several pretty-printing bugs that this change exposed; * these are fixed. * We previously checked for levity polymorphism in the types of binders. * But we also must exclude levity polymorphism in function arguments. This is hard to check for, requiring a good deal of care in the desugarer. See Note [Levity polymorphism checking] in DsMonad. * In order to efficiently check for levity polymorphism in functions, it * was necessary to add a new bit of IdInfo. See Note [Levity info] in IdInfo. * It is now safe for unlifted types to be unsaturated in Core. Core Lint * is updated accordingly. * We can only know strictness after zonking, so several checks around * strictness in the type-checker (checkStrictBinds, the check for unlifted variables under a ~ pattern) have been moved to the desugarer. * Along the way, I improved the treatment of unlifted vs. banged * bindings. See Note [Strict binds checks] in DsBinds and #13075. * Now that we print type-checked source, we must be careful to print * ConLikes correctly. This is facilitated by a new HsConLikeOut constructor to HsExpr. Particularly troublesome are unlifted pattern synonyms that get an extra void# argument. * Includes a submodule update for haddock, getting rid of #. * New testcases: typecheck/should_fail/StrictBinds typecheck/should_fail/T12973 typecheck/should_run/StrictPats typecheck/should_run/T12809 typecheck/should_fail/T13105 patsyn/should_fail/UnliftedPSBind typecheck/should_fail/LevPolyBounded typecheck/should_compile/T12987 typecheck/should_compile/T11736 * Fixed tickets: #12809 #12973 #11736 #13075 #12987 * This also adds a test case for #13105. This test case is * "compile_fail" and succeeds, because I want the testsuite to monitor the error message. When #13105 is fixed, the test case will compile cleanly.
* Add dump-parsed-ast flag and functionalityAlan Zimmerman2017-01-151-135/+3
| | | | | | | | | | | | | | | | | | Summary: This flag causes a dump of the ParsedSource as an AST in textual form, similar to the ghc-dump-tree on hackage. Test Plan: ./validate Reviewers: mpickering, bgamari, austin Reviewed By: mpickering Subscribers: nominolo, thomie Differential Revision: https://phabricator.haskell.org/D2958 GHC Trac Issues: #11140
* Require python3 like everywhere else tooGabor Greif2017-01-131-1/+1
|
* Ensure mkUserGuidePart is compiled with current GHC versionBen Gamari2017-01-101-2/+6
|
* Make HsIParamTy have a Located HsIPNameAlan Zimmerman2017-01-101-0/+0
| | | | | | To simplify API Annotations. Updates haddock submodule
* Remove redudant import from check-pprMatthew Pickering2016-12-261-1/+0
|
* check-ppr: Make --dump the default behaviorBen Gamari2016-12-261-11/+6
|
* Add caret diagnosticsPhil Ruffwind2016-12-231-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | This is controlled by -f[no-]diagnostics-show-caret. Example of what it looks like: ``` | 42 | x = 1 + () | ^^^^^^ ``` This is appended to each diagnostic message. Test Plan: testsuite/tests/warnings/should_fail/CaretDiagnostics1 testsuite/tests/warnings/should_fail/CaretDiagnostics2 Reviewers: simonpj, austin, bgamari Reviewed By: simonpj, bgamari Subscribers: joehillen, mpickering, Phyx, simonpj, alanz, thomie Differential Revision: https://phabricator.haskell.org/D2718 GHC Trac Issues: #8809