Skip to content

Commit

Permalink
stop putting OldPkg.dir in LOAD_PATH (#27236)
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKarpinski authored May 25, 2018
1 parent deaefef commit 7144b6b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 29 deletions.
7 changes: 0 additions & 7 deletions stdlib/OldPkg/src/OldPkg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,6 @@ custom METADATA setup.
"""
init(meta::AbstractString=DEFAULT_META, branch::AbstractString=META_BRANCH) = Dir.init(meta,branch)

function __init__()
if !Base.creating_sysimg
vers = "v$(VERSION.major).$(VERSION.minor)"
push!(Base.LOAD_PATH, dir)
end
end

"""
edit()
Expand Down
2 changes: 1 addition & 1 deletion stdlib/OldPkg/test/pkg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ temp_pkg_dir() do

OldPkg.add(package)
msg = read(ignorestatus(`$(Base.julia_cmd()) --startup-file=no -e
"redirect_stderr(stdout); using Logging; global_logger(SimpleLogger(stdout)); using Example; import OldPkg; OldPkg.update(\"$package\")"`), String)
"import OldPkg; push!(LOAD_PATH, OldPkg.dir); redirect_stderr(stdout); using Logging; global_logger(SimpleLogger(stdout)); using Example; OldPkg.update(\"$package\")"`), String)
@test occursin(Regex("- $package.*Restart Julia to use the updated versions","s"), msg)
end

Expand Down
47 changes: 26 additions & 21 deletions stdlib/REPL/test/replcompletions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -495,31 +495,36 @@ end

# Test completion of packages
mkp(p) = ((@assert !isdir(p)); mkpath(p))
temp_pkg_dir_noinit() do
# Complete <Mod>/src/<Mod>.jl and <Mod>.jl/src/<Mod>.jl
# but not <Mod>/ if no corresponding .jl file is found
pkg_dir = OldPkg.dir("CompletionFooPackage", "src")
mkp(pkg_dir)
touch(joinpath(pkg_dir, "CompletionFooPackage.jl"))
push!(LOAD_PATH, OldPkg.dir)
try
temp_pkg_dir_noinit() do
# Complete <Mod>/src/<Mod>.jl and <Mod>.jl/src/<Mod>.jl
# but not <Mod>/ if no corresponding .jl file is found
pkg_dir = OldPkg.dir("CompletionFooPackage", "src")
mkp(pkg_dir)
touch(joinpath(pkg_dir, "CompletionFooPackage.jl"))

pkg_dir = OldPkg.dir("CompletionFooPackage2.jl", "src")
mkp(pkg_dir)
touch(joinpath(pkg_dir, "CompletionFooPackage2.jl"))
pkg_dir = OldPkg.dir("CompletionFooPackage2.jl", "src")
mkp(pkg_dir)
touch(joinpath(pkg_dir, "CompletionFooPackage2.jl"))

touch(OldPkg.dir("CompletionFooPackage3.jl"))
touch(OldPkg.dir("CompletionFooPackage3.jl"))

mkp(OldPkg.dir("CompletionFooPackageNone"))
mkp(OldPkg.dir("CompletionFooPackageNone2.jl"))
mkp(OldPkg.dir("CompletionFooPackageNone"))
mkp(OldPkg.dir("CompletionFooPackageNone2.jl"))

s = "using Completion"
c,r = test_complete(s)
@test "CompletionFoo" in c #The module
@test "CompletionFooPackage" in c #The package
@test "CompletionFooPackage2" in c #The package
@test "CompletionFooPackage3" in c #The package
@test !("CompletionFooPackageNone" in c) #The package
@test !("CompletionFooPackageNone2" in c) #The package
@test s[r] == "Completion"
s = "using Completion"
c,r = test_complete(s)
@test "CompletionFoo" in c #The module
@test "CompletionFooPackage" in c #The package
@test "CompletionFooPackage2" in c #The package
@test "CompletionFooPackage3" in c #The package
@test !("CompletionFooPackageNone" in c) #The package
@test !("CompletionFooPackageNone2" in c) #The package
@test s[r] == "Completion"
end
finally
@test pop!(LOAD_PATH) == OldPkg.dir
end

path = joinpath(tempdir(),randstring())
Expand Down

6 comments on commit 7144b6b

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily benchmark build, I will reply here when finished:

@nanosoldier runbenchmarks(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something went wrong when running your job:

NanosoldierError: failed to run benchmarks against primary commit: failed process: Process(`sudo cset shield -e su nanosoldier -- -c ./benchscript.sh`, ProcessExited(1)) [1]

Logs and partial data can be found here
cc @ararslan

@ararslan
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welp. Nanosoldier is dead and I don't understand why.

@StefanKarpinski
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it rely on packages being installed in the old ~/.julia/v0.7 style package directory?

@ararslan
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It shouldn't need to make any assumptions like that, and looking through the source I don't see anything that suggests it does currently...

@StefanKarpinski
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it install packages using the old package API and then try to load them? Things to try: 1. Use the new package manager instead; 2. Put Pkg.dir in the load path and see if it unbreaks things (since that’s the only thing that was changed here).

Please sign in to comment.