Skip to content

Commit

Permalink
proj-manager is source of truth
Browse files Browse the repository at this point in the history
  • Loading branch information
tjknoth committed Feb 15, 2024
1 parent 5c161f2 commit b9eb1e3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
5 changes: 2 additions & 3 deletions compiler/compiler-main.stanza
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ public defn compile (proj-manager:ProjManager,
supported-vm-packages:Tuple<String|Symbol>,
output:False|String,
pkg-dir:False|String,
pkg-cache-dir:False|String
backend:Backend,
optimize?:True|False,
debug?:True|False,
Expand Down Expand Up @@ -188,11 +187,11 @@ public defn compile (proj-manager:ProjManager,
flags,
debug?,
false,
pkg-cache-dir)
pkg-cache-dir(proj-manager))

;True if pkgs are written out, either to the pkg directory
;or to the cache directory.
val write-out-pkgs? = pkg-dir is String or pkg-cache-dir is String
val write-out-pkgs? = pkg-dir is String or pkg-cache-dir(proj-manager) is String

;Save optimized packages if necessary
if write-out-pkgs? and optimize? :
Expand Down
2 changes: 1 addition & 1 deletion compiler/compiler.stanza
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public defn compile (settings:BuildSettings, system:System, verbose?:True|False)
setup-system-flags(settings*)
val proj-params = ProjParams(compiler-flags(), optimize?(settings*), debug?(settings*), false, disable-cache?(settings*), pkg-cache-dir(settings*))
val proj-manager = ProjManager(proj, proj-params, auxfile)
val comp-result = compile(proj-manager, auxfile, build-inputs!(settings*), vm-packages(settings*), asm?(settings*), pkg-dir(settings*), pkg-cache-dir(settings*)
val comp-result = compile(proj-manager, auxfile, build-inputs!(settings*), vm-packages(settings*), asm?(settings*), pkg-dir(settings*),
backend(platform(settings*) as Symbol), optimize?(settings*), debug?(settings*), verbose?,
macro-plugins(settings*), inputs(settings) is BuildTarget)
save(auxfile)
Expand Down
6 changes: 2 additions & 4 deletions compiler/repl.stanza
Original file line number Diff line number Diff line change
Expand Up @@ -478,15 +478,13 @@ public defn REPL (macro-plugins:Tuple<String>,
within log-time(REPL-LOWERING-AND-COMPILATION) :

;Create the PkgSaver to cache pkg files when appropriate.
val cache-dir = match(pkg-cache-dir:String) : pkg-cache-dir
else : /pkg-cache-dir(proj-manager)
val pkgsaver = PkgSaver(auxfile,
pkgstamps(result),
false,
compiler-flags,
false,
true,
cache-dir)
/pkg-cache-dir(proj-manager))

;Compile the EPackages into VMPackages.
val vmpackages = for p in packages(result) map :
Expand All @@ -507,7 +505,7 @@ public defn REPL (macro-plugins:Tuple<String>,
vmp(p)

;Save the auxiliary file if caching is enabled.
save(auxfile) when cache-dir is String
save(auxfile) when /pkg-cache-dir(proj-manager) is String

;Return the compiled VMPackages.
vmpackages
Expand Down

0 comments on commit b9eb1e3

Please sign in to comment.