Skip to content

Commit

Permalink
Rename ui to cli
Browse files Browse the repository at this point in the history
  • Loading branch information
staticfloat committed Jul 8, 2020
1 parent add97a7 commit fbcbac7
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ Note: These instructions are for adding to or improving functionality in the bas
Add new code to Julia's base libraries as follows (this is the "basic" approach; see a more efficient approach in the next section):
1. Edit the appropriate file in the `base/` directory, or add new files if necessary. Create tests for your functionality and add them to files in the `test/` directory. If you're editing C or Scheme code, most likely it lives in `src/` or one of its subdirectories, although some aspects of Julia's REPL initialization live in `ui/`.
1. Edit the appropriate file in the `base/` directory, or add new files if necessary. Create tests for your functionality and add them to files in the `test/` directory. If you're editing C or Scheme code, most likely it lives in `src/` or one of its subdirectories, although some aspects of Julia's REPL initialization live in `cli/`.
2. Add any new files to `sysimg.jl` in order to build them into the Julia system image.
Expand Down
2 changes: 1 addition & 1 deletion HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4860,7 +4860,7 @@ New language features
shell. For example:
julia> ;ls
CONTRIBUTING.md Makefile VERSION deps/ julia@ ui/
CONTRIBUTING.md Makefile VERSION cli/ deps/ julia@
DISTRIBUTING.md NEWS.md Windows.inc doc/ src/ usr/
LICENSE.md README.md base/ etc/ test/
Make.inc README.windows.md contrib/ examples/ tmp/
Expand Down
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ all: debug release
# sort is used to remove potential duplicates
DIRS := $(sort $(build_bindir) $(build_depsbindir) $(build_libdir) $(build_private_libdir) $(build_libexecdir) $(build_includedir) $(build_includedir)/julia $(build_sysconfdir)/julia $(build_datarootdir)/julia $(build_datarootdir)/julia/stdlib $(build_man1dir))
ifneq ($(BUILDROOT),$(JULIAHOME))
BUILDDIRS := $(BUILDROOT) $(addprefix $(BUILDROOT)/,base src src/flisp src/support src/clangsa ui doc deps stdlib test test/embedding test/llvmpasses)
BUILDDIRS := $(BUILDROOT) $(addprefix $(BUILDROOT)/,base src src/flisp src/support src/clangsa cli doc deps stdlib test test/embedding test/llvmpasses)
BUILDDIRMAKE := $(addsuffix /Makefile,$(BUILDDIRS)) $(BUILDROOT)/sysimage.mk
DIRS := $(DIRS) $(BUILDDIRS)
$(BUILDDIRMAKE): | $(BUILDDIRS)
Expand Down Expand Up @@ -46,7 +46,7 @@ julia_flisp.boot.inc.phony: julia-deps
$(BUILDROOT)/doc/_build/html/en/index.html: $(shell find $(BUILDROOT)/base $(BUILDROOT)/doc \( -path $(BUILDROOT)/doc/_build -o -path $(BUILDROOT)/doc/deps -o -name *_constants.jl -o -name *_h.jl -o -name version_git.jl \) -prune -o -type f -print)
@$(MAKE) docs

julia-symlink: julia-ui-$(JULIA_BUILD_MODE)
julia-symlink: julia-cli-$(JULIA_BUILD_MODE)
ifeq ($(OS),WINNT)
@echo '@"%~dp0"\'"$$(echo $(call rel_path,$(BUILDROOT),$(JULIA_EXECUTABLE)) | tr / '\\')" '%*' > $(BUILDROOT)/julia.bat
chmod a+x $(BUILDROOT)/julia.bat
Expand Down Expand Up @@ -74,16 +74,16 @@ julia-libllvmcalltest: julia-deps
julia-src-release julia-src-debug : julia-src-% : julia-deps julia_flisp.boot.inc.phony
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/src libjulia-$*

julia-ui-release julia-ui-debug : julia-ui-% : julia-src-%
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/ui julia-$*
julia-cli-release julia-cli-debug : julia-cli-% : julia-src-%
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/cli julia-$*

julia-sysimg-ji : julia-stdlib julia-base julia-ui-$(JULIA_BUILD_MODE) | $(build_private_libdir)
julia-sysimg-ji : julia-stdlib julia-base julia-cli-$(JULIA_BUILD_MODE) | $(build_private_libdir)
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) -f sysimage.mk sysimg-ji JULIA_EXECUTABLE='$(JULIA_EXECUTABLE)'

julia-sysimg-bc : julia-stdlib julia-base julia-ui-$(JULIA_BUILD_MODE) | $(build_private_libdir)
julia-sysimg-bc : julia-stdlib julia-base julia-cli-$(JULIA_BUILD_MODE) | $(build_private_libdir)
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) -f sysimage.mk sysimg-bc JULIA_EXECUTABLE='$(JULIA_EXECUTABLE)'

