[Git][ghc/ghc][wip/toolchain-selection] 46 commits: Configure CPP into settings
Rodrigo Mesquita (@alt-romes)
gitlab at gitlab.haskell.org
Tue Jun 6 07:15:43 UTC 2023
Rodrigo Mesquita pushed to branch wip/toolchain-selection at Glasgow Haskell Compiler / GHC
Commits:
417c37e0 by Rodrigo Mesquita at 2023-05-30T16:59:28+01:00
Configure CPP into settings
There is a distinction to be made between the Haskell Preprocessor and
the C preprocessor. The former is used to preprocess Haskell files,
while the latter is used in C preprocessing such as Cmm files.
In practice, they are both the same program (usually the C compiler) but
invoked with different flags.
Previously we would, at configure time, configure the haskell
preprocessor and save the configuration in the settings file, but,
instead of doing the same for CPP, we had hardcoded in GHC that the CPP
program was either `cc -E` or `cpp`.
This commit fixes that asymmetry by also configuring CPP at configure
time, and tries to make more explicit the difference between HsCpp and
Cpp (see Note [Preprocessing invocations]).
Note that we don't use the standard CPP and CPPFLAGS to configure Cpp,
but instead use the non-standard --with-cpp and --with-cpp-flags.
The reason is that autoconf sets CPP to "$CC -E", whereas we expect the
CPP command to be configured as a standalone executable rather than a
command. These are symmetrical with --with-hs-cpp and
--with-hs-cpp-flags.
Cleanup: Hadrian no longer needs to pass the CPP configuration for CPP
to be C99 compatible through -optP, since we now configure that
into settings.
Closes #23422
- - - - -
746203e0 by Ben Gamari at 2023-05-30T20:10:29+01:00
configure: Rip out Solaris dyld check
Solaris 11 was released over a decade ago and, moreover, I doubt we have
any Solaris users
- - - - -
1bf764ec by hainq at 2023-06-06T08:15:22+01:00
Migrate errors in GHC.Tc.Validity
This patch migrates the error messages in GHC.Tc.Validity to use
the new diagnostic infrastructure.
It adds the constructors:
- TcRnSimplifiableConstraint
- TcRnArityMismatch
- TcRnIllegalInstanceDecl, with sub-datatypes for HasField errors
and fundep coverage condition errors.
- - - - -
3d83ab77 by Krzysztof Gogolewski at 2023-06-06T08:15:22+01:00
linear lint: Add missing processing of DEFAULT
In this correct program
f :: a %1 -> a
f x = case x of x { _DEFAULT -> x }
after checking the alternative we weren't popping the case binder 'x'
from the usage environment, which meant that the lambda-bound 'x'
was counted twice: in the scrutinee and (incorrectly) in the alternative.
In fact, we weren't checking the usage of 'x' at all.
Now the code for handling _DEFAULT is similar to the one handling
data constructors.
Fixes #23025.
- - - - -
b699578a by Matthew Pickering at 2023-06-06T08:15:22+01:00
Remove outdated "Don't check hs-boot type family instances too early" note
This note was introduced in 25b70a29f623 which delayed performing some
consistency checks for type families. However, the change was reverted
later in 6998772043a7f0b0360116eb5ffcbaa5630b21fb but the note was not
removed.
I found it confusing when reading to code to try and work out what
special behaviour there was for hs-boot files (when in-fact there isn't
any).
- - - - -
e7095cd9 by Matthew Pickering at 2023-06-06T08:15:22+01:00
rts: Define ticky macro stubs
These macros have long been undefined which has meant we were missing
reporting these allocations in ticky profiles.
The most critical missing definition was TICK_ALLOC_HEAP_NOCTR which was
missing all the RTS calls to allocate, this leads to a the overall
ALLOC_RTS_tot number to be severaly underreported.
Of particular interest though is the ALLOC_STACK_ctr and ALLOC_STACK_tot
counters which are useful to tracking stack allocations.
Fixes #23421
- - - - -
f89fa0b1 by Matthew Pickering at 2023-06-06T08:15:22+01:00
rts: ticky: Rename TICK_ALLOC_HEAP_NOCTR to TICK_ALLOC_RTS
This macro increments the ALLOC_HEAP_tot and ALLOC_HEAP_ctr so it makes
more sense to name it after that rather than the suffix NOCTR, whose
meaning has been lost to the mists of time.
- - - - -
260c77ff by Ben Gamari at 2023-06-06T08:15:23+01:00
users guide: A few small mark-up fixes
- - - - -
9b9415c1 by Rodrigo Mesquita at 2023-06-06T08:15:23+01:00
configure: Fix support check for response files.
In failing to escape the '-o' in '-o\nconftest\nconftest.o\n' argument
to printf, the writing of the arguments response file always failed.
The fix is to pass the arguments after `--` so that they are treated
positional arguments rather than flags to printf.
Closes #23435
- - - - -
3c2af048 by mangoiv at 2023-06-06T08:15:23+01:00
[feat] add .direnv to the .gitignore file
- - - - -
1b20a970 by Bodigrim at 2023-06-06T08:15:23+01:00
Add Data.List.unsnoc
See https://github.com/haskell/core-libraries-committee/issues/165 for discussion
- - - - -
ca3b3f1e by Bartłomiej Cieślar at 2023-06-06T08:15:23+01:00
Fix crash in backpack signature merging with -ddump-rn-trace
In some cases, backpack signature merging could crash in addUsedGRE
when -ddump-rn-trace was enabled, as pretty-printing the GREInfo would cause
unavailable interfaces to be loaded.
This commit fixes that issue by not pretty-printing the GREInfo in addUsedGRE
when -ddump-rn-trace is enabled.
Fixes #23424
Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com>
- - - - -
de5b548c by Krzysztof Gogolewski at 2023-06-06T08:15:23+01:00
Add a regression test for #13981
The panic was fixed by 6998772043a7f0b. Fixes #13981.
- - - - -
89061653 by Krzysztof Gogolewski at 2023-06-06T08:15:23+01:00
Add a test for #23355
It was fixed by !10061, so I'm adding it in the same group.
- - - - -
f53da0de by uhbif19 at 2023-06-06T08:15:23+01:00
Migrate errors in GHC.Rename.Splice GHC.Rename.Pat
This commit migrates the errors in GHC.Rename.Splice and GHC.Rename.Pat
to use the new diagnostic infrastructure.
- - - - -
691cd492 by sheaf at 2023-06-06T08:15:23+01:00
Common up Template Haskell errors in TcRnMessage
This commit commons up the various Template Haskell errors into a
single constructor, TcRnTHError, of TcRnMessage.
- - - - -
58fa623a by Krzysztof Gogolewski at 2023-06-06T08:15:23+01:00
Enable ghci tests for unboxed tuples
The tests were originally skipped because ghci used not to support
unboxed tuples/sums.
- - - - -
ca4b12d7 by Matthew Pickering at 2023-06-06T08:15:23+01:00
rts: Build ticky GHC with single-threaded RTS
The threaded RTS allows you to use ticky profiling but only for the
counters in the generated code. The counters used in the C portion of
the RTS are disabled. Updating the counters is also racy using the
threaded RTS which can lead to misleading or incorrect ticky results.
Therefore we change the hadrian flavour to build using the
single-threaded RTS (mainly in order to get accurate C code counter
increments)
Fixes #23430
- - - - -
8a138ad6 by sheaf at 2023-06-06T08:15:23+01:00
Propagate long-distance info in generated code
When desugaring generated pattern matches, we skip pattern match checks.
However, this ended up also discarding long-distance information, which
might be needed for user-written sub-expressions.
Example:
```haskell
okay (GADT di) cd =
let sr_field :: ()
sr_field = case getFooBar di of { Foo -> () }
in case cd of { SomeRec _ -> SomeRec sr_field }
```
With sr_field a generated FunBind, we still want to propagate the outer
long-distance information from the GADT pattern match into the checks
for the user-written RHS of sr_field.
Fixes #23445
- - - - -
0c70cfab by Matthew Pickering at 2023-06-06T08:15:23+01:00
Introduce GHCiMessage to wrap GhcMessage
By introducing a wrapped message type we can control how certain
messages are printed in GHCi (to add extra information for example)
- - - - -
5818ccc8 by Matthew Pickering at 2023-06-06T08:15:23+01:00
Generalise UnknownDiagnostic to allow embedded diagnostics to access
parent diagnostic options.
* Split default diagnostic options from Diagnostic class into
HasDefaultDiagnosticOpts class.
* Generalise UnknownDiagnostic to allow embedded diagnostics to access
options.
The principle idea here is that when wrapping an error message (such as
GHCMessage to make GHCiMessage) then we need to also be able to lift the
configuration when overriding how messages are printed (see load' for an
example).
- - - - -
1b9fa5d8 by Matthew Pickering at 2023-06-06T08:15:23+01:00
Allow API users to wrap error messages created during 'load'
This allows API users to configure how messages are rendered when they
are emitted from the load function. For an example see how
'loadWithCache' is used in GHCi.
- - - - -
32b07b52 by Matthew Pickering at 2023-06-06T08:15:23+01:00
Abstract cantFindError and turn Opt_BuildingCabal into a print-time option
* cantFindError is abstracted so that the parts which mention specific
things about ghc/ghci are parameters. The intention being that
GHC/GHCi can specify the right values to put here but otherwise
display the same error message.
* The BuildingCabalPackage argument from GenericMissing is removed and
turned into a print-time option. The reason for the error is not
dependent on whether `-fbuilding-cabal-package` is passed, so we don't
want to store that in the error message.
- - - - -
2af762d1 by Matthew Pickering at 2023-06-06T08:15:23+01:00
error messages: Don't display ghci specific hints for missing packages
Tickets like #22884 suggest that it is confusing that GHC used on the
command line can suggest options which only work in GHCi.
This ticket uses the error message infrastructure to override certain
error messages which displayed GHCi specific information so that this
information is only showed when using GHCi.
The main annoyance is that we mostly want to display errors in the same
way as before, but with some additional information. This means that the
error rendering code has to be exported from the Iface/Errors/Ppr.hs
module.
I am unsure about whether the approach taken here is the best or most
maintainable solution.
Fixes #22884
- - - - -
1189aacc by Matthew Pickering at 2023-06-06T08:15:23+01:00
ghcup-metadata: Don't override existing metadata if version already exists.
If a nightly pipeline runs twice for some reason for the same version
then we really don't want to override an existing entry with new
bindists. This could cause ABI compatability issues for users or break
ghcup's caching logic.
- - - - -
b744e3b8 by Matthew Pickering at 2023-06-06T08:15:23+01:00
ghcup-metadata: Use proper API url for bindist download
Previously we were using links from the web interface, but it's more
robust and future-proof to use the documented links to the artifacts.
https://docs.gitlab.com/ee/api/job_artifacts.html
- - - - -
6064b6e8 by Matthew Pickering at 2023-06-06T08:15:23+01:00
ghcup-metadata: Set Nightly and LatestNightly tags
The latest nightly release needs the LatestNightly tag, and all other
nightly releases need the Nightly tag. Therefore when the metadata is
updated we need to replace all LatestNightly with Nightly.`
- - - - -
602ef5ff by Matthew Pickering at 2023-06-06T08:15:23+01:00
ghcup-metadata: Download nightly metadata for correct date
The metadata now lives in https://gitlab.haskell.org/ghc/ghcup-metadata
with one metadata file per year. When we update the metadata we download
and update the right file for the current year.
- - - - -
b67989d5 by Matthew Pickering at 2023-06-06T08:15:23+01:00
ghcup-metadata: Download metadata and update for correct year
something about pipeline date
- - - - -
f650fa95 by Matthew Pickering at 2023-06-06T08:15:23+01:00
ghcup-metadata: Don't skip CI
On a push we now have a CI job which updates gitlab pages with the
metadata files.
- - - - -
29913d67 by Matthew Pickering at 2023-06-06T08:15:23+01:00
ghcup-metadata: Add --date flag to specify the release date
The ghcup-metadata now has a viReleaseDay field which needs to be
populated with the day of the release.
- - - - -
00cc82ff by Matthew Pickering at 2023-06-06T08:15:23+01:00
ghcup-metadata: Add dlOutput field
ghcup now requires us to add this field which specifies where it should
download the bindist to. See
https://gitlab.haskell.org/ghc/ghcup-metadata/-/issues/1 for some more
discussion.
- - - - -
3b5a0588 by Josh Meredith at 2023-06-06T08:15:23+01:00
JS: Convert rendering to use HLine instead of SDoc (#22455)
- - - - -
597248d3 by Norman Ramsey at 2023-06-06T08:15:23+01:00
testsuite: add WasmControlFlow test
This patch adds the WasmControlFlow test to test the wasm backend's
relooper component.
- - - - -
8843c682 by Sylvain Henry at 2023-06-06T08:15:23+01:00
Factorize getLinkDeps
Prepare reuse of getLinkDeps for TH implementation in the JS backend
(cf #22261 and review of !9779).
- - - - -
63f89325 by Oleg Grenrus at 2023-06-06T08:15:23+01:00
Change GHC.Driver.Session import to .DynFlags
Also move targetPlatform selector
Plenty of GHC needs just DynFlags.
Even more can be made to use .DynFlags if more selectors is migrated.
This is a low hanging fruit.
- - - - -
3f9895df by Alan Zimmerman at 2023-06-06T08:15:23+01:00
EPA: Better fix for #22919
The original fix for #22919 simply removed the ability to match up
prior comments with the first declaration in the file.
Restore it, but add a check that the comment is on a single line, by
ensuring that it comes immediately prior to the next thing (comment or
start of declaration), and that the token preceding it is not on the
same line.
closes #22919
- - - - -
ccd46b57 by Ben Gamari at 2023-06-06T08:15:23+01:00
Move via-C flags into GHC
These were previously hardcoded in configure (with no option for
overriding them) and simply passed onto ghc through the settings file.
Since configure already guarantees gcc supports those flags, we simply
move them into GHC.
- - - - -
d8e9c70b by Ben Gamari at 2023-06-06T08:15:24+01:00
ghc-toolchain: Initial commit
- - - - -
ab3c63e2 by Ben Gamari at 2023-06-06T08:15:24+01:00
Rip out runtime linker/compiler checks
- - - - -
df50a5ff by Ben Gamari at 2023-06-06T08:15:24+01:00
configure: Rip out toolchain selection logic
- - - - -
f5d35eab by Rodrigo Mesquita at 2023-06-06T08:15:24+01:00
ghc-toolchain: Toolchain Selection
ghc-toolchain: Rename readProcess to readProcessStdout
Fixes bugs regarding a translation from the original autconf program
that failed to account for the exit code.
The longer name reenforces that we really only care about the stdout,
and the exit code and stderr of the program are irrelevant for the case.
Fixes
Re-introduce ld-override option
ghc-toolchain library and usage in hadrian flags
Re-introduce flags in hadrian config
ghc-toolchain: UseLibFFI, LdCompactUnwind, LdFileList
A more complete ghc-toolchain.
Added configuration of:
* Use libffi for adjustors
* Supports compact unwind
* Supports filelist
Handle passing CPP cmd and flags from configure to ghc-toolchain
Rip more of configure that is no longer being used
Remove configure checks of GNUnoexecStack and ident directive
And fix bug in ghc-toolchain respective code
Rip out more from hadrians system.config.in
Configure CLink supports response files
Read deleted keys from host and target's target
Delete CMD_OPTS_STAGEX
Instead of having configure configure different options for different
programs depend on the stage, we delete this completely and have hadrian
select the correct target toolchain configuration file depending on the
stage, from which it can read those options.
Fix [host|target]-[os|arch] vs [host|target]-haskell-[os|arch]
Handle unspecified vs specified flags and commands better
Configure Cpp and HsCpp separately
Fixes for compilation
Link is GNU linkerg
Revert "Rip more of configure that is no longer being used"
I realized we still need this function in rts/configure.ac
This reverts commit 01f5d4b480f4ab1514ac0a4fc957db199d1a0279.
Revert get_arm_isa deletion from 74f03f243d08aa910d39cdd9dadb976e9386283a
As in the previous commit, we still need this info from the rts
configure script.
I suppose it could be useful for the rts to also read somehow the
toolchain information...
helper AC function for enable/disable
Delete unused imports of SysTools.Info
Drop PROG_CPP in distrib/autoconf too
Get rid of MonadCatch instances and dependencies
ghc-toolchain: Check Cc supports extra-via-c-flags
Consider empty programs as non-specified programs
Cpp and HsCpp cleanup
Add comment from check for gold t22266
Remove more settings bits from hadrian/cfg
Use llvm target from ghc-toolchain
Print default.target
Fix bugs in MergeTool and Ar
Add check and log errors on error
X
- - - - -
6686bc8b by Rodrigo Mesquita at 2023-06-06T08:15:24+01:00
configure: Revert ripping out of toolchain selection logic
- - - - -
7cc3bbdd by Rodrigo Mesquita at 2023-06-06T08:15:24+01:00
Stop configuring into settings unused Ld command
- - - - -
32161660 by Rodrigo Mesquita at 2023-06-06T08:15:24+01:00
configure: Create and validate toolchain target file
- - - - -
405d6909 by Rodrigo Mesquita at 2023-06-06T08:15:24+01:00
Fixes to match configure output
- - - - -
30 changed files:
- .gitignore
- .gitlab-ci.yml
- .gitlab/rel_eng/mk-ghcup-metadata/README.mkd
- .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py
- compiler/GHC/CmmToAsm.hs
- compiler/GHC/CmmToLlvm.hs
- compiler/GHC/CmmToLlvm/Base.hs
- compiler/GHC/Core/LateCC.hs
- compiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Opt/Pipeline.hs
- compiler/GHC/Core/Opt/SpecConstr.hs
- compiler/GHC/Core/Opt/Specialise.hs
- compiler/GHC/Core/UsageEnv.hs
- compiler/GHC/Driver/Backend.hs
- compiler/GHC/Driver/Backpack.hs
- compiler/GHC/Driver/CmdLine.hs
- compiler/GHC/Driver/CodeOutput.hs
- compiler/GHC/Driver/Config.hs
- compiler/GHC/Driver/Config/Cmm.hs
- compiler/GHC/Driver/Config/Cmm/Parser.hs
- compiler/GHC/Driver/Config/CmmToAsm.hs
- compiler/GHC/Driver/Config/CmmToLlvm.hs
- compiler/GHC/Driver/Config/Core/Lint.hs
- compiler/GHC/Driver/Config/Core/Lint/Interactive.hs
- compiler/GHC/Driver/Config/Core/Opt/Arity.hs
- compiler/GHC/Driver/Config/Core/Opt/LiberateCase.hs
- compiler/GHC/Driver/Config/Core/Opt/Simplify.hs
- compiler/GHC/Driver/Config/Core/Opt/WorkWrap.hs
- compiler/GHC/Driver/Config/Core/Rules.hs
- compiler/GHC/Driver/Config/CoreToStg.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/9ff922f1285285755797b2d3a3ba6d59690f62c9...405d69091b4fc4b4555ef827250afc20862980aa
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/9ff922f1285285755797b2d3a3ba6d59690f62c9...405d69091b4fc4b4555ef827250afc20862980aa
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230606/520646f6/attachment-0001.html>
More information about the ghc-commits
mailing list