Skip to content

Commit

Permalink
Merge branch 'master' of github.com:JuliaLang/julia into date_name_doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Moelf committed May 14, 2019
2 parents 93483a0 + b4b4634 commit abff293
Show file tree
Hide file tree
Showing 743 changed files with 1,787 additions and 1,616 deletions.
46 changes: 22 additions & 24 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
environment:
# USEMSVC: "1"
global:
CCACHE_DIR: C:\ccache
CYG_MIRROR: http://cygwin.mirror.constant.com
CYG_CACHE: '%CYG_ROOT%\var\cache\setup'
CYG_BASH: '%CYG_ROOT%\bin\bash'

matrix:
- ARCH: "i686"
- MINGW_ARCH: "i686"
CYG_ROOT: C:\cygwin
CYG_SETUP: setup-x86.exe
JULIA_TEST_MAXRSS_MB: 500
- ARCH: "x86_64"

- MINGW_ARCH: "x86_64"
CYG_ROOT: C:\cygwin64
CYG_SETUP: setup-x86_64.exe
JULIA_TEST_MAXRSS_MB: 450

# Only build on master and PR's for now, not personal branches
Expand All @@ -30,35 +40,23 @@ notifications:
on_build_failure: false
on_build_status_changed: false

clone_depth: 50
cache:
- '%CYG_CACHE%'
- '%CCACHE_DIR%'

init:
# Carriage returns are bad
- git config --global core.autocrlf input

cache:
# Cache large downloads to avoid network unreliability
- C:\cygdownloads
- llvm-3.9.1-i686-w64-mingw32-juliadeps-r07.7z
- llvm-3.9.1-x86_64-w64-mingw32-juliadeps-r07.7z
- C:\ccache
install:
- '%CYG_ROOT%\%CYG_SETUP% -gnq -R "%CYG_ROOT%" -s "%CYG_MIRROR%" -l "%CYG_CACHE%" -P make,python2,libiconv,curl,time,p7zip,ccache,mingw64-%MINGW_ARCH%-gcc-g++,mingw64-%MINGW_ARCH%-gcc-fortran > NULL 2>&1'
- '%CYG_ROOT%\bin\cygcheck -dc cygwin'

build_script:
# If there's a newer build queued for the same PR, cancel this one
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
throw "There are newer queued builds for this pull request, failing early." }
# Remove C:\MinGW\bin from the path, the version of MinGW installed on
# AppVeyor is not compatible with the cross-compiled Julia Windows binaries
- set PATH=%PATH:C:\MinGW\bin;=%
# Remove git's msys2 from path, since it conflicts with cygwin1.dll
- set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
- ps: contrib/windows/install-cygwin.ps1
# - '"%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64'
- C:\cygwin-%ARCH%\bin\sh.exe --login /cygdrive/c/projects/julia/contrib/windows/appveyor_build.sh
- 'echo Building Julia'
- '%CYG_BASH% -lc "cd $APPVEYOR_BUILD_FOLDER && ./contrib/windows/appveyor_build.sh"'