julia-sysimg-release julia-sysimg-debug : julia-sysimg-% : julia-sysimg-ji julia-ui-%
julia-sysimg-release julia-sysimg-debug : julia-sysimg-% : julia-sysimg-ji julia-cli-%
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) -f sysimage.mk sysimg-$*

julia-debug julia-release : julia-% : julia-sysimg-% julia-symlink julia-libccalltest julia-libllvmcalltest julia-base-cache
Expand Down Expand Up @@ -528,7 +528,7 @@ clean: | $(CLEAN_TARGETS)
@-$(MAKE) -C $(BUILDROOT)/base clean
@-$(MAKE) -C $(BUILDROOT)/doc clean
@-$(MAKE) -C $(BUILDROOT)/src clean
@-$(MAKE) -C $(BUILDROOT)/ui clean
@-$(MAKE) -C $(BUILDROOT)/cli clean
@-$(MAKE) -C $(BUILDROOT)/test clean
@-$(MAKE) -C $(BUILDROOT)/stdlib clean
-rm -f $(BUILDROOT)/julia
Expand All @@ -552,7 +552,7 @@ distcleanall: cleanall

.PHONY: default debug release check-whitespace release-candidate \
julia-debug julia-release julia-stdlib julia-deps julia-deps-libs \
julia-ui-release julia-ui-debug julia-src-release julia-src-debug \
julia-cli-release julia-cli-debug julia-src-release julia-src-debug \
julia-symlink julia-base julia-sysimg julia-sysimg-ji julia-sysimg-release julia-sysimg-debug \
test testall testall1 test test-* test-revise-* \
clean distcleanall cleanall clean-* \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ The Julia source code is organized as follows:
doc/build detailed notes for building Julia
src/ source for Julia language core
test/ test suites
ui/ source for various front ends
cli/ source for the command line interface/REPL
usr/ binaries and shared libraries loaded by Julia's standard libraries

## Terminal, Editors and IDEs
Expand Down
File renamed without changes.
18 changes: 9 additions & 9 deletions ui/Makefile → cli/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ override CFLAGS += $(JCFLAGS)
override CXXFLAGS += $(JCXXFLAGS)
override CPPFLAGS += $(JCPPFLAGS)

SRCS := repl
SRCS := cli

