From b3b75cfd3eb1005c5a414b9d3ed97a8623411c16 Mon Sep 17 00:00:00 2001 From: Moelf Date: Sun, 5 May 2019 21:56:39 -0700 Subject: [PATCH 1/5] expanduser --project and env vairable --- base/initdefs.jl | 2 +- src/init.c | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/base/initdefs.jl b/base/initdefs.jl index 479f3bd4479d2..be6cf5a409aae 100644 --- a/base/initdefs.jl +++ b/base/initdefs.jl @@ -217,7 +217,7 @@ function init_load_path() HOME_PROJECT[] = project === nothing ? nothing : project == "" ? nothing : - project == "@." ? current_project() : abspath(project) + project == "@." ? current_project() : abspath(expanduser(project)) append!(empty!(LOAD_PATH), paths) end diff --git a/src/init.c b/src/init.c index 5f97d46a0b8e3..2a26a53cd1147 100644 --- a/src/init.c +++ b/src/init.c @@ -625,11 +625,6 @@ static void jl_resolve_sysimg_location(JL_IMAGE_SEARCH rel) jl_options.outputbc = abspath(jl_options.outputbc, 0); if (jl_options.machine_file) jl_options.machine_file = abspath(jl_options.machine_file, 0); - if (jl_options.project - && strcmp(jl_options.project, "@.") != 0 - && strcmp(jl_options.project, "@") != 0 - && strcmp(jl_options.project, "") != 0) - jl_options.project = abspath(jl_options.project, 0); if (jl_options.output_code_coverage) jl_options.output_code_coverage = absformat(jl_options.output_code_coverage); From e14e9c3055f22e8fb950b2768e76825dcc0a1471 Mon Sep 17 00:00:00 2001 From: Moelf Date: Mon, 6 May 2019 14:32:47 -0700 Subject: [PATCH 2/5] add tests to --project --- test/cmdlineargs.jl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/cmdlineargs.jl b/test/cmdlineargs.jl index 92b72955451fd..307ae541229a5 100644 --- a/test/cmdlineargs.jl +++ b/test/cmdlineargs.jl @@ -97,6 +97,11 @@ let exename = `$(Base.julia_cmd()) --startup-file=no` @test startswith(read(`$exename --help`, String), header) end + # --project + let expanded = abspath(expanduser("~/foo")) + @test occursin(expanded, readchomp(`$exename --project='~/foo' -E 'Base.active_project()'`)) + end + # --quiet, --banner let t(q,b) = "Base.JLOptions().quiet == $q && Base.JLOptions().banner == $b" @test success(`$exename -e $(t(0, -1))`) From fa6a6ad3e1123dfd34346a8d0dc5a32bedcc8c64 Mon Sep 17 00:00:00 2001 From: Moelf Date: Mon, 6 May 2019 17:57:51 -0700 Subject: [PATCH 3/5] add JULIA_PROJECT env test --- test/cmdlineargs.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/test/cmdlineargs.jl b/test/cmdlineargs.jl index 307ae541229a5..167f25c45ba49 100644 --- a/test/cmdlineargs.jl +++ b/test/cmdlineargs.jl @@ -100,6 +100,7 @@ let exename = `$(Base.julia_cmd()) --startup-file=no` # --project let expanded = abspath(expanduser("~/foo")) @test occursin(expanded, readchomp(`$exename --project='~/foo' -E 'Base.active_project()'`)) + @test occursin(expanded, readchomp(setenv(`$exename -E 'Base.active_project()'`, "JULIA_PROJECT"=>"~/foo"))) end # --quiet, --banner From 08afd4d6089cd44e67b0fc455501507ce81c9306 Mon Sep 17 00:00:00 2001 From: Moelf Date: Mon, 13 May 2019 17:04:16 -0700 Subject: [PATCH 4/5] Skip Windows --project tests --- test/cmdlineargs.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/cmdlineargs.jl b/test/cmdlineargs.jl index 167f25c45ba49..417e6d8602259 100644 --- a/test/cmdlineargs.jl +++ b/test/cmdlineargs.jl @@ -99,8 +99,10 @@ let exename = `$(Base.julia_cmd()) --startup-file=no` # --project let expanded = abspath(expanduser("~/foo")) - @test occursin(expanded, readchomp(`$exename --project='~/foo' -E 'Base.active_project()'`)) - @test occursin(expanded, readchomp(setenv(`$exename -E 'Base.active_project()'`, "JULIA_PROJECT"=>"~/foo"))) + if(!Sys.iswindows()) + @test occursin(expanded, readchomp(`$exename --project='~/foo' -E 'Base.active_project()'`)) + @test occursin(expanded, readchomp(setenv(`$exename -E 'Base.active_project()'`, "JULIA_PROJECT"=>"~/foo"))) + end end # --quiet, --banner From f7a5d8a09eab93a3f60fb741073604b15170830e Mon Sep 17 00:00:00 2001 From: Jerry Ling Date: Sat, 25 May 2019 18:38:08 -0700 Subject: [PATCH 5/5] Update formating test/cmdlineargs.jl Co-Authored-By: Fredrik Ekre --- test/cmdlineargs.jl | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/test/cmdlineargs.jl b/test/cmdlineargs.jl index 417e6d8602259..74d98c2511ad5 100644 --- a/test/cmdlineargs.jl +++ b/test/cmdlineargs.jl @@ -97,12 +97,11 @@ let exename = `$(Base.julia_cmd()) --startup-file=no` @test startswith(read(`$exename --help`, String), header) end - # --project - let expanded = abspath(expanduser("~/foo")) - if(!Sys.iswindows()) - @test occursin(expanded, readchomp(`$exename --project='~/foo' -E 'Base.active_project()'`)) - @test occursin(expanded, readchomp(setenv(`$exename -E 'Base.active_project()'`, "JULIA_PROJECT"=>"~/foo"))) - end + # ~ expansion in --project and JULIA_PROJECT + if !Sys.iswindows() + expanded = abspath(expanduser("~/foo")) + @test occursin(expanded, readchomp(`$exename --project='~/foo' -E 'Base.active_project()'`)) + @test occursin(expanded, readchomp(setenv(`$exename -E 'Base.active_project()'`, "JULIA_PROJECT"=>"~/foo"))) end # --quiet, --banner