[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 3 commits: Elaborate comment on GHC_NO_UNICODE

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Tue Sep 26 13:15:00 UTC 2023



Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC


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

- - - - -
e9727e26 by Ben Gamari at 2023-09-26T09:14:55-04:00
gitlab-ci: Mark T22012 as broken on CentOS 7

Due to #23979.

- - - - -
23309208 by Teo Camarasu at 2023-09-26T09:14:55-04:00
hadrian: better error for failing to find file's dependencies

Resolves #24004

- - - - -


5 changed files:

- .gitlab/generate-ci/gen_ci.hs
- .gitlab/jobs.yaml
- compiler/GHC/Driver/DynFlags.hs
- docs/users_guide/using.rst
- hadrian/src/Hadrian/Oracles/TextFile.hs


Changes:

=====================================
.gitlab/generate-ci/gen_ci.hs
=====================================
@@ -447,7 +447,8 @@ distroVariables :: LinuxDistro -> Variables
 distroVariables Alpine312 = alpineVariables
 distroVariables Alpine318 = alpineVariables
 distroVariables Centos7 = mconcat [
-  "HADRIAN_ARGS" =: "--docs=no-sphinx"
+    "HADRIAN_ARGS" =: "--docs=no-sphinx"
+  , "BROKEN_TESTS" =: "T22012" -- due to #23979
   ]
 distroVariables Rocky8 = mconcat [
   "HADRIAN_ARGS" =: "--docs=no-sphinx"


=====================================
.gitlab/jobs.yaml
=====================================
@@ -1141,6 +1141,7 @@
     "variables": {
       "BIGNUM_BACKEND": "gmp",
       "BIN_DIST_NAME": "ghc-x86_64-linux-centos7-validate",
+      "BROKEN_TESTS": "T22012",
       "BUILD_FLAVOUR": "validate",
       "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
       "HADRIAN_ARGS": "--docs=no-sphinx",
@@ -3301,6 +3302,7 @@
     "variables": {
       "BIGNUM_BACKEND": "gmp",
       "BIN_DIST_NAME": "ghc-x86_64-linux-centos7-release+no_split_sections",
+      "BROKEN_TESTS": "T22012",
       "BUILD_FLAVOUR": "release+no_split_sections",
       "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
       "HADRIAN_ARGS": "--hash-unit-ids --docs=no-sphinx",


=====================================
compiler/GHC/Driver/DynFlags.hs
=====================================
@@ -495,6 +495,8 @@ class ContainsDynFlags t where
 initDynFlags :: DynFlags -> IO DynFlags
 initDynFlags dflags = do
  let
+ -- This is not bulletproof: we test that 'localeEncoding' is Unicode-capable,
+ -- but potentially 'hGetEncoding' 'stdout' might be different. Still good enough.
  canUseUnicode <- do let enc = localeEncoding
                          str = "‘’"
                      (withCString enc str $ \cstr ->


=====================================
docs/users_guide/using.rst
=====================================
@@ -1823,6 +1823,10 @@ GHC can also be configured using various environment variables.
 .. envvar:: GHC_NO_UNICODE
 
     When non-empty, disables Unicode diagnostics output regardless of locale settings.
+    GHC can usually determine that locale is not Unicode-capable and fallback to ASCII
+    automatically, but in some corner cases (e. g., when GHC output is redirected)
+    you might hit ``invalid argument (cannot encode character '\8216')``,
+    in which case do set ``GHC_NO_UNICODE``.
 
 .. envvar:: GHC_CHARENC
 


=====================================
hadrian/src/Hadrian/Oracles/TextFile.hs
=====================================
@@ -82,8 +82,8 @@ lookupDependencies depFile file = do
           | otherwise            = 1
     deps <- fmap (sortOn weigh) <$> lookupValues depFile file
     case deps of
-        Nothing -> error $ "No dependencies found for file " ++ quote file
-        Just [] -> error $ "No source file found for file " ++ quote file
+        Nothing -> error $ "No dependencies found for file " ++ quote file ++ " in " ++ quote depFile
+        Just [] -> error $ "No source file found for file " ++ quote file ++ " in " ++ quote depFile
         Just (source : files) -> return (source, files)
 
 -- | Parse a target from a text file, tracking the result. The file is expected



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/6f6fb7752b5b65f85f09dfe381d24d8b8e9ee24e...23309208c6a8e2668ab7168004eeb019d668472e

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/6f6fb7752b5b65f85f09dfe381d24d8b8e9ee24e...23309208c6a8e2668ab7168004eeb019d668472e
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/20230926/74a75804/attachment-0001.html>


More information about the ghc-commits mailing list