HEADERS := $(addprefix $(JULIAHOME)/src/,julia.h julia_assert.h julia_threads.h julia_internal.h options.h) \
$(BUILDDIR)/../src/julia_version.h $(wildcard $(JULIAHOME)/src/support/*.h) $(LIBUV_INC)/uv.h
Expand Down Expand Up @@ -82,10 +82,10 @@ else
CXXLD := $(LD)
endif

$(build_shlibdir)/libjuliarepl.$(JL_MAJOR_MINOR_SHLIB_EXT): $(OBJS)
$(build_shlibdir)/libjuliacli.$(JL_MAJOR_MINOR_SHLIB_EXT): $(OBJS)
@$(call PRINT_LINK, $(CXXLD) -shared $(CXXFLAGS) $(CXXLDFLAGS) $(LINK_FLAGS) $(SHIPFLAGS) $(OBJS) -o $@ -L$(build_private_libdir) -L$(build_libdir) -L$(build_shlibdir) -ljulia $(JLDFLAGS) $(CXXLDFLAGS))

$(build_shlibdir)/libjuliarepl-debug.$(JL_MAJOR_MINOR_SHLIB_EXT): $(DOBJS)
$(build_shlibdir)/libjuliacli-debug.$(JL_MAJOR_MINOR_SHLIB_EXT): $(DOBJS)
@$(call PRINT_LINK, $(CXXLD) -shared $(CXXFLAGS) $(CXXLDFLAGS) $(LINK_FLAGS) $(DEBUGFLAGS) $(DOBJS) -o $@ -L$(build_private_libdir) -L$(build_libdir) -L$(build_shlibdir) -ljulia-debug $(JLDFLAGS) $(CXXLDFLAGS))


Expand All @@ -105,17 +105,17 @@ LOADER_LDFLAGS :=
# Eventually, these will live in separate artifacts
LIBGCC_DEPLIB := $(word 1,$(wildcard $(build_shlibdir)/libgcc*.$(SHLIB_EXT)*))
LIBLLVM_DEPLIB := $(word 1,$(wildcard $(build_shlibdir)/libLLVM*jl.$(SHLIB_EXT)*))
LIBJULIAREPL_DEPLIB := $(build_shlibdir)/libjuliarepl.$(JL_MAJOR_MINOR_SHLIB_EXT)
LIBJULIAREPL_DEBUG_DEPLIB := $(build_shlibdir)/libjuliarepl-debug.$(JL_MAJOR_MINOR_SHLIB_EXT)
LIBJULIACLI_DEPLIB := $(build_shlibdir)/libjuliacli.$(JL_MAJOR_MINOR_SHLIB_EXT)
LIBJULIACLI_DEBUG_DEPLIB := $(build_shlibdir)/libjuliacli-debug.$(JL_MAJOR_MINOR_SHLIB_EXT)

# Build list of dependent libraries
LOADER_CFLAGS += -DDEP_LIBS="$(call dep_libs_gen,$(LIBGCC_DEPLIB)),\
$(call dep_libs_gen,$(LIBLLVM_DEPLIB)),\
$(call dep_libs_gen,$(LIBJULIAREPL_DEPLIB))"
$(call dep_libs_gen,$(LIBJULIACLI_DEPLIB))"

LOADER_DEBUG_CFLAGS += -DDEP_LIBS="$(call dep_libs_gen,$(LIBGCC_DEPLIB)),\
$(call dep_libs_gen,$(LIBLLVM_DEPLIB)),\
$(call dep_libs_gen,$(LIBJULIAREPL_DEBUG_DEPLIB))"
$(call dep_libs_gen,$(LIBJULIACLI_DEBUG_DEPLIB))"


ifeq ($(OS),WINNT)
Expand All @@ -139,10 +139,10 @@ $(BUILDDIR)/loader.dbg.obj: $(SRCDIR)/loader.c $(HEADERS)
@$(call PRINT_CC, $(CC) $(LOADER_CFLAGS) $(CPPFLAGS) $(CFLAGS) $(DEBUGFLAGS) -c $< -o $@)


$(build_bindir)/julia$(EXE): $(BUILDDIR)/loader.o $(build_shlibdir)/libjuliarepl.$(JL_MAJOR_MINOR_SHLIB_EXT)
$(build_bindir)/julia$(EXE): $(BUILDDIR)/loader.o $(build_shlibdir)/libjuliacli.$(JL_MAJOR_MINOR_SHLIB_EXT)
@$(call PRINT_LINK, $(CXXLD) $(LOADER_CFLAGS) $< -o $@ $(LOADER_LDFLAGS) $(LDFLAGS))

$(build_bindir)/julia-debug$(EXE): $(BUILDDIR)/loader.dbg.obj $(build_shlibdir)/libjuliarepl.$(JL_MAJOR_MINOR_SHLIB_EXT)
$(build_bindir)/julia-debug$(EXE): $(BUILDDIR)/loader.dbg.obj $(build_shlibdir)/libjuliacli.$(JL_MAJOR_MINOR_SHLIB_EXT)
@$(call PRINT_LINK, $(CXXLD) $(LOADER_DEBUG_CFLAGS) $< -o $@ $(LOADER_LDFLAGS) $(LDFLAGS))


Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion contrib/mac/framework/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ endif
#NB: must be the last lines of the recipe, else signature may be invalidated.

# Codesign should look at the embedded Info.plist to get the signing identifier.
# See JLDFLAGS in Make.inc for Darwin platform and Info.plist target in ui/Makefile.
# See JLDFLAGS in Make.inc for Darwin platform and Info.plist target in cli/Makefile.
codesign -s "$(DARWIN_CODESIGN_KEYCHAIN_IDENTITY)" -v $(darwin_codesign_options) $(darwin_codesign_julia_options) $(DESTDIR)$(prefix)/$(framework_helpers)/julia
ifeq ($(BUNDLE_DEBUG_LIBS),1)
codesign -s "$(DARWIN_CODESIGN_KEYCHAIN_IDENTITY)" -v $(darwin_codesign_options) $(darwin_codesign_julia_options) $(DESTDIR)$(prefix)/$(framework_helpers)/julia-debug
Expand Down
2 changes: 1 addition & 1 deletion doc/build/windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ zypper -n install mingw$BITS-cross-gcc-c++ mingw$BITS-cross-gcc-fortran \
cp /usr/$XC_HOST/sys-root/mingw/bin/*.dll /usr/lib*/gcc/$XC_HOST/*/
git clone git://github.com/JuliaLang/julia.git julia
cd julia
make -j4 win-extras julia-ui-release
make -j4 win-extras julia-cli-release
export WINEDEBUG=-all # suppress wine fixme's
# this last step may need to be run interactively
make -j4 binary-dist
Expand Down
2 changes: 1 addition & 1 deletion doc/src/devdocs/eval.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function, and primitive function, before turning into the desired result (hopefu
The 10,000 foot view of the whole process is as follows:

1. The user starts `julia`.
2. The C function `main()` from `ui/repl.c` gets called. This function processes the command line
2. The C function `main()` from `cli/cli.c` gets called. This function processes the command line
arguments, filling in the `jl_options` struct and setting the variable `ARGS`. It then initializes
Julia (by calling [`julia_init` in `task.c`](https://github.com/JuliaLang/julia/blob/master/src/task.c),
which may load a previously compiled [sysimg](@ref dev-sysimg)). Finally, it passes off control to Julia
Expand Down
10 changes: 5 additions & 5 deletions doc/src/devdocs/init.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ How does the Julia runtime execute `julia -e 'println("Hello World!")'` ?

## `main()`

Execution starts at [`main()` in `ui/repl.c`](https://github.com/JuliaLang/julia/blob/master/ui/repl.c).
Execution starts at [`main()` in `cli/loader.c`](https://github.com/JuliaLang/julia/blob/master/cli/loader.c), which loads a few libraries, eventually calling [`fake_main()` in `cli/cli.c`](https://github.com/JuliaLang/julia/blob/master/cli/cli.c).

`main()` calls [`libsupport_init()`](https://github.com/JuliaLang/julia/blob/master/src/support/libsupportinit.c)
`fake_main()` calls [`libsupport_init()`](https://github.com/JuliaLang/julia/blob/master/src/support/libsupportinit.c)
to set the C library locale and to initialize the "ios" library (see [`ios_init_stdstreams()`](https://github.com/JuliaLang/julia/blob/master/src/support/ios.c)
and [Legacy `ios.c` library](@ref)).

Expand Down Expand Up @@ -123,7 +123,7 @@ each deserialized module to run the `__init__()` function.
Finally [`sigint_handler()`](https://github.com/JuliaLang/julia/blob/master/src/signals-unix.c)
is hooked up to `SIGINT` and calls `jl_throw(jl_interrupt_exception)`.
`_julia_init()` then returns [back to `main()` in `ui/repl.c`](https://github.com/JuliaLang/julia/blob/master/ui/repl.c)
`_julia_init()` then returns [back to `main()` in `cli/cli.c.c`](https://github.com/JuliaLang/julia/blob/master/cli/cli.c.c)
and `main()` calls `true_main(argc, (char**)argv)`.
!!! sidebar "sysimg"
Expand All @@ -139,10 +139,10 @@ and `main()` calls `true_main(argc, (char**)argv)`.
## `true_main()`
[`true_main()`](https://github.com/JuliaLang/julia/blob/master/ui/repl.c) loads the contents of
[`true_main()`](https://github.com/JuliaLang/julia/blob/master/cli/cli.c.c) loads the contents of
`argv[]` into [`Base.ARGS`](@ref).
If a `.jl` "program" file was supplied on the command line, then [`exec_program()`](https://github.com/JuliaLang/julia/blob/master/ui/repl.c)
If a `.jl` "program" file was supplied on the command line, then [`exec_program()`](https://github.com/JuliaLang/julia/blob/master/cli/cli.c.c)
calls [`jl_load(program,len)`](https://github.com/JuliaLang/julia/blob/master/src/toplevel.c) which
calls [`jl_parse_eval_all`](https://github.com/JuliaLang/julia/blob/master/src/ast.c) which repeatedly
calls [`jl_toplevel_eval_flex()`](https://github.com/JuliaLang/julia/blob/master/src/toplevel.c)
Expand Down
2 changes: 1 addition & 1 deletion doc/src/devdocs/stdio.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ int jl_printf(uv_stream_t *s, const char *format, ...);
int jl_vprintf(uv_stream_t *s, const char *format, va_list args);
```
These `printf` functions are used by the `.c` files in the `src/` and `ui/` directories wherever stdio is
These `printf` functions are used by the `.c` files in the `src/` and `cli/` directories wherever stdio is
needed to ensure that output buffering is handled in a unified way.
In special cases, like signal handlers, where the full libuv infrastructure is too heavy, `jl_safe_printf()`
Expand Down
2 changes: 1 addition & 1 deletion doc/src/manual/embedding.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ gcc -o test -fPIC -I$JULIA_DIR/include/julia -L$JULIA_DIR/lib -Wl,-rpath,$JULIA_
```
Alternatively, look at the `embedding.c` program in the Julia source tree in the `test/embedding/` folder.
The file `ui/repl.c` program is another simple example of how to set `jl_options` options while
The file `cli/cli.c` program is another simple example of how to set `jl_options` options while
linking against `libjulia`.
The first thing that has to be done before calling any other Julia C function is to initialize
Expand Down

0 comments on commit fbcbac7

Please sign in to comment.