[Git][ghc/ghc][wip/hadrian-cross-stage2] 74 commits: base: Advertise linear time of readFloat

Matthew Pickering (@mpickering) gitlab at gitlab.haskell.org
Tue Oct 3 09:26:36 UTC 2023



Matthew Pickering pushed to branch wip/hadrian-cross-stage2 at Glasgow Haskell Compiler / GHC


Commits:
7ca0240e by Ben Gamari at 2023-09-18T15:16:48-04:00
base: Advertise linear time of readFloat

As noted in #23538, `readFloat` has runtime that scales nonlinearly in
the size of its input. Consequently, its use on untrusted input can
be exploited as a denial-of-service vector. Point this out and suggest
use of `read` instead.

See #23538.

- - - - -
f3f58f13 by Simon Peyton Jones at 2023-09-18T15:17:24-04:00
Remove dead code GHC.CoreToStg.Prep.canFloat

This function never fires, so we can delete it: #23965.

- - - - -
ccab5b15 by Ben Gamari at 2023-09-18T15:18:02-04:00
base/changelog: Move fix for #23907 to 9.8.1 section

Since the fix was backported to 9.8.1

- - - - -
51b57d65 by Matthew Pickering at 2023-09-19T08:44:31-04:00
Add aarch64 alpine bindist

This is dynamically linked and makes creating statically linked
executables more straightforward.

Fixes #23482

- - - - -
02c87213 by Matthew Pickering at 2023-09-19T08:44:31-04:00
Add aarch64-deb11 bindist

This adds a debian 11 release job for aarch64.

Fixes #22005

- - - - -
8b61dfd6 by Alexis King at 2023-09-19T08:45:13-04:00
Don’t store the async exception masking state in CATCH frames

- - - - -
86d2971e by doyougnu at 2023-09-19T19:08:19-04:00
compiler,ghci: error codes link to HF error index

closes: #23259

- adds -fprint-error-index-links={auto|always|never} flag

- - - - -
5f826c18 by sheaf at 2023-09-19T19:09:03-04:00
Pass quantified tyvars in tcDefaultAssocDecl

This commit passes the correct set of quantified type variables written
by the user in associated type default declarations for validity
checking. This ensures that validity checking of associated type defaults
mirrors that of standalone type family instances.

Fixes #23768 (see testcase T23734 in subsequent commit)

- - - - -
aba18424 by sheaf at 2023-09-19T19:09:03-04:00
Avoid panic in mkGADTVars

This commit avoids panicking in mkGADTVars when we encounter
a type variable as in #23784 that is bound by a user-written
forall but not actually used.

Fixes #23784

- - - - -
a525a92a by sheaf at 2023-09-19T19:09:03-04:00
Adjust reporting of unused tyvars in data FamInsts

This commit adjusts the validity checking of data family
instances to improve the reporting of unused type variables.

See Note [Out of scope tvs in data family instances] in GHC.Tc.Validity.

The problem was that, in a situation such as

  data family D :: Type
  data instance forall (d :: Type). D = MkD

the RHS passed to 'checkFamPatBinders' would be the TyCon app

  R:D d

which mentions the type variable 'd' quantified in the user-written
forall. Thus, when computing the set of unused type variables in
the RHS of the data family instance, we would find that 'd' is used,
and report a strange error message that would say that 'd' is not
bound on the LHS.

To fix this, we special-case the data-family instance case,
manually extracting all the type variables that appear in the
arguments of all the data constructores of the data family instance.

Fixes #23778

- - - - -
28dd52ee by sheaf at 2023-09-19T19:09:03-04:00
Unused tyvars in FamInst: only report user tyvars

This commit changes how we perform some validity checking for
coercion axioms to mirror how we handle default declarations for
associated type families. This allows us to keep track of whether
type variables in type and data family instances were user-written
or not, in order to only report the user-written ones in
"unused type variable" error messages.

