Verified Commit 2f25118c authored by Camil Staps's avatar Camil Staps 🐧

Only run OptimiseABC and ByteCodeGen when the source file has changed

parent 688fd7d4
Pipeline #20752 passed with stage
in 1 minute and 1 second
......@@ -1673,6 +1673,11 @@ OptimiseABC mdn abc_path ps
abcopt = startupdir +++ DirSeparatorString +++ abcopt
# abcopt_path = abc_path % (0,size abc_path-4) +++ "opt.abc"
# (abc_date,ps) = accFiles (FModified abc_path) ps
# (abcopt_date,ps) = accFiles (FModified abcopt_path) ps
| abcopt_date.exists && Older_Date abc_date abcopt_date
= (True, ps)
# ps = showInfo (Level2 ("Optimising ABC for '" +++ mdn.mdn_name +++ "'.")) ps
# (exitcode,err,ps) = RunExternalCommand abcopt [abc_path,"-o",abcopt_path] startupdir ps
# err = if (exitcode == 0)
......@@ -1686,11 +1691,16 @@ ByteCodeGen use_optimised_abc mdn abc_path ps
# (startupdir,ps) = getStup ps
(bcgen,ps) = getCurrentBCgen ps
bcgen = startupdir +++ DirSeparatorString +++ bcgen
# abcopt_path = abc_path % (0,size abc_path-4) +++ "opt.abc"
bc_path = abc_path % (0,size abc_path-4) +++ "bc"
# bc_path = abc_path % (0,size abc_path-4) +++ "bc"
abc_path = if use_optimised_abc (abc_path % (0,size abc_path-4) +++ "opt.abc") abc_path
# (abc_date,ps) = accFiles (FModified abc_path) ps
(bc_date,ps) = accFiles (FModified bc_path) ps
| bc_date.exists && Older_Date abc_date bc_date
= (True, ps)
# ps = showInfo (Level2 ("Generating bytecode for '" +++ mdn.mdn_name +++ "'.")) ps
# (exitcode,err,ps) = RunExternalCommand bcgen [if use_optimised_abc abcopt_path abc_path,"-o",bc_path] startupdir ps
# (exitcode,err,ps) = RunExternalCommand bcgen [abc_path,"-o",bc_path] startupdir ps
# err = if (exitcode == 0)
err
(err ++ ["Bytecode generator failed for " +++ mdn.mdn_name +++ " (exit code: " +++ toString exitcode +++ ")"])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment