Skip to content

Commit

Permalink
Fixed lazy module compilation (another attempt)
Browse files Browse the repository at this point in the history
  • Loading branch information
VPetukhov committed Apr 19, 2023
1 parent c9979f9 commit 0f32590
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/platforms_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:

- name: Build binary
run: |
julia --project ./deps/build.jl app
LazyModules_lazyload=false julia --project ./deps/build.jl app
- name: Prepare distribution archives
run: |
Expand Down
6 changes: 0 additions & 6 deletions deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ using Baysor
using Comonicon: Builder
using Pkg

# Just to make sure they're initialized. Failsafe for `LazyModules_lazyload`.
Baysor.load_module(Baysor.DAT)
Baysor.load_module(Baysor.REP)
Baysor.load_module(Baysor.BPR)
Baysor.load_module(Baysor.CLI)

Pkg.activate(pkgdir(Baysor))
Pkg.instantiate() # Comonicon doesn't pull non-registered dependencies, such as VegaLite.jl

Expand Down
7 changes: 7 additions & 0 deletions src/Baysor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ export load_module

LazySubmodules.__init__() # Somehow without it __init__ is only called after all @lazy_submodule macroses

if (get(ENV, "LazyModules_lazyload", "") == "false")
# During compilation, it is the only way to disable lazy loading
# I don't know why `init` doesn't work
@info "Disabling lazy loading of submodules"
LazySubmodules._LAZYMODE[] = false
end

# Utils: Minimal functions with zero compilation time shared across submodules
include("utils/Utils.jl")

Expand Down

0 comments on commit 0f32590

Please sign in to comment.