test_script:
- 'echo Testing Julia'
- usr\bin\julia -e "Base.require(Main, :InteractiveUtils).versioninfo()"
- usr\bin\julia --sysimage-native-code=no -e "true"
- cd julia-* && .\bin\julia.exe --check-bounds=yes share\julia\test\runtests.jl all &&
Expand Down
5 changes: 1 addition & 4 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1033,10 +1033,7 @@ else ifeq ($(OS), Darwin)
RPATH_ESCAPED_ORIGIN := $(RPATH_ORIGIN)
RPATH_LIB := -Wl,-rpath,'@loader_path/julia/' -Wl,-rpath,'@loader_path/'
else
RPATH := -Wl,-rpath,'$$ORIGIN/$(build_libdir_rel)' -Wl,-rpath-link,$(build_shlibdir) -Wl,-z,origin
ifeq ($(OS), FreeBSD)
RPATH += -Wl,-rpath,'$$ORIGIN/$(build_private_libdir_rel)'
endif
RPATH := -Wl,-rpath,'$$ORIGIN/$(build_libdir_rel)' -Wl,-rpath,'$$ORIGIN/$(build_private_libdir_rel)' -Wl,-rpath-link,$(build_shlibdir) -Wl,-z,origin
RPATH_ORIGIN := -Wl,-rpath,'$$ORIGIN' -Wl,-z,origin
RPATH_ESCAPED_ORIGIN := -Wl,-rpath,'\$$\$$ORIGIN' -Wl,-z,origin -Wl,-rpath-link,$(build_shlibdir)
RPATH_LIB := -Wl,-rpath,'$$ORIGIN/julia' -Wl,-rpath,'$$ORIGIN' -Wl,-z,origin
Expand Down
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -462,10 +462,10 @@ ifeq ($(OS), WINNT)
cd $(BUILDROOT)/julia-$(JULIA_COMMIT) && find * | sed -e 's/\//\\/g' -e 's/$$/\r/g' > etc/uninstall.log

# build nsis package
cd $(BUILDROOT) && $(call spawn,$(JULIAHOME)/dist-extras/nsis/makensis.exe) -NOCD -DVersion=$(JULIA_VERSION) -DArch=$(ARCH) -DCommit=$(JULIA_COMMIT) -DMUI_ICON="$(call cygpath_w,$(JULIAHOME)/contrib/windows/julia.ico)" $(call cygpath_w,$(JULIAHOME)/contrib/windows/build-installer.nsi) | iconv -f latin1
cd $(BUILDROOT) && $(call spawn,$(JULIAHOME)/dist-extras/nsis/makensis.exe) -NOCD -DVersion=$(JULIA_VERSION) -DArch=$(ARCH) -DCommit=$(JULIA_COMMIT) -DJULIAHOME="$(call cygpath_w,$(JULIAHOME))" $(call cygpath_w,$(JULIAHOME)/contrib/windows/build-installer.nsi) | iconv -f latin1

