...
 
Commits (4)
......@@ -184,6 +184,13 @@ module DynFlags (
canonicalizeHomeModule,
canonicalizeModuleIfHome,
TurnOnFlag,
turnOn,
turnOff,
impliedGFlags,
impliedOffGFlags,
impliedXFlags,
-- ** Parsing DynFlags
parseDynamicFlagsCmdLine,
parseDynamicFilePragma,
......
......@@ -142,7 +142,7 @@ state 61 contains 47 shift/reduce conflicts.
*** btype -> tyapps .
tyapps -> tyapps . tyapp
Conflicts: '_' ':' '~' '!' '.' '`' '{' '[' '[:' '(' '(#' '`' TYPEAPP
Conflicts: '_' ':' '~' '!' '.' '`' '{' '[' '(' '(#' '`' TYPEAPP
SIMPLEQUOTE VARID CONID VARSYM CONSYM QCONID QVARSYM QCONSYM
STRING INTEGER TH_ID_SPLICE '$(' TH_QUASIQUOTE TH_QQUASIQUOTE
and all the special ids.
......@@ -561,8 +561,6 @@ are the most common patterns, rewritten as regular expressions for clarity:
vccurly { L _ ITvccurly } -- virtual close curly (from layout)
'[' { L _ ITobrack }
']' { L _ ITcbrack }
'[:' { L _ ITopabrack }
':]' { L _ ITcpabrack }
'(' { L _ IToparen }
')' { L _ ITcparen }
'(#' { L _ IToubxparen }
......
......@@ -521,12 +521,6 @@ These flags dump various phases of GHC's C-\\- pipeline.
Each CFG is dumped in dot format graph making it easy
to visualize them.
.. ghc-flag:: -ddump-srts
:shortdesc: Dump the Static Reference Tables computed for the program's bindings.
:type: dynamic
Dumps the static reference tables computed for CAFfy bindings.
LLVM code generator
~~~~~~~~~~~~~~~~~~~~~~
......
import os
import subprocess
import shutil
import tempfile
from pathlib import Path, PurePath
from term_color import Color, colored
......@@ -82,7 +83,28 @@ def testing_metrics():
#
# We define the following function to make this magic more
# explicit/discoverable. You are encouraged to use it instead of os.symlink.
if os.name == 'nt' and os.getenv('FORCE_SYMLINKS') == None:
def symlinks_work() -> bool:
if os.getenv('FORCE_SYMLINKS') is not None:
return True
elif os.name == 'nt':
# On Windows we try to create a symlink to test whether symlinks are
# usable.
works = False
with tempfile.NamedTemporaryFile() as tmp:
try:
tmp.write('hello')
os.symlink(tmp.name, '__symlink-test')
works = True
except OSError as e:
print('Saw {} during symlink test; assuming symlinks do not work.'.format(e))
finally:
os.unlink('__symlink-test')
return works
else:
return True
if not symlinks_work():
def link_or_copy_file(src: Path, dst: Path):
shutil.copyfile(str(src), str(dst))
else:
......