Skip to content

Commit

Permalink
Merge branch 'master' into mb/deprecatemultivaluenonscalarindexedassi…
Browse files Browse the repository at this point in the history
…gnment

* master:
  Fix trimming of SubArrays in unaliascopy (#26263)
  try to fix embedding test on windows
  replace `JULIA_HOME` with `Sys.BINDIR` in Pkg3
  loading tests: delete old, redundant tests
  loading: find entry points for projects in load path, locate tests
  disable problematic rmdir to fix AV build (#26255)
  • Loading branch information
mbauman committed Mar 1, 2018
2 parents 83d99cd + 9fd962b commit b4d9c6a
Show file tree
Hide file tree
Showing 7 changed files with 134 additions and 311 deletions.
30 changes: 18 additions & 12 deletions base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ function manifest_deps_get(env::String, where::PkgId, name::String)::Union{Bool,
@assert where.uuid !== nothing
project_file = env_project_file(env)
if project_file isa String
proj_name, proj_uuid = project_file_name_and_uuid(project_file, where.name)
proj_name, proj_uuid = project_file_name_uuid_path(project_file, where.name)
if proj_name == where.name && proj_uuid == where.uuid
# `where` matches the project, use deps as manifest
found_or_uuid = explicit_project_deps_get(project_file, name)
Expand All @@ -355,6 +355,8 @@ end
function manifest_uuid_path(env::String, pkg::PkgId)::Union{Nothing,String}
project_file = env_project_file(env)
if project_file isa String
proj_name, proj_uuid, path = project_file_name_uuid_path(project_file, pkg.name)
proj_name == pkg.name && proj_uuid == pkg.uuid && return path
manifest_file = project_file_manifest_path(project_file)
if isfile_casesensitive(manifest_file)
return explicit_manifest_uuid_path(manifest_file, pkg)
Expand All @@ -380,19 +382,23 @@ const re_manifest_to_string = r"^\s*manifest\s*=\s*\"(.*)\"\s*(?:#|$)"
const re_deps_to_any = r"^\s*deps\s*=\s*(.*?)\s*(?:#|$)"

# find project file's top-level UUID entry (or nothing)
function project_file_name_and_uuid(project_file::String,
name::Union{Nothing,String}=nothing)::Tuple{Union{Nothing,String},UUID}
function project_file_name_uuid_path(project_file::String,
name::String)::Tuple{String,UUID,String}
open(project_file) do io
uuid = dummy_uuid(project_file)
path = joinpath("src", "$name.jl")
for line in eachline(io)
contains(line, re_section) && break
if (m = match(re_name_to_string, line)) != nothing
name = String(m.captures[1])
elseif (m = match(re_uuid_to_string, line)) != nothing
uuid = UUID(m.captures[1])
elseif (m = match(re_path_to_string, line)) != nothing
path = String(m.captures[1])
end
end
return name, uuid
path = joinpath(dirname(project_file), path)
return name, uuid, path
end
end

Expand Down Expand Up @@ -433,11 +439,11 @@ end
# and project file if one exists (or nothing if not)
function entry_point_and_project_file(dir::String, name::String)::Union{Tuple{Nothing,Nothing},Tuple{String,Nothing},Tuple{String,String}}
for entry in ("", joinpath(name, "src"), joinpath("$name.jl", "src"))
path = joinpath(dir, entry, "$name.jl")
path = normpath(joinpath(dir, entry, "$name.jl"))
isfile_casesensitive(path) || continue
if !isempty(entry)
for proj in project_names
project_file = joinpath(dir, dirname(entry), proj)
project_file = normpath(joinpath(dir, dirname(entry), proj))
isfile_casesensitive(project_file) || continue
return path, project_file
end
Expand All @@ -449,8 +455,8 @@ end

# given a path and a name, return the entry point
function entry_path(path::String, name::String)::Union{Nothing,String}
isfile_casesensitive(path) && return path
path = joinpath(path, "src", "$name.jl")
isfile_casesensitive(path) && return normpath(path)
path = normpath(joinpath(path, "src", "$name.jl"))
isfile_casesensitive(path) ? path : nothing
end
entry_path(::Nothing, name::String) = nothing
Expand Down Expand Up @@ -578,7 +584,7 @@ function explicit_manifest_uuid_path(manifest_file::String, pkg::PkgId)::Union{N
slug = joinpath(name, version_slug(uuid, hash))
for depot in DEPOT_PATH
path = abspath(depot, "packages", slug)
ispath(path) && return path
ispath(path) && return entry_path(path, name)
end
end
end
Expand All @@ -592,7 +598,7 @@ end
function implicit_project_deps_get(dir::String, name::String)::Union{Bool,UUID}
path, project_file = entry_point_and_project_file(dir, name)
project_file == nothing && return path != nothing
proj_name, proj_uuid = project_file_name_and_uuid(project_file, name)
proj_name, proj_uuid = project_file_name_uuid_path(project_file, name)
proj_name == name && proj_uuid
end

Expand All @@ -605,7 +611,7 @@ function implicit_manifest_deps_get(dir::String, where::PkgId, name::String)::Un
@assert where.uuid !== nothing
project_file = entry_point_and_project_file(dir, where.name)[2]
project_file === nothing && return false
proj_name, proj_uuid = project_file_name_and_uuid(project_file, where.name)
proj_name, proj_uuid = project_file_name_uuid_path(project_file, where.name)
proj_name == where.name && proj_uuid == where.uuid || return false
found_or_uuid = explicit_project_deps_get(project_file, name)
found_or_uuid isa UUID ? found_or_uuid : true
Expand All @@ -616,7 +622,7 @@ function implicit_manifest_uuid_path(dir::String, pkg::PkgId)::Union{Nothing,Str
path, project_file = entry_point_and_project_file(dir, pkg.name)
pkg.uuid === nothing && project_file === nothing && return path
pkg.uuid === nothing || project_file === nothing && return nothing
proj_name, proj_uuid = project_file_name_and_uuid(project_file, pkg.name)
proj_name, proj_uuid = project_file_name_uuid_path(project_file, pkg.name)
proj_name == pkg.name && proj_uuid == pkg.uuid ? path : nothing
end

Expand Down
2 changes: 1 addition & 1 deletion base/subarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function unaliascopy(V::SubArray{T,N,A,I,LD}) where {T,N,A<:Array,I<:Tuple{Varar
end
# Transform indices to be "dense"
_trimmedindex(i::Real) = oftype(i, 1)
_trimmedindex(i::AbstractUnitRange) = i
_trimmedindex(i::AbstractUnitRange) = oftype(i, OneTo(length(i)))
_trimmedindex(i::AbstractArray) = oftype(i, reshape(linearindices(i), axes(i)))

## SubArray creation
Expand Down
2 changes: 1 addition & 1 deletion contrib/windows/appveyor_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,6 @@ echo 'FORCE_ASSERTIONS = 1' >> Make.user
cat Make.user
make -j3 VERBOSE=1 all
make -j3 VERBOSE=1 install
make VERBOSE=1 -C examples
make VERBOSE=1 JULIA=../../usr/bin/julia.exe BIN=. "$(make print-CC)" -C test/embedding release
cp usr/bin/busybox.exe julia-*/bin
make build-stats
2 changes: 1 addition & 1 deletion stdlib/Distributed/test/distributed_exec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1402,7 +1402,7 @@ let
rm(tmp_file, force=true)
rm(tmp_file2, force=true)
rm(tmp_dir2, force=true)
rm(tmp_dir, force=true)
#rm(tmp_dir, force=true)
end
end
# cookie and comand line option `--worker` tests. remove workers, set cookie and test
Expand Down
4 changes: 2 additions & 2 deletions stdlib/Pkg3/src/PlatformEngines.jl
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,11 @@ function probe_platform_engines!(;verbose::Bool = false)
prepend!(compression_engines, [(`7z --help`, gen_7z("7z")...)])

# On windows, we bundle 7z with Julia, so try invoking that directly
exe7z = joinpath(JULIA_HOME, "7z.exe")
exe7z = joinpath(Sys.BINDIR, "7z.exe")
prepend!(compression_engines, [(`$exe7z --help`, gen_7z(exe7z)...)])

# And finally, we want to look for sh as busybox as well:
busybox = joinpath(JULIA_HOME, "busybox.exe")
busybox = joinpath(Sys.BINDIR, "busybox.exe")
prepend!(sh_engines, [(`$busybox sh`)])
end

Expand Down
Loading

0 comments on commit b4d9c6a

Please sign in to comment.