diff --git a/src/init.c b/src/init.c index b293ab1a44b884..c6955df90f3496 100644 --- a/src/init.c +++ b/src/init.c @@ -592,6 +592,11 @@ 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 && strncmp(jl_options.project, "@.", strlen(jl_options.project)) != 0){ + printf("In here.\n"); + printf(jl_options.project); + jl_options.project = abspath(jl_options.project, 0); + } const char **cmdp = jl_options.cmds; if (cmdp) { diff --git a/test/loading.jl b/test/loading.jl index 289c25e582b0ad..3b28ff9d30816b 100644 --- a/test/loading.jl +++ b/test/loading.jl @@ -547,6 +547,19 @@ finally popfirst!(LOAD_PATH) end +@testset "--project path should be absolutified" begin + mktempdir() do dir; cd(dir) do + mkdir("foo") + script = """ + using Test + old = Base.active_project() + cd("foo") + @test Base.active_project() == old + """ + @test success(`$(Base.julia_cmd()) --project=foo -e $(script)`) + end; end +end + ## cleanup after tests ## for env in keys(envs)