Fix tempfile names.

This commit is contained in:
Matus Tejiscak 2020-04-01 21:57:36 +02:00
parent 66169377b1
commit 6917f09a02
3 changed files with 8 additions and 9 deletions

View File

@ -353,16 +353,15 @@ compileToSS c tm outfile
compileToSO : {auto c : Ref Ctxt Defs} ->
(appDirRel : String) -> (outSsAbs : String) -> Core ()
compileToSO appDirRel outSsAbs
= do tmpfn <- coreLift tmpName
let tmpFileRel = appDirRel ++ dirSep ++ tmpfn
= do tmpFileAbs <- coreLift tmpName
chez <- coreLift $ findChez
let build= "#!" ++ chez ++ " --script\n" ++
"(parameterize ([optimize-level 3]) (compile-program \"" ++
outSsAbs ++ "\"))"
Right () <- coreLift $ writeFile tmpFileRel build
| Left err => throw (FileErr tmpFileRel err)
coreLift $ chmod tmpFileRel 0o755
coreLift $ system tmpFileRel
Right () <- coreLift $ writeFile tmpFileAbs build
| Left err => throw (FileErr tmpFileAbs err)
coreLift $ chmod tmpFileAbs 0o755
coreLift $ system tmpFileAbs
pure ()
makeSh : String -> String -> Core ()

View File

@ -88,7 +88,7 @@ compileExpr : Ref Ctxt Defs -> (execDir : String) ->
ClosedTerm -> (outfile : String) -> Core (Maybe String)
compileExpr c execDir tm outfile
= do tmp <- coreLift $ tmpName
let outn = execDir ++ dirSep ++ tmp ++ ".scm"
let outn = tmp ++ ".scm"
compileToSCM c tm outn
csc <- coreLift findCSC
ok <- coreLift $ system (csc ++ " " ++ outn ++ " -o " ++ outfile)
@ -99,7 +99,7 @@ compileExpr c execDir tm outfile
executeExpr : Ref Ctxt Defs -> (execDir : String) -> ClosedTerm -> Core ()
executeExpr c execDir tm
= do tmp <- coreLift $ tmpName
let outn = execDir ++ dirSep ++ tmp ++ ".scm"
let outn = tmp ++ ".scm"
compileToSCM c tm outn
csi <- coreLift findCSI
coreLift $ system (csi ++ " -s " ++ outn)

View File

@ -325,7 +325,7 @@ compileExpr c execDir tm outfile
executeExpr : Ref Ctxt Defs -> (execDir : String) -> ClosedTerm -> Core ()
executeExpr c execDir tm
= do tmp <- coreLift $ tmpName
let outn = execDir ++ dirSep ++ tmp ++ ".rkt"
let outn = tmp ++ ".rkt"
compileToRKT c tm outn
racket <- coreLift findRacket
coreLift $ system (racket ++ " " ++ outn)