# compress nsis installer and combine with 7zip self-extracting header
cd $(BUILDROOT) && $(JULIAHOME)/dist-extras/7z a -mx9 "julia-install-$(JULIA_COMMIT)-$(ARCH).7z" julia-installer.exe
cd $(BUILDROOT) && $(JULIAHOME)/dist-extras/7z a -mx=9 "julia-install-$(JULIA_COMMIT)-$(ARCH).7z" julia-installer.exe
cd $(BUILDROOT) && cat $(JULIAHOME)/contrib/windows/7zS.sfx $(JULIAHOME)/contrib/windows/7zSFX-config.txt "julia-install-$(JULIA_COMMIT)-$(ARCH).7z" > "$(JULIA_BINARYDIST_FILENAME).exe"
chmod a+x "$(BUILDROOT)/$(JULIA_BINARYDIST_FILENAME).exe"
-rm -f $(BUILDROOT)/julia-install-$(JULIA_COMMIT)-$(ARCH).7z
Expand Down Expand Up @@ -593,29 +593,29 @@ endif
endif
ifneq (,$(filter $(ARCH), i386 i486 i586 i686))
cd $(JULIAHOME)/dist-extras && \
$(JLDOWNLOAD) http://downloads.sourceforge.net/sevenzip/7z1900.exe && \
$(JLDOWNLOAD) https://sourceforge.net/projects/sevenzip/files/7-Zip/19.00/7z1900.exe && \
$(JLCHECKSUM) 7z1900.exe && \
7z x -y 7z1900.exe 7z.exe 7z.dll && \
../contrib/windows/winrpm.sh http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Leap_42.2 \
"mingw32-libexpat1 mingw32-zlib1" && \
cp usr/i686-w64-mingw32/sys-root/mingw/bin/*.dll .
else ifeq ($(ARCH),x86_64)
cd $(JULIAHOME)/dist-extras && \
$(JLDOWNLOAD) 7z1900-x64.msi http://downloads.sourceforge.net/sevenzip/7z1900-x64.msi && \
7z x -y 7z1900-x64.msi _7z.exe _7z.dll && \
mv _7z.dll 7z.dll && \
mv _7z.exe 7z.exe && \
$(JLDOWNLOAD) https://downloads.sourceforge.net/project/sevenzip/7-Zip/19.00/7z1900-x64.exe && \
$(JLCHECKSUM) 7z1900-x64.exe && \
7z x -y 7z1900-x64.exe 7z.exe 7z.dll && \
../contrib/windows/winrpm.sh http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_Leap_42.2 \
"mingw64-libexpat1 mingw64-zlib1" && \
cp usr/x86_64-w64-mingw32/sys-root/mingw/bin/*.dll .
else
$(error no win-extras target for ARCH=$(ARCH))
endif
cd $(JULIAHOME)/dist-extras && \
$(JLDOWNLOAD) http://downloads.sourceforge.net/sevenzip/7z1900-extra.7z && \
$(JLDOWNLOAD) https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/unsis/nsis-2.46.5-Unicode-setup.exe && \
$(JLDOWNLOAD) https://sourceforge.net/projects/nsis/files/NSIS%203/3.04/nsis-3.04-setup.exe && \
$(JLCHECKSUM) nsis-3.04-setup.exe && \
chmod a+x 7z.exe && \
chmod a+x 7z.dll && \
$(call spawn,./7z.exe) x -y -onsis nsis-2.46.5-Unicode-setup.exe && \
$(call spawn,./7z.exe) x -y -onsis nsis-3.04-setup.exe && \
chmod a+x ./nsis/makensis.exe

# various statistics about the build that may interest the user
Expand Down
44 changes: 4 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ helpful to start contributing to the Julia codebase.

If you would rather not compile the latest Julia from source,
platform-specific tarballs with pre-compiled binaries are also
[available for download](https://julialang.org/downloads/).
[available for download](https://julialang.org/downloads/). The
downloads page also provides details on the
[different tiers of support](https://julialang.org/downloads/#support-tiers)
for OS and platform combinations.

If everything works correctly, you will see a Julia banner and an
interactive prompt into which you can enter expressions for
Expand All @@ -64,45 +67,6 @@ installations are neither maintained nor endorsed by the Julia
project. They may be outdated, broken and/or unmaintained. We
recommend you use the official Julia binaries instead.

## Currently Supported Platforms

| Operating System | Architecture | CI | Binaries | Support Level |
|:----------------:|:----------------:|:--:|:--------:|:-------------:|
| macOS 10.8+ | x86-64 (64-bit) ||| Tier 1 |
| Windows 7+ | x86-64 (64-bit) ||| Tier 1 |
| | i686 (32-bit) ||| Tier 1 |
| FreeBSD 11.0+ | x86-64 (64-bit) | [](https://build.julialang.org/#/builders/68) || Tier 1 |
| Linux 2.6.18+ | x86-64 (64-bit) ||| Tier 1 |
| | i686 (32-bit) ||| Tier 1 |
| | ARM v7 (32-bit) | | | Tier 3 |
| | ARM v8 (64-bit) | | | Tier 3 |
| | x86-64 musl libc | | | Tier 3 |
| | PowerPC (64-bit) | | | Tier 4 |
| | PTX (64-bit) | [](https://gitlab.com/JuliaGPU/CUDAnative.jl/pipelines) | | [External](https://github.com/JuliaGPU/CUDAnative.jl) |

All systems marked with ✓ for CI are tested using continuous integration for every commit.
Systems with ✓ for binaries have official binaries available on the
[downloads](https://julialang.org/downloads) page and are tested regularly.
The PTX backend is supported by the [JuliaGPU](https://github.com/JuliaGPU) organization and
requires the [CUDAnative.jl](https://github.com/JuliaGPU/CUDAnative.jl) package.

### Support Tiers

* Tier 1: Julia is guaranteed to build from source and pass all tests on these platforms
when built with default options. Official binaries are available for releases and CI is
run on every commit.

* Tier 2: Julia is guaranteed to build from source using default build options, but may
or may not pass all tests. Official binaries are available on a case-by-case basis.

* Tier 3: Julia may or may not build. If it does, it is unlikely to pass tests.

* Tier 4: Julia is known not to build.

It is possible that Julia will build and work on other platforms too,
and we're always looking to improve our platform coverage. If you're
using Julia on a platform not listed here, let us know!

## Building Julia

First, make sure you have all the [required
Expand Down
6 changes: 3 additions & 3 deletions base/compiler/abstractinterpretation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ function abstract_call_method(method::Method, @nospecialize(sig), sparams::Simpl
# we have a self-cycle in the call-graph, but not in the inference graph (typically):
# break this edge now (before we record it) by returning early
# (non-typically, this means that we lose the ability to detect a guaranteed StackOverflow in some cases)
return Any, false, nothing
return Any, true, nothing
end
topmost = nothing
edgecycle = true
Expand Down Expand Up @@ -339,7 +339,7 @@ function abstract_call_method(method::Method, @nospecialize(sig), sparams::Simpl
# since it's very unlikely that we'll try to inline this,
# or want make an invoke edge to its calling convention return type.
# (non-typically, this means that we lose the ability to detect a guaranteed StackOverflow in some cases)
return Any, false, nothing
return Any, true, nothing
end
poison_callstack(sv, topmost::InferenceState, true)
sig = newsig
Expand Down Expand Up @@ -547,7 +547,7 @@ function abstract_apply(@nospecialize(aft), aargtypes::Vector{Any}, vtypes::VarT
tail = tuple_tail_elem(unwrapva(ct[end]), cti)
push!(ctypes´, push!(ct[1:(end - 1)], tail))
else
push!(ctypes´, append_any(ct, cti))
push!(ctypes´, append!(ct[:], cti))
end
end
end
Expand Down
53 changes: 29 additions & 24 deletions base/compiler/tfuncs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -302,33 +302,37 @@ function sizeof_nothrow(@nospecialize(x))
else
x = widenconst(x)
end
isconstType(x) && (x = x.parameters[1])
if isa(x, Union)
return sizeof_nothrow(x.a) && sizeof_nothrow(x.b)
end
isconstType(x) && (x = x.parameters[1]) # since sizeof(typeof(x)) == sizeof(x)
x === DataType && return false
return isconcretetype(x)
return isconcretetype(x) || isprimitivetype(x)
end
function _const_sizeof(@nospecialize(x))
# Constant Vector does not have constant size
isa(x, Vector) && return Int
size = try
Core.sizeof(x)
catch ex
# Might return
# "argument is an abstract type; size is indeterminate" or
# "type does not have a fixed size"
isa(ex, ErrorException) || rethrow()
return Int
end
Core.sizeof(x)
catch ex
# Might return
# "argument is an abstract type; size is indeterminate" or
# "type does not have a fixed size"
isa(ex, ErrorException) || rethrow()
return Int
end
return Const(size)
end
function sizeof_tfunc(@nospecialize(x),)
isa(x, Const) && return _const_sizeof(x.val)
isa(x, Conditional) && return _const_sizeof(Bool)
isconstType(x) && return _const_sizeof(x.parameters[1])
x = widenconst(x)
if isa(x, Union)
return tmerge(sizeof_tfunc(x.a), sizeof_tfunc(x.b))
end
x !== DataType && isconcretetype(x) && return _const_sizeof(x)
isprimitivetype(x) && return _const_sizeof(x)
return Int
end
add_tfunc(Core.sizeof, 1, 1, sizeof_tfunc, 0)
Expand All @@ -338,7 +342,7 @@ function nfields_tfunc(@nospecialize(x))
x = widenconst(x)
if isa(x, DataType) && !x.abstract && !(x.name === Tuple.name && isvatuple(x))
if !(x.name === _NAMEDTUPLE_NAME && !isconcretetype(x))
return Const(length(x.types))
return Const(isdefined(x, :types) ? length(x.types) : length(x.name.names))
end
end
return Int
Expand Down Expand Up @@ -588,7 +592,7 @@ function fieldcount_noerror(@nospecialize t)
if abstr
return nothing
end
return length(t.types)
return isdefined(t, :types) ? length(t.types) : length(t.name.names)
end


Expand Down Expand Up @@ -744,7 +748,8 @@ function getfield_tfunc(@nospecialize(s00), @nospecialize(name))
# TODO: better approximate inference
return Any
end
if isempty(s.types)
ftypes = datatype_fieldtypes(s)
if isempty(ftypes)
return Bottom
end
if isa(name, Conditional)
Expand All @@ -754,27 +759,27 @@ function getfield_tfunc(@nospecialize(s00), @nospecialize(name))
if !(Int <: name || Symbol <: name)
return Bottom
end
if length(s.types) == 1
return rewrap_unionall(unwrapva(s.types[1]), s00)
if length(ftypes) == 1
return rewrap_unionall(unwrapva(ftypes[1]), s00)
end
# union together types of all fields
t = Bottom
for _ft in s.types
for _ft in ftypes
t = tmerge(t, rewrap_unionall(unwrapva(_ft), s00))
t === Any && break
end
return t
end
fld = name.val
if isa(fld,Symbol)
if isa(fld, Symbol)
fld = fieldindex(s, fld, false)
end
if !isa(fld,Int)
if !isa(fld, Int)
return Bottom
end
nf = length(s.types)
if s <: Tuple && fld >= nf && isvarargtype(s.types[nf])
return rewrap_unionall(unwrapva(s.types[nf]), s00)
nf = length(ftypes)
if s <: Tuple && fld >= nf && isvarargtype(ftypes[nf])
return rewrap_unionall(unwrapva(ftypes[nf]), s00)
end
if fld < 1 || fld > nf
return Bottom
Expand All @@ -790,7 +795,7 @@ function getfield_tfunc(@nospecialize(s00), @nospecialize(name))
t = const_datatype_getfield_tfunc(sp, fld)
t !== nothing && return t
end
R = s.types[fld]
R = ftypes[fld]
if isempty(s.parameters)
return R
end
Expand Down Expand Up @@ -843,7 +848,7 @@ function _fieldtype_nothrow(@nospecialize(s), exact::Bool, name::Const)
fld = fieldindex(u, fld, false)
end
isa(fld, Int) || return false
ftypes = u.types
ftypes = datatype_fieldtypes(u)
nf = length(ftypes)
(fld >= 1 && fld <= nf) || return false
if u.name === Tuple.name && fld >= nf && isvarargtype(ftypes[nf])
Expand Down Expand Up @@ -893,7 +898,7 @@ function _fieldtype_tfunc(@nospecialize(s), exact::Bool, @nospecialize(name))
# TODO: better approximate inference
return Type
end
ftypes = u.types
ftypes = datatype_fieldtypes(u)
if isempty(ftypes)
return Bottom
end
Expand Down
23 changes: 23 additions & 0 deletions base/docs/basedocs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,29 @@ end
"""
kw"module"

"""
__init__
`__init__()` function in your module would executes immediately *after* the module is loaded at
runtime for the first time (i.e., it is only called once and only after all statements in the
module have been executed). Because it is called *after* fully importing the module, `__init__`
functions of submodules will be executed *first*. Two typical uses of __init__ are calling
runtime initialization functions of external C libraries and initializing global constants
that involve pointers returned by external libraries.
See the [manual section about modules](@ref modules) for more details.
# Examples
```julia
const foo_data_ptr = Ref{Ptr{Cvoid}}(0)
function __init__()
ccall((:foo_init, :libfoo), Cvoid, ())
foo_data_ptr[] = ccall((:foo_data, :libfoo), Ptr{Cvoid}, ())
nothing
end
```
"""
kw"__init__"

"""
baremodule
Expand Down
Loading

0 comments on commit abff293

Please sign in to comment.