Hannes Siebenhandl pushed to branch wip/fendor/ghc-pkg-ospath at Glasgow Haskell Compiler / GHC

Commits:

5 changed files:

Changes:

  • compiler/GHC/Driver/DynFlags.hs
    ... ... @@ -1208,6 +1208,7 @@ defaultFlags settings
    1208 1208
       = [ Opt_AutoLinkPackages,
    
    1209 1209
           Opt_DiagnosticsShowCaret,
    
    1210 1210
           Opt_EmbedManifest,
    
    1211
    +      Opt_WinLongPathAware,
    
    1211 1212
           Opt_FamAppCache,
    
    1212 1213
           Opt_GenManifest,
    
    1213 1214
           Opt_GhciHistory,
    

  • compiler/GHC/Driver/Flags.hs
    ... ... @@ -743,6 +743,7 @@ data GeneralFlag
    743 743
        | Opt_PrintBindContents
    
    744 744
        | Opt_GenManifest
    
    745 745
        | Opt_EmbedManifest
    
    746
    +   | Opt_WinLongPathAware
    
    746 747
        | Opt_SharedImplib
    
    747 748
        | Opt_BuildingCabalPackage
    
    748 749
        | Opt_IgnoreDotGhci
    

  • compiler/GHC/Driver/Session.hs
    ... ... @@ -2523,6 +2523,7 @@ fFlagsDeps = [
    2523 2523
       flagSpec "eager-blackholing"                Opt_EagerBlackHoling,
    
    2524 2524
       flagSpec "orig-thunk-info"                  Opt_OrigThunkInfo,
    
    2525 2525
       flagSpec "embed-manifest"                   Opt_EmbedManifest,
    
    2526
    +  flagSpec "win-aware-long-paths"             Opt_WinLongPathAware,
    
    2526 2527
       flagSpec "enable-rewrite-rules"             Opt_EnableRewriteRules,
    
    2527 2528
       flagSpec "enable-th-splice-warnings"        Opt_EnableThSpliceWarnings,
    
    2528 2529
       flagSpec "error-spans"                      Opt_ErrorSpans,
    

  • compiler/GHC/Linker/Windows.hs
    ... ... @@ -16,6 +16,7 @@ import System.Directory
    16 16
     
    
    17 17
     data ManifestOpts = ManifestOpts
    
    18 18
       { manifestEmbed :: !Bool    -- ^ Should the manifest be embedded in the binary with Windres
    
    19
    +  , manifestLongPathAware :: !Bool
    
    19 20
       , manifestTempdir :: TempDir
    
    20 21
       , manifestWindresConfig :: WindresConfig
    
    21 22
       , manifestObjectSuf :: String
    
    ... ... @@ -24,6 +25,7 @@ data ManifestOpts = ManifestOpts
    24 25
     initManifestOpts :: DynFlags -> ManifestOpts
    
    25 26
     initManifestOpts dflags = ManifestOpts
    
    26 27
       { manifestEmbed = gopt Opt_EmbedManifest dflags
    
    28
    +  , manifestLongPathAware = gopt Opt_WinLongPathAware dflags
    
    27 29
       , manifestTempdir = tmpDir dflags
    
    28 30
       , manifestWindresConfig = configureWindres dflags
    
    29 31
       , manifestObjectSuf = objectSuf dflags
    
    ... ... @@ -50,8 +52,19 @@ maybeCreateManifest logger tmpfs opts exe_filename = do
    50 52
              \        <requestedExecutionLevel level=\"asInvoker\" uiAccess=\"false\"/>\n\
    
    51 53
              \        </requestedPrivileges>\n\
    
    52 54
              \       </security>\n\
    
    53
    -         \  </trustInfo>\n\
    
    54
    -         \</assembly>\n"
    
    55
    +         \  </trustInfo>\n"
    
    56
    +         ++
    
    57
    +         if manifestLongPathAware opts
    
    58
    +            then
    
    59
    +              "  <application xmlns=\"urn:schemas-microsoft-com:asm.v3\">\n\
    
    60
    +              \      <windowsSettings xmlns:ws2=\"http://schemas.microsoft.com/SMI/2016/WindowsSettings\">\n\
    
    61
    +              \          <ws2:longPathAware>true</ws2:longPathAware>\n\
    
    62
    +              \      </windowsSettings>\n\
    
    63
    +              \  </application>\n"
    
    64
    +            else
    
    65
    +              ""
    
    66
    +         ++
    
    67
    +         "</assembly>\n"
    
    55 68
     
    
    56 69
        writeFile manifest_filename manifest
    
    57 70
     
    

  • docs/users_guide/phases.rst
    ... ... @@ -1430,6 +1430,16 @@ for example).
    1430 1430
         See also :ghc-flag:`-pgmwindres ⟨cmd⟩` (:ref:`replacing-phases`) and
    
    1431 1431
         :ghc-flag:`-optwindres ⟨option⟩` (:ref:`forcing-options-through`).
    
    1432 1432
     
    
    1433
    +.. ghc-flag:: -fwin-aware-long-paths
    
    1434
    +    :shortdesc: Do not embed the manifest in the executable (Windows only)
    
    1435
    +    :type: dynamic
    
    1436
    +    :category: linking
    
    1437
    +
    
    1438
    +    .. index::
    
    1439
    +       single: windres
    
    1440
    +
    
    1441
    +    The manifest file that GHC
    
    1442
    +
    
    1433 1443
     .. ghc-flag:: -fno-shared-implib
    
    1434 1444
         :shortdesc: Don't generate an import library for a DLL (Windows only)
    
    1435 1445
         :type: dynamic