diff --git a/CHANGELOG.md b/CHANGELOG.md index cf09ca468..3e1bb5a9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ half as good. The `--whole-program` flag overrides incremental compilation, and reverts to whole program compilation. Incremental compilation is currently supported only by the Chez Scheme back end. + This is currently supported only on Unix-like platforms (not yet Windows) ### Library Changes diff --git a/src/Compiler/Scheme/Chez.idr b/src/Compiler/Scheme/Chez.idr index eed25416f..46d1631b9 100644 --- a/src/Compiler/Scheme/Chez.idr +++ b/src/Compiler/Scheme/Chez.idr @@ -85,7 +85,9 @@ findLibs ds schHeader : String -> List String -> Bool -> String schHeader chez libs whole - = (if os /= "windows" then "#!" ++ chez ++ " --program\n\n" else "") ++ + = (if os /= "windows" + then "#!" ++ chez ++ (if whole then " --program\n\n" else " --script\n\n") + else "") ++ "; " ++ (generatedString "Chez") ++ "\n" ++ "(import (chezscheme))\n" ++ "(case (machine-type)\n" ++ @@ -581,6 +583,8 @@ compileExpr : Bool -> Ref Ctxt Defs -> (tmpDir : String) -> (outputDir : String) compileExpr makeitso c tmpDir outputDir tm outfile = do s <- getSession if not (wholeProgram s) && (Chez `elem` incrementalCGs !getSession) + -- Disable on Windows, for now, since it doesn't work! + && os /= "windows" then compileExprInc makeitso c tmpDir outputDir tm outfile else compileExprWhole makeitso c tmpDir outputDir tm outfile @@ -596,7 +600,12 @@ executeExpr c tmpDir tm incCompile : Ref Ctxt Defs -> (sourceFile : String) -> Core (Maybe (String, List String)) incCompile c sourceFile - = do ssFile <- getTTCFileName sourceFile "ss" + = do -- Disable on Windows, for now, since it doesn't work! + -- When re-enabling it, please also turn it back on in test chez033 + let True = os /= "windows" + | False => pure Nothing + + ssFile <- getTTCFileName sourceFile "ss" soFile <- getTTCFileName sourceFile "so" soFilename <- getObjFileName sourceFile "so" cdata <- getIncCompileData False Cases diff --git a/tests/Main.idr b/tests/Main.idr index d06ada9b7..33290f2c2 100644 --- a/tests/Main.idr +++ b/tests/Main.idr @@ -213,7 +213,7 @@ chezTests = MkTestPool "Chez backend" [] (Just Chez) , "chez013", "chez014", "chez015", "chez016", "chez017", "chez018" , "chez019", "chez020", "chez021", "chez022", "chez023", "chez024" , "chez025", "chez026", "chez027", "chez028", "chez029", "chez030" - , "chez031", "chez032" + , "chez031", "chez032", "chez033" , "futures001" , "bitops" , "casts" diff --git a/tests/chez/chez033/Main.idr b/tests/chez/chez033/Main.idr new file mode 100644 index 000000000..1f13d3554 --- /dev/null +++ b/tests/chez/chez033/Main.idr @@ -0,0 +1,4 @@ +import Mod + +main : IO () +main = printLn (fn (100 * 100)) diff --git a/tests/chez/chez033/Mod.idr b/tests/chez/chez033/Mod.idr new file mode 100644 index 000000000..366d5e993 --- /dev/null +++ b/tests/chez/chez033/Mod.idr @@ -0,0 +1,5 @@ +module Mod + +export +fn : Nat -> Nat +fn x = S x diff --git a/tests/chez/chez033/expected b/tests/chez/chez033/expected new file mode 100644 index 000000000..298c4f1c9 --- /dev/null +++ b/tests/chez/chez033/expected @@ -0,0 +1,4 @@ +1/2: Building Mod (Mod.idr) +2/2: Building Main (Main.idr) +Main> 10001 +Main> Bye for now! diff --git a/tests/chez/chez033/input b/tests/chez/chez033/input new file mode 100644 index 000000000..fc5992c29 --- /dev/null +++ b/tests/chez/chez033/input @@ -0,0 +1,2 @@ +:exec main +:q diff --git a/tests/chez/chez033/run b/tests/chez/chez033/run new file mode 100644 index 000000000..bbbd132d3 --- /dev/null +++ b/tests/chez/chez033/run @@ -0,0 +1,9 @@ +if [ "$OS" = "windows" ]; then + # incremental builds don't work on windows so we get lots of warnings, + # but we still need the test output to be correct + $1 --no-banner --no-color --console-width 0 Main.idr < input +else + $1 --no-banner --no-color --console-width 0 Main.idr --inc chez < input +fi + +rm -rf build