Skip to content

Commit f0450fc

Browse files
c42ftopolarity
authored andcommitted
Adapt build system for in-tree JuliaSyntax
These are the simplest possible adaptions to create the vendored Base.JuliaSyntax from an in-tree version of JuliaSyntax (JuliaLowering to be hooked up later).
1 parent 6b425b3 commit f0450fc

File tree

7 files changed

+13
-30
lines changed

7 files changed

+13
-30
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ ifndef JULIA_VAGRANT_BUILD
7979
endif
8080
endif
8181

82-
TOP_LEVEL_PKGS := Compiler
82+
TOP_LEVEL_PKGS := Compiler JuliaSyntax JuliaLowering
8383

8484
TOP_LEVEL_PKG_LINK_TARGETS := $(addprefix $(build_datarootdir)/julia/,$(TOP_LEVEL_PKGS))
8585

base/Base.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,9 @@ a_method_to_overwrite_in_test() = inferencebarrier(1)
315315
@eval Core const Compiler = $Base.Compiler
316316
@eval Compiler const fl_parse = $Base.fl_parse
317317

318-
# External libraries vendored into Base
318+
# Compiler frontend
319319
Core.println("JuliaSyntax/src/JuliaSyntax.jl")
320-
include(@__MODULE__, string(BUILDROOT, "JuliaSyntax/src/JuliaSyntax.jl")) # include($BUILDROOT/base/JuliaSyntax/JuliaSyntax.jl)
320+
include(@__MODULE__, string(DATAROOT, "julia/JuliaSyntax/src/JuliaSyntax.jl"))
321321

322322
end_base_include = time_ns()
323323

base/sysimg.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,12 @@ end
153153

154154
empty!(Base.TOML_CACHE.d)
155155
Base.TOML.reinit!(Base.TOML_CACHE.p, "")
156-
@eval Base BUILDROOT = ""
156+
157+
# Clear some build-related globals (TODO: Use Base.delete_binding?)
158+
@eval Base begin
159+
DATAROOT = ""
160+
BUILDROOT = ""
161+
end
157162
@eval Sys begin
158163
BINDIR = ""
159164
STDLIB = ""

deps/JuliaSyntax.mk

Lines changed: 0 additions & 16 deletions
This file was deleted.

deps/JuliaSyntax.version

Lines changed: 0 additions & 4 deletions
This file was deleted.

deps/Makefile

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ BUILDDIR := $(BUILDDIR)$(MAYBE_HOST)
3636
# prevent installing libs into usr/lib64 on opensuse
3737
unexport CONFIG_SITE
3838

39-
DEP_LIBS := JuliaSyntax
40-
4139
ifeq ($(USE_SYSTEM_LIBBLASTRAMPOLINE), 0)
4240
DEP_LIBS += blastrampoline
4341
endif
@@ -212,7 +210,7 @@ DEP_LIBS_STAGED := $(DEP_LIBS)
212210
DEP_LIBS_STAGED_ALL := llvm llvm-tools clang llvmunwind unwind libuv pcre \
213211
openlibm dsfmt blastrampoline openblas lapack gmp mpfr patchelf utf8proc \
214212
objconv openssl libssh2 nghttp2 curl libgit2 libwhich zlib zstd p7zip csl \
215-
sanitizers libsuitesparse lld libtracyclient ittapi nvtx JuliaSyntax \
213+
sanitizers libsuitesparse lld libtracyclient ittapi nvtx \
216214
terminfo mmtk_julia
217215
DEP_LIBS_ALL := $(DEP_LIBS_STAGED_ALL)
218216

@@ -297,7 +295,4 @@ include $(SRCDIR)/terminfo.mk
297295
# MMTk
298296
include $(SRCDIR)/mmtk_julia.mk
299297

300-
# vendored Julia libs
301-
include $(SRCDIR)/JuliaSyntax.mk
302-
303298
include $(SRCDIR)/tools/uninstallers.mk

sysimage.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,12 @@ COMPILER_SRCS := $(addprefix $(JULIAHOME)/, \
7676
base/traits.jl \
7777
base/tuple.jl)
7878
COMPILER_SRCS += $(shell find $(JULIAHOME)/Compiler/src -name \*.jl -and -not -name verifytrim.jl -and -not -name show.jl)
79+
# Julia-based compiler frontend is bootstrapped into Base for now
80+
COMPILER_FRONTEND_SRCS = $(shell find $(JULIAHOME)/JuliaSyntax/src -name \*.jl)
7981
# sort these to remove duplicates
8082
BASE_SRCS := $(sort $(shell find $(JULIAHOME)/base -name \*.jl -and -not -name sysimg.jl) \
8183
$(shell find $(BUILDROOT)/base -name \*.jl -and -not -name sysimg.jl)) \
84+
$(COMPILER_FRONTEND_SRCS) \
8285
$(JULIAHOME)/Compiler/src/ssair/show.jl \
8386
$(JULIAHOME)/Compiler/src/verifytrim.jl
8487
STDLIB_SRCS := $(JULIAHOME)/base/sysimg.jl $(SYSIMG_STDLIBS_SRCS)

0 commit comments

Comments
 (0)