Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Cabal
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Glasgow Haskell Compiler
Packages
Cabal
Commits
7313c3b0
Unverified
Commit
7313c3b0
authored
3 years ago
by
mergify[bot]
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #7844 from sergv/master
Fix cabal on Windows 7
parents
d0b35b40
c8841f67
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Cabal/src/Distribution/Compat/Process.hs
+28
-7
28 additions, 7 deletions
Cabal/src/Distribution/Compat/Process.hs
changelog.d/pr-7844
+8
-0
8 additions, 0 deletions
changelog.d/pr-7844
with
36 additions
and
7 deletions
Cabal/src/Distribution/Compat/Process.hs
+
28
−
7
View file @
7313c3b0
...
...
@@ -18,23 +18,44 @@ import qualified System.Process as Process
import
System.Process
(
waitForProcess
)
#
endif
#
if
defined
(
mingw32_HOST_OS
)
&&
MIN_VERSION_process
(
1
,
6
,
9
)
import
System.IO.Unsafe
(
unsafePerformIO
)
import
System.Win32.Info.Version
(
dwMajorVersion
,
dwMinorVersion
,
getVersionEx
)
#
endif
-------------------------------------------------------------------------------
-- enableProcessJobs
-------------------------------------------------------------------------------
#
if
defined
(
mingw32_HOST_OS
)
&&
MIN_VERSION_process
(
1
,
6
,
9
)
-- This exception, needed to support Windows 7, could be removed when
-- the lowest GHC version cabal supports is a GHC that doesn’t support
-- Windows 7 any more.
{-# NOINLINE isWindows8OrLater #-}
isWindows8OrLater
::
Bool
isWindows8OrLater
=
unsafePerformIO
$
do
v
<-
getVersionEx
pure
$
(
dwMajorVersion
v
,
dwMinorVersion
v
)
>=
(
6
,
2
)
#
endif
-- | Enable process jobs to ensure accurate determination of process completion
-- in the presence of @exec(3)@ on Windows.
--
-- Unfortunately the process job support is badly broken in @process@ releases
-- prior to 1.6.9, so we disable it in these versions, despite the fact that
-- this means we may see sporatic build failures without jobs.
-- this means we may see sporadic build failures without jobs.
--
-- On Windows 7 or before the jobs are disabled due to the fact that
-- processes on these systems can only have one job. This prevents
-- spawned process from assigning jobs to its own children. Suppose
-- processs A spawns process B. The B process has a job assigned (call
-- it J1) and when it tries to spawn a new process C the C
-- automatically inherits the job. But at it also tries to assign a
-- new job J2 to C since it doesn’t have access J1. This fails on
-- Windows 7 or before.
enableProcessJobs
::
CreateProcess
->
CreateProcess
#
ifdef
MIN_VERSION_process
#
if
MIN_VERSION_process
(
1
,
6
,
9
)
enableProcessJobs
cp
=
cp
{
Process
.
use_process_jobs
=
True
}
#
else
enableProcessJobs
cp
=
cp
#
endif
#
if
defined
(
mingw32_HOST_OS
)
&&
MIN_VERSION_process
(
1
,
6
,
9
)
enableProcessJobs
cp
=
cp
{
Process
.
use_process_jobs
=
isWindows8OrLater
}
#
else
enableProcessJobs
cp
=
cp
#
endif
...
...
This diff is collapsed.
Click to expand it.
changelog.d/pr-7844
0 → 100644
+
8
−
0
View file @
7313c3b0
synopsis: Disable job management on Windows 7
packages: Cabal
prs: #7844
significance: significant
description: {
- cabal now works on Windows 7
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment