Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MISTAKE] #21282

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ script:
- export JULIA_CPU_CORES=2 && export JULIA_TEST_MAXRSS_MB=600 &&
cd /tmp/julia/share/julia/test &&
/tmp/julia/bin/julia --check-bounds=yes runtests.jl $TESTSTORUN &&
/tmp/julia/bin/julia --check-bounds=yes runtests.jl libgit2-online pkg
/tmp/julia/bin/julia --check-bounds=yes runtests.jl libgit2-online download pkg
- cd `dirname $TRAVIS_BUILD_DIR` && mv julia2 julia &&
rm -f julia/deps/scratch/libgit2-*/CMakeFiles/CMakeOutput.log
# uncomment the following if failures are suspected to be due to the out-of-memory killer
Expand Down
7 changes: 4 additions & 3 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Julia includes code from the following projects, which have their own licenses:
- [MUSL](http://git.musl-libc.org/cgit/musl/tree/COPYRIGHT) (for getopt implementation on Windows) [MIT]
- [MINGW](https://sourceforge.net/p/mingw/mingw-org-wsl/ci/legacy/tree/mingwrt/mingwex/dirname.c) (for dirname implementation on Windows) [MIT]
- [NetBSD](http://www.netbsd.org/about/redistribution.html) (for setjmp, longjmp, and strptime implementations on Windows) [BSD-3]
- [Python](https://docs.python.org/2/license.html) (for strtod implementation on Windows) [BSD-3, effectively]
- [randmtzig.c](https://github.com/JuliaLang/julia/blob/master/test/perf/micro/randmtzig.c) for Gaussian random number generation (for C benchmarks only) [BSD-3]

The Julia language links to the following external libraries, which have their
Expand Down Expand Up @@ -70,9 +71,9 @@ their own licenses:

The following components of Julia's standard library have separate licenses:

- base/fftw.jl (see [FFTW](http://fftw.org/doc/License-and-Copyright.html))
- base/linalg/umfpack.jl (see [SUITESPARSE](http://faculty.cse.tamu.edu/davis/suitesparse.html))
- base/linalg/cholmod.jl (see [SUITESPARSE](http://faculty.cse.tamu.edu/davis/suitesparse.html))
- base/grisu/* (see [double-conversion](https://github.com/google/double-conversion/blob/master/LICENSE))
- base/sparse/umfpack.jl (see [SUITESPARSE](http://faculty.cse.tamu.edu/davis/suitesparse.html))
- base/sparse/cholmod.jl (see [SUITESPARSE](http://faculty.cse.tamu.edu/davis/suitesparse.html))
- base/special/exp.jl (see [FREEBSD MSUN](https://github.com/freebsd/freebsd) [FreeBSD/2-clause BSD/Simplified BSD License])


Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@ Julia uses the following external libraries, which are automatically downloaded
[FemtoLisp]: https://github.com/JeffBezanson/femtolisp
[GMP]: http://gmplib.org
[MPFR]: http://www.mpfr.org
[double-conversion]: http://double-conversion.googlecode.com
[libuv]: https://github.com/JuliaLang/libuv
[libgit2]: https://libgit2.github.com/
[utf8proc]: http://julialang.org/utf8proc/
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.6.0-pre.alpha
0.6.0-pre.beta
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ test_script:
- usr\bin\julia -e "versioninfo()"
- usr\bin\julia --precompiled=no -e "true"
- cd test && ..\usr\bin\julia --check-bounds=yes runtests.jl all &&
..\usr\bin\julia --check-bounds=yes runtests.jl libgit2-online pkg
..\usr\bin\julia --check-bounds=yes runtests.jl libgit2-online download pkg
4 changes: 2 additions & 2 deletions base/channels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ julia> take!(c)
julia> put!(c,1);
ERROR: foo
Stacktrace:
[1] check_channel_state(::Channel{Any}) at ./channels.jl:125
[2] put!(::Channel{Any}, ::Int64) at ./channels.jl:256
[1] check_channel_state(::Channel{Any}) at ./channels.jl:127
[2] put!(::Channel{Any}, ::Int64) at ./channels.jl:258
```
"""
function bind(c::Channel, task::Task)
Expand Down
6 changes: 3 additions & 3 deletions base/datafmt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ function store_cell{T}(dlmstore::DLMStore{T}, row::Int, col::Int,
end
if quoted
startpos += 1
endpos -= 1
endpos = prevind(sbuff, endpos)
end

if drow > 0
Expand All @@ -263,7 +263,7 @@ function store_cell{T}(dlmstore::DLMStore{T}, row::Int, col::Int,
# fill data
if quoted && _chrinstr(sbuff, UInt8('"'), startpos, endpos)
unescaped = replace(SubString(sbuff, startpos, endpos), r"\"\"", "\"")
fail = colval(unescaped, 1, length(unescaped), cells, drow, col)
fail = colval(unescaped, 1, endof(unescaped), cells, drow, col)
else
fail = colval(sbuff, startpos, endpos, cells, drow, col)
end
Expand All @@ -282,7 +282,7 @@ function store_cell{T}(dlmstore::DLMStore{T}, row::Int, col::Int,
# fill header
if quoted && _chrinstr(sbuff, UInt8('"'), startpos, endpos)
unescaped = replace(SubString(sbuff, startpos, endpos), r"\"\"", "\"")
colval(unescaped, 1, length(unescaped), dlmstore.hdr, 1, col)
colval(unescaped, 1, endof(unescaped), dlmstore.hdr, 1, col)
else
colval(sbuff, startpos, endpos, dlmstore.hdr, 1, col)
end
Expand Down
11 changes: 10 additions & 1 deletion base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1138,8 +1138,17 @@ end
@deprecate revparse(repo::GitRepo, objname::AbstractString) GitObject(repo, objname) false
@deprecate object(repo::GitRepo, te::GitTreeEntry) GitObject(repo, te) false
@deprecate commit(ann::GitAnnotated) GitHash(ann) false
@deprecate cat{T<:GitObject}(repo::GitRepo, ::Type{T}, object::AbstractString) cat(repo, object)
@deprecate lookup(repo::GitRepo, oid::GitHash) GitBlob(repo, oid) false
function Base.cat{T<:GitObject}(repo::GitRepo, ::Type{T}, object::Union{AbstractString,AbstractGitHash})
Base.depwarn("cat(repo::GitRepo, T, spec) is deprecated, use content(T(repo, spec))", :cat)
try
return content(GitBlob(repo, spec))
catch e
isa(e, LibGit2.GitError) && return nothing
rethrow(e)
end
end
Base.cat(repo::GitRepo, object::Union{AbstractString,AbstractGitHash}) = cat(repo, GitBlob, object)
end

# when this deprecation is deleted, remove all calls to it, and all
Expand Down
46 changes: 32 additions & 14 deletions base/fft/FFTW.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,27 @@ alignment_of(A::FakeArray) = Int32(0)

## Julia wrappers around FFTW functions

# _init_() must be called before any FFTW planning routine.
# -- Once FFTW is split into its own module, this can be called
# in the module __init__(), but for now we must call it lazily
# in every routine that might initialize the FFTW planner.
# -- This initializes FFTW's threads support (defaulting to 1 thread).
# If this isn't called before the FFTW planner is created, then
# FFTW's threads algorithms won't be registered or used at all.
# (Previously, we called fftw_cleanup, but this invalidated existing
# plans, causing issue #19892.)
const threads_initialized = Ref(false)
function _init_()
if !threads_initialized[]
stat = ccall((:fftw_init_threads,libfftw), Int32, ())
statf = ccall((:fftwf_init_threads,libfftwf), Int32, ())
if stat == 0 || statf == 0
error("could not initialize FFTW threads")
end
threads_initialized[] = true
end
end

# Wisdom

# Import and export wisdom to/from a single file for all precisions,
Expand All @@ -96,6 +117,7 @@ alignment_of(A::FakeArray) = Int32(0)
# FFTW's api/import-wisdom-from-file.c file].

function export_wisdom(fname::AbstractString)
_init_()
f = ccall(:fopen, Ptr{Void}, (Cstring,Cstring), fname, :w)
systemerror("could not open wisdom file $fname for writing", f == C_NULL)
ccall((:fftw_export_wisdom_to_file,libfftw), Void, (Ptr{Void},), f)
Expand All @@ -105,6 +127,7 @@ function export_wisdom(fname::AbstractString)
end

function import_wisdom(fname::AbstractString)
_init_()
f = ccall(:fopen, Ptr{Void}, (Cstring,Cstring), fname, :r)
systemerror("could not open wisdom file $fname for reading", f == C_NULL)
if ccall((:fftw_import_wisdom_from_file,libfftw),Int32,(Ptr{Void},),f)==0||
Expand All @@ -115,32 +138,23 @@ function import_wisdom(fname::AbstractString)
end

function import_system_wisdom()
_init_()
if ccall((:fftw_import_system_wisdom,libfftw), Int32, ()) == 0 ||
ccall((:fftwf_import_system_wisdom,libfftwf), Int32, ()) == 0
error("failed to import system wisdom")
end
end

function forget_wisdom()
_init_()
ccall((:fftw_forget_wisdom,libfftw), Void, ())
ccall((:fftwf_forget_wisdom,libfftwf), Void, ())
end

# Threads

const threads_initialized = Ref(false)
function set_num_threads(nthreads::Integer)
if !threads_initialized[]
# must forget wisdom if any FFTW routines have been called
# (don't call fftw_cleanup, since that would invalidate existing plans)
forget_wisdom()
stat = ccall((:fftw_init_threads,libfftw), Int32, ())
statf = ccall((:fftwf_init_threads,libfftwf), Int32, ())
if stat == 0 || statf == 0
error("could not initialize FFTW threads")
end
threads_initialized[] = true
end
_init_()
ccall((:fftw_plan_with_nthreads,libfftw), Void, (Int32,), nthreads)
ccall((:fftwf_plan_with_nthreads,libfftwf), Void, (Int32,), nthreads)
end
Expand All @@ -154,11 +168,15 @@ const PlanPtr = Ptr{fftw_plan_struct}

const NO_TIMELIMIT = -1.0 # from fftw3.h

set_timelimit(precision::fftwTypeDouble,seconds) =
function set_timelimit(precision::fftwTypeDouble,seconds)
_init_()
ccall((:fftw_set_timelimit,libfftw), Void, (Float64,), seconds)
end

set_timelimit(precision::fftwTypeSingle,seconds) =
function set_timelimit(precision::fftwTypeSingle,seconds)
_init_()
ccall((:fftwf_set_timelimit,libfftwf), Void, (Float64,), seconds)
end

# Array alignment mod 16:
# FFTW plans may depend on the alignment of the array mod 16 bytes,
Expand Down
2 changes: 1 addition & 1 deletion base/grisu/bignum.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is a part of Julia, but is derived from
# https://github.com/floitsch/double-conversion which has the following license
# https://github.com/google/double-conversion which has the following license
#
# Copyright 2006-2014, the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion base/grisu/bignums.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is a part of Julia, but is derived from
# https://github.com/floitsch/double-conversion which has the following license
# https://github.com/google/double-conversion which has the following license
#
# Copyright 2006-2014, the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion base/grisu/fastfixed.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is a part of Julia, but is derived from
# https://github.com/floitsch/double-conversion which has the following license
# https://github.com/google/double-conversion which has the following license
#
# Copyright 2006-2014, the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion base/grisu/fastprecision.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is a part of Julia, but is derived from
# https://github.com/floitsch/double-conversion which has the following license
# https://github.com/google/double-conversion which has the following license
#
# Copyright 2006-2014, the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion base/grisu/fastshortest.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is a part of Julia, but is derived from
# https://github.com/floitsch/double-conversion which has the following license
# https://github.com/google/double-conversion which has the following license
#
# Copyright 2006-2014, the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion base/grisu/float.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is a part of Julia, but is derived from
# https://github.com/floitsch/double-conversion which has the following license
# https://github.com/google/double-conversion which has the following license
#
# Copyright 2006-2014, the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
Expand Down
10 changes: 8 additions & 2 deletions base/inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,13 @@ end
function limit_type_depth(t::ANY, d::Int, cov::Bool, vars::Vector{TypeVar}=TypeVar[])
if isa(t,Union)
if d > MAX_TYPE_DEPTH
return Any
if cov
return Any
else
var = TypeVar(:_)
push!(vars, var)
return var
end
end
return Union{limit_type_depth(t.a, d+1, cov, vars),
limit_type_depth(t.b, d+1, cov, vars)}
Expand Down Expand Up @@ -2097,7 +2103,7 @@ function ⊑(a::ANY, b::ANY)
if isa(b, Const)
return a.val === b.val
end
return isa(a.val, b)
return isa(a.val, widenconst(b))
elseif isa(b, Const)
return a === Bottom
elseif !(isa(a, Type) || isa(a, TypeVar)) ||
Expand Down
19 changes: 19 additions & 0 deletions base/int.jl
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,25 @@ for to in BitInteger_types, from in (BitInteger_types..., Bool)
end
end

# @doc isn't available when running in Core at this point.
# Tuple syntax for documention two function signatures at the same time
# doesn't work either at this point.
isdefined(Main, :Base) && for fname in (:mod, :rem)
@eval @doc """
rem(x::Integer, T::Type{<:Integer})
mod(x::Integer, T::Type{<:Integer})
%(x::Integer, T::Type{<:Integer})

Find `y::T` such that `x` ≡ `y` (mod n), where n is the number of integers representable
in `T`, and `y` is an integer in `[typemin(T),typemax(T)]`.

```jldoctest
julia> 129 % Int8
-127
```
""" -> $fname(x::Integer, T::Type{<:Integer})
end

rem{T<:Integer}(x::T, ::Type{T}) = x
rem(x::Integer, ::Type{Bool}) = ((x & 1) != 0)
mod{T<:Integer}(x::Integer, ::Type{T}) = rem(x, T)
Expand Down
16 changes: 11 additions & 5 deletions base/interactiveutil.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ function edit(path::AbstractString, line::Integer=0)
end

if is_windows() && name == "open"
systemerror(:edit, ccall((:ShellExecuteW,"shell32"), stdcall, Int,
(Ptr{Void}, Cwstring, Cwstring, Ptr{Void}, Ptr{Void}, Cint),
C_NULL, "open", path, C_NULL, C_NULL, 10) ≤ 32)
@static is_windows() && # don't emit this ccall on other platforms
systemerror(:edit, ccall((:ShellExecuteW, "shell32"), stdcall, Int,
(Ptr{Void}, Cwstring, Cwstring, Ptr{Void}, Ptr{Void}, Cint),
C_NULL, "open", path, C_NULL, C_NULL, 10) ≤ 32)
elseif background
spawn(pipeline(cmd, stderr=STDERR))
else
Expand Down Expand Up @@ -587,9 +588,14 @@ else
end
end
if downloadcmd == :wget
run(`wget -O $filename $url`)
try
run(`wget -O $filename $url`)
catch
rm(filename) # wget always creates a file
rethrow()
end
elseif downloadcmd == :curl
run(`curl -o $filename -L $url`)
run(`curl -L -f -o $filename $url`)
elseif downloadcmd == :fetch
run(`fetch -f $filename $url`)
else
Expand Down
12 changes: 1 addition & 11 deletions base/libgit2/libgit2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module LibGit2

import Base: merge!, cat, ==
import Base: merge!, ==

export with, GitRepo, GitConfig

Expand Down Expand Up @@ -495,16 +495,6 @@ Equivalent to `git reset [--soft | --mixed | --hard] <id>`.
reset!(repo::GitRepo, id::GitHash, mode::Cint = Consts.RESET_MIXED) =
reset!(repo, GitObject(repo, id), mode)

""" git cat-file <commit> """
function cat(repo::GitRepo, spec::Union{AbstractString,AbstractGitHash})
obj = GitObject(repo, spec)
if isa(obj, GitBlob)
content(obj)
else
nothing
end
end

""" git rev-list --count <commit1> <commit2> """
function revcount(repo::GitRepo, fst::AbstractString, snd::AbstractString)
fst_id = revparseid(repo, fst)
Expand Down
2 changes: 1 addition & 1 deletion base/libgit2/merge.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function merge!(repo::GitRepo, anns::Vector{GitAnnotated};
@check ccall((:git_merge, :libgit2), Cint,
(Ptr{Void}, Ptr{Ptr{Void}}, Csize_t,
Ptr{MergeOptions}, Ptr{CheckoutOptions}),
repo.ptr, anns, anns_size,
repo.ptr, map(x->x.ptr, anns), anns_size,
Ref(merge_opts), Ref(checkout_opts))
info("Review and commit merged changes.")
return true
Expand Down
Loading