Consider for example:

  {-# LANGUAGE PolyKinds #-}
  type family F
  type instance forall a. F = ()

In this case, we get two quantified type variables,
(k :: Type) and (a :: k); the second being user-written, but the first
is introduced by the typechecker. We should only report 'a' as being
unused, as the user has no idea what 'k' is.

Fixes #23734

- - - - -
1eed645c by sheaf at 2023-09-19T19:09:03-04:00
Validity: refactor treatment of data families

This commit refactors the reporting of unused type variables in type
and data family instances to be more principled. This avoids ad-hoc
logic in the treatment of data family instances.

- - - - -
35bc506b by John Ericson at 2023-09-19T19:09:40-04:00
Remove `ghc-cabal`

It is dead code since the Make build system was removed.

I tried to go over every match of `git grep -i ghc-cabal` to find other
stray bits. Some of those might be workarounds that can be further
removed.

- - - - -
665ca116 by John Paul Adrian Glaubitz at 2023-09-19T19:10:39-04:00
Re-add unregisterised build support for sparc and sparc64

Closes #23959

- - - - -
142f8740 by Matthew Pickering at 2023-09-19T19:11:16-04:00
Bump ci-images to use updated version of Alex

Fixes #23977

- - - - -
fa977034 by John Ericson at 2023-09-21T12:55:25-04:00
Use Cabal 3.10 for Hadrian

We need the newer version for `CABAL_FLAG_*` env vars for #17191.

- - - - -
a5d22cab by John Ericson at 2023-09-21T12:55:25-04:00
hadrian: `need` any `configure` script we will call

When the script is changed, we should reconfigure.

- - - - -
db882b57 by John Ericson at 2023-09-21T12:55:25-04:00
hadrian: Make it easier to debug Cabal configure

Right now, output is squashed. This make per-package configure scripts
extremely hard to maintain, because we get vague "library is missing"
errors when the actually probably is usually completely unrelated except
for also involving the C/C++ toolchain.

(I can always pass `-VVV` to Hadrian locally, but these errors are
subtle and I often cannot reproduce them locally!)

`--disable-option-checking` was added back in
75c6e0684dda585c37b4ac254cd7a13537a59a91 but seems to be a bit overkill;
if other flags are passed that are not recognized behind the two from
Cabal mentioned in the former comment, we *do* want to know about it.

- - - - -
7ed65f5a by John Ericson at 2023-09-21T12:55:25-04:00
hadrian: Increase verbosity of certain cabal commands

This is a hack to get around the cabal function we're calling
*decreasing* the verbosity it passes to another function, which is the
stuff we often actually care about. Sigh.

Keeping this a separate commit so if this makes things too verbose it is
easy to revert.

- - - - -
a4fde569 by John Ericson at 2023-09-21T12:55:25-04:00
rts: Move most external symbols logic to the configure script

This is much more terse because we are programmatically handling the
leading underscore.

`findPtr` however is still handled in the Cabal file because we need a
newer Cabal to pass flags to the configure script automatically.

Co-Authored-By: Ben Gamari <ben at well-typed.com>

- - - - -
56cc85fb by Andrew Lelechenko at 2023-09-21T12:56:21-04:00
Bump Cabal submodule to allow text-2.1 and bytestring-0.12

- - - - -
0cd6148c by Matthew Pickering at 2023-09-21T12:56:21-04:00
hadrian: Generate Distribution/Fields/Lexer.x before creating a source-dist

- - - - -
b10ba6a3 by Andrew Lelechenko at 2023-09-21T12:56:21-04:00
Bump hadrian's index-state to upgrade alex at least to 3.2.7.3

- - - - -
11ecc37b by Luite Stegeman at 2023-09-21T12:57:03-04:00
JS: correct file size and times

Programs produced by the JavaScript backend were returning
incorrect file sizes and modification times, causing cabal
related tests to fail.

This fixes the problem and adds an additional test that verifies
basic file information operations.

fixes #23980

- - - - -
b35fd2cd by Ben Gamari at 2023-09-21T12:57:39-04:00
gitlab-ci: Drop libiserv from upload_ghc_libs

libiserv has been merged into the ghci package.

- - - - -
37ad04e8 by Ben Gamari at 2023-09-21T12:58:15-04:00
testsuite: Fix Windows line endings

- - - - -
5795b365 by Ben Gamari at 2023-09-21T12:58:15-04:00
testsuite: Use makefile_test

- - - - -
15118740 by Ben Gamari at 2023-09-21T12:58:55-04:00
system-cxx-std-lib: Add license and description
- - - - -
0208f1d5 by Ben Gamari at 2023-09-21T12:59:33-04:00
gitlab/issue-templates: Rename bug.md -> default.md

So that it is visible by default.

- - - - -
23cc3f21 by Andrew Lelechenko at 2023-09-21T20:18:11+01:00
Bump submodule text to 2.1

- - - - -
b8e4fe23 by Andrew Lelechenko at 2023-09-22T20:05:05-04:00
Bump submodule unix to 2.8.2.1

- - - - -
54b2016e by John Ericson at 2023-09-23T11:40:41-04:00
Move lib{numa,dw} defines to RTS configure

Clean up the m4 to handle the auto case always and be more consistent.
Also simplify the CPP --- we should always have both headers if we are
using libnuma.

"side effects" (AC_DEFINE, and AC_SUBST) are removed from the macros to
better separate searching from actions taken based on search results.
This might seem overkill now, but will make shuffling logic between
configure scripts easier later.

The macro comments are converted from `dnl` to `#` following the
recomendation in
https://www.gnu.org/software/autoconf/manual/autoconf-2.71/html_node/Macro-Definitions.html

- - - - -
d51b601b by John Ericson at 2023-09-23T11:40:50-04:00
Shuffle libzstd configuring between scripts

Like the prior commit for libdw and libnuma, `AC_DEFINE` to RTS
configure, `AC_SUBST` goes to the top-level configure script, and the
documentation of the m4 macro is improved.

- - - - -
d1425af0 by John Ericson at 2023-09-23T11:41:03-04:00
Move `FP_ARM_OUTLINE_ATOMICS` to RTS configure

It is just `AC_DEFINE` it belongs there instead.

- - - - -
18de37e4 by John Ericson at 2023-09-23T11:41:03-04:00
Move mmap in the runtime linker check to the RTS configure

`AC_DEFINE` should go there instead.

- - - - -
74132c2b by Andrew Lelechenko at 2023-09-25T21:56:54-04:00
Elaborate comment on GHC_NO_UNICODE

- - - - -
8376424c by John Ericson at 2023-09-26T10:20:49-04:00
RTS configure: Move over mem management checks

These are for heap allocation, a strictly RTS concern.

All of this should boil down to `AC_DEFINE` not `AC_SUBST`, so it
belongs in the RTS configure and should be safe to move without
modification.

The RTS configure one has a new
```
AC_CHECK_SIZEOF([void *])
```
that the top-level configure version didn't have, so that
`ac_cv_sizeof_void_p` is defined. Once more code is moved over in latter
commits, that can go away.

Progress towards #17191

- - - - -
da2aef77 by John Ericson at 2023-09-26T10:21:05-04:00
RTS configure: Move over `__thread` check

This used by (@bgamari thinks) the `GCThread` abstraction in the RTS.

All of this should boil down to `AC_DEFINE` not `AC_SUBST`, so it
belongs in the RTS configure and should be safe to move without
modification.

Progress towards #17191

- - - - -
7cb2985c by John Ericson at 2023-09-26T10:21:41-04:00
RTS configure: Move over misc function checks

These are for general use in the RTS.

All of this should boil down to `AC_DEFINE` not `AC_SUBST`, so it
belongs in the RTS configure and should be safe to move without
modification.

Progress towards #17191

- - - - -
d07c237b by John Ericson at 2023-09-26T10:21:55-04:00
RTS configure: Move over `eventfd` check

This check is for the RTS part of the event manager and has a
corresponding part in `base`.

All of this should boil down to `AC_DEFINE` not `AC_SUBST`, so it
belongs in the RTS configure and should be safe to move without
modification.

Progress towards #17191

- - - - -
268250a1 by John Ericson at 2023-09-26T10:30:11-04:00
Split `FP_CHECK_PTHREADS` and move part to RTS configure

`NEED_PTHREAD_LIB` is unused since
3609340743c1b25fdfd0e18b1670dac54c8d8623 (part of the make build
system), and so is no longer defined.

Progress towards #17191

- - - - -
87e6bdc2 by John Ericson at 2023-09-26T10:30:21-04:00
Move apple compat check to RTS configure

- - - - -
3850d3be by John Ericson at 2023-09-26T10:32:06-04:00
Move clock/timer fun checks to RTS configure

Actual library check (which will set the Cabal flag) is left in the
top-level configure for now.

Progress towards #17191

- - - - -
d5016e2d by John Ericson at 2023-09-26T10:32:53-04:00
Move visibility and "musttail" annotation checks to the RTS configure

All of this should boil down to `AC_DEFINE` not `AC_SUBST`, so it
belongs in the RTS configure and should be safe to move without
modification.

Progress towards #17191

- - - - -
25c14435 by John Ericson at 2023-09-26T10:33:33-04:00
Move leading underscore checks to RTS configure

`CabalLeadingUnderscore` is done via Hadrian already, so we can stop
`AC_SUBST`ing it completely.

- - - - -
20f20114 by John Ericson at 2023-09-26T10:33:33-04:00
Move alloca, fork, const, and big endian checks to RTS configure

All of this should boil down to `AC_DEFINE` not `AC_SUBST`, so it
belongs in the RTS configure and should be safe to move without
modification.

- - - - -
1c3054a5 by John Ericson at 2023-09-26T10:33:33-04:00
Move libdl check to RTS configure

- - - - -
61ffadea by John Ericson at 2023-09-26T10:34:27-04:00
Adjust `FP_FIND_LIBFFI`

Just set vars, and `AC_SUBST` in top-level configure.

Don't define `HAVE_SYSTEM_LIBFFI` because nothing is using it. It hasn't
be in used since 3609340743c1b25fdfd0e18b1670dac54c8d8623 (part of the
make build system).

- - - - -
d3fe76fc by John Ericson at 2023-09-26T10:35:07-04:00
Split BFD support to RTS configure

The flag is still in the top-level configure, but the other checks
(which define various macros --- important) are in the RTS configure.

- - - - -
df1c1921 by John Ericson at 2023-09-26T10:35:07-04:00
Split libm check between top level and RTS

- - - - -
1e4a4e87 by John Ericson at 2023-09-26T10:36:15-04:00
Move mingwex check to RTS configure

- - - - -
969080bd by John Ericson at 2023-09-26T10:36:15-04:00
Move function checks to RTS configure

Some of these functions are used in `base` too, but we can copy the
checks over to its configure if that's an issue.

- - - - -
6f5c1aa7 by John Ericson at 2023-09-26T10:36:15-04:00
Move over a number of C-style checks to RTS configure

- - - - -
129c83dd by John Ericson at 2023-09-26T10:36:15-04:00
Move/Copy more `AC_DEFINE` to RTS config

Only exception is the LLVM version macros, which are used for GHC
itself.

- - - - -
fd787202 by John Ericson at 2023-09-26T10:36:15-04:00
Define `TABLES_NEXT_TO_CODE` in the RTS configure

We create a new cabal flag to facilitate this.

- - - - -
2e5aa898 by John Ericson at 2023-09-26T10:36:15-04:00
Configure scripts: `checkOS`: Make a bit more robust

`mingw64` and `mingw32` are now both accepted for `OSMinGW32`. This
allows us to cope with configs/triples that we haven't normalized extra
being what GNU `config.sub` does.

- - - - -
1a245514 by GHC GitLab CI at 2023-10-02T16:17:57+00:00
wip: cross

- - - - -
1f2eed0a by Matthew Pickering at 2023-10-02T16:17:57+00:00
stages

- - - - -
beab9407 by Matthew Pickering at 2023-10-02T16:17:57+00:00
Set cross-prefix appropiately

- - - - -
01ccca1d by Matthew Pickering at 2023-10-02T16:17:57+00:00
misleading comment

- - - - -
51ddcf1a by Matthew Pickering at 2023-10-02T16:17:57+00:00
fix

- - - - -
a81004a4 by GHC GitLab CI at 2023-10-02T16:17:57+00:00
NM_STAGE0

- - - - -
6c0ca9db by GHC GitLab CI at 2023-10-02T16:17:57+00:00
some succ stage

- - - - -
403bbac4 by GHC GitLab CI at 2023-10-02T16:17:57+00:00
wip working

- - - - -
bdf4423c by Matthew Pickering at 2023-10-02T16:17:58+00:00
binary dist

- - - - -
b5ac25cd by GHC GitLab CI at 2023-10-02T16:17:58+00:00
fix

- - - - -
7839ee23 by GHC GitLab CI at 2023-10-02T16:17:58+00:00
Build static cross binaries

- - - - -
48fc70d4 by Matthew Pickering at 2023-10-02T16:17:58+00:00
Remove cross predicates

- - - - -
b6d1c5b3 by Matthew Pickering at 2023-10-02T16:17:58+00:00
Propagate some more Stage0 variables to host file

- - - - -
915002e0 by Matthew Pickering at 2023-10-02T16:17:58+00:00
clean

- - - - -
1f407a3e by GHC GitLab CI at 2023-10-02T16:17:58+00:00
fix hsc2hs cross predicate

- - - - -
e9e1eff2 by GHC GitLab CI at 2023-10-02T16:17:58+00:00
pass proper host on cabal configure

- - - - -
11421a3d by John Ericson at 2023-10-02T17:25:31+00:00
Generate `ghcplatform.h` from RTS configure

We create a new cabal flag to facilitate this.

- - - - -
893cb7da by John Ericson at 2023-10-02T17:26:05+00:00
Get rid of all mention of `mk/config.h`

The RTS configure script is now solely responsible for managing its
headers; the top level configure script does not help.

- - - - -


30 changed files:

- .gitignore
- .gitlab-ci.yml
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/issue_templates/bug.md → .gitlab/issue_templates/default.md
- .gitlab/jobs.yaml
- .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py
- .gitlab/rel_eng/upload_ghc_libs.py
- compiler/GHC/Core/Class.hs
- compiler/GHC/Core/Coercion/Axiom.hs
- compiler/GHC/CoreToStg/Prep.hs
- compiler/GHC/Driver/DynFlags.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/IfaceToCore.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Tc/Deriv/Generate.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/TyCl.hs
- compiler/GHC/Tc/TyCl/Build.hs
- compiler/GHC/Tc/TyCl/Instance.hs
- compiler/GHC/Tc/Validity.hs
- compiler/GHC/Tc/Zonk/Type.hs
- compiler/GHC/Types/Error.hs
- compiler/GHC/Unit/Info.hs
- compiler/GHC/Utils/Outputable.hs
- configure.ac
- distrib/cross-port
- docs/users_guide/expected-undocumented-flags.txt
- docs/users_guide/using.rst
- hadrian/bootstrap/plan-9_4_1.json


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ed997787139890b5e669948cd5f98f29ee3dcf60...893cb7da329f243e4f0b09d0c1f8a2babba54f7d

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ed997787139890b5e669948cd5f98f29ee3dcf60...893cb7da329f243e4f0b09d0c1f8a2babba54f7d
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/20231003/c048970c/attachment-0001.html>


More information about the ghc-commits mailing list