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
3b7655f2
Unverified
Commit
3b7655f2
authored
3 years ago
by
mergify[bot]
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #7652 from Mistuke/fix-configure-different-way
Windows: rewrite paths to configure
parents
cfd5affa
4c800c92
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Cabal/src/Distribution/Simple.hs
+20
-2
20 additions, 2 deletions
Cabal/src/Distribution/Simple.hs
with
20 additions
and
2 deletions
Cabal/src/Distribution/Simple.hs
+
20
−
2
View file @
3b7655f2
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Simple
...
...
@@ -97,7 +98,11 @@ import Distribution.System (buildPlatform)
import
System.Environment
(
getArgs
,
getProgName
)
import
System.Directory
(
removeFile
,
doesFileExist
,
doesDirectoryExist
,
removeDirectoryRecursive
)
import
System.FilePath
(
searchPathSeparator
,
takeDirectory
,
(
</>
),
splitDirectories
,
dropDrive
)
import
System.FilePath
(
searchPathSeparator
,
takeDirectory
,
(
</>
),
splitDirectories
,
dropDrive
)
#
ifdef
mingw32_HOST_OS
import
System.FilePath
(
normalise
,
splitDrive
)
#
endif
import
Distribution.Compat.ResponseFile
(
expandResponse
)
import
Distribution.Compat.Directory
(
makeAbsolute
)
import
Distribution.Compat.Environment
(
getEnvironment
)
...
...
@@ -670,7 +675,7 @@ runConfigureScript verbosity backwardsCompatHack flags lbi = do
-- TODO: We don't check for colons, tildes or leading dashes. We
-- also should check the builddir's path, destdir, and all other
-- paths as well.
let
configureFile'
=
intercalate
"/"
$
splitDirectories
configureFile
let
configureFile'
=
toUnix
configureFile
for_
badAutoconfCharacters
$
\
(
c
,
cname
)
->
when
(
c
`
elem
`
dropDrive
configureFile'
)
$
warn
verbosity
$
concat
...
...
@@ -710,6 +715,19 @@ runConfigureScript verbosity backwardsCompatHack flags lbi = do
++
"If you are not on Windows, ensure that an 'sh' command "
++
"is discoverable in your path."
-- | Convert Windows path to Unix ones
toUnix
::
String
->
String
#
ifdef
mingw32_HOST_OS
toUnix
s
=
let
tmp
=
normalise
s
(
l
,
rest
)
=
case
splitDrive
tmp
of
(
[]
,
x
)
->
(
"/"
,
x
)
(
h
:
_
,
x
)
->
(
'/'
:
h
:
"/"
,
x
)
parts
=
splitDirectories
rest
in
l
++
intercalate
"/"
parts
#
else
toUnix
s
=
intercalate
"/"
$
splitDirectories
s
#
endif
badAutoconfCharacters
::
[(
Char
,
String
)]
badAutoconfCharacters
=
[
(
' '
,
"space"
)
...
...
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