diff options
author | Eduardo Julian | 2020-04-21 02:53:23 -0400 |
---|---|---|
committer | Eduardo Julian | 2020-04-21 02:53:23 -0400 |
commit | d636f97db32f0ca3aa1705c5290afc07314adc53 (patch) | |
tree | 28669a028d9c27fe53ce433c76d40677b42b144a /stdlib/source/lux/tool/compiler/default/platform.lux | |
parent | f6a2fe158979230dcf2d271981ff34be39c7bffc (diff) |
Now caching the reservations from the archive.
Diffstat (limited to 'stdlib/source/lux/tool/compiler/default/platform.lux')
-rw-r--r-- | stdlib/source/lux/tool/compiler/default/platform.lux | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/stdlib/source/lux/tool/compiler/default/platform.lux b/stdlib/source/lux/tool/compiler/default/platform.lux index 1f68030bd..0d31b1f2d 100644 --- a/stdlib/source/lux/tool/compiler/default/platform.lux +++ b/stdlib/source/lux/tool/compiler/default/platform.lux @@ -98,16 +98,6 @@ (-> <Platform> (///generation.Operation anchor expression directive Any))) (get@ #runtime)) - (def: (ensure-target! platform target host) - (All <type-vars> - (-> <Platform> Path Host (Promise (Try Any)))) - (let [system (get@ #&file-system platform) - mkdir (: (-> Path (Promise (Try Any))) - (file.get-directory promise.monad system))] - (do (try.with promise.monad) - [_ (mkdir target)] - (mkdir (ioW.archive system host target))))) - (def: #export (initialize target host module expander host-analysis platform generation-bundle host-directive-bundle program extender) (All <type-vars> (-> Path @@ -120,7 +110,7 @@ (///directive.Bundle anchor expression directive) (-> expression directive) Extender - (Promise (Try [<State+> (Buffer directive)])))) + (Promise (Try [<State+> Archive (Buffer directive)])))) (let [state (//init.state host module expander @@ -132,11 +122,13 @@ program extender)] (do (try.with promise.monad) - [_ (..ensure-target! platform target host)] + [_ (ioW.enable (get@ #&file-system platform) host target) + archive (ioW.thaw (get@ #&file-system platform) host target)] (|> (do ///phase.monad [_ ..initialize-buffer! - _ (..compile-runtime! platform)] - ///generation.buffer) + _ (..compile-runtime! platform) + buffer ///generation.buffer] + (wrap [archive buffer])) ///directive.lift-generation (///phase.run' state) promise@wrap))) @@ -197,11 +189,7 @@ compilation (compiler (:coerce ///.Input input))] (do @ [#let [dependencies (get@ #///.dependencies compilation)] - archive+state (monad.fold @ - import! - [archive state] - (list.filter (bit.complement (archive.archived? archive)) - dependencies)) + archive+state (monad.fold @ import! [archive state] dependencies) #let [## TODO: Inline ASAP [archive state] (:share <type-vars> {<Platform> @@ -220,7 +208,7 @@ state _ - ## TODO: The "///analysis.set-current-module" below shouldn't be necessary. Remove it ASAP. + ## TODO: The "///directive.set-current-module" below shouldn't be necessary. Remove it ASAP. ## TODO: The context shouldn't need to be re-set either. (|> (///directive.set-current-module module) (///phase.run' state) @@ -249,5 +237,7 @@ (promise@wrap (#try.Failure error))))) (#try.Failure error) - (promise@wrap (#try.Failure error))))))))))) + (do (try.with promise.monad) + [_ (ioW.freeze (get@ #&file-system platform) host target archive)] + (promise@wrap (#try.Failure error)))))))))))) ) |