Skip to content

Commit

Permalink
Warn when using future Julia versions (#3113)
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp authored Dec 16, 2024
1 parent c403379 commit 42ef2b4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
34 changes: 24 additions & 10 deletions src/Pluto.jl
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,28 @@ include("./precompile.jl")

const pluto_boot_environment_path = Ref{String}()

function warn_julia_compat()
if VERSION > v"1.11.9999"
@warn("\nPluto ($(PLUTO_VERSION)) is running on a new version of Julia ($(VERSION)).\n\n$(
# if using a regular Julia version, then that means that the new Julia version has been released and we released a new Pluto version that supports it, but the user is still using an old Pluto version.
VERSION.prerelease === () && VERSION.build === () ?
"You need to update Pluto to use this Julia version, see https://plutojl.org/en/docs/update/ to learn more." :
# if using a build/prerelease, then the user is using a future Julia version that we don't support yet.
"This (preview) version of Julia might not be fully supported by Pluto yet. Please check back later or use an older version of Julia."
)")
end

bad_depots = filter(d -> !isabspath(expanduser(d)), DEPOT_PATH)
if !isempty(bad_depots)
@error """Pluto: The provided depot path is not an absolute path. Pluto will not be able to run correctly.
Did you recently change the DEPOT path setting? Change your setting to use an absolute path.
Do you not know what this means? Please get in touch! https://github.com/fonsp/Pluto.jl/issues
""" bad_depots DEPOT_PATH
end
end

function __init__()
pluto_boot_environment_name = "pluto-boot-environment-$(VERSION)-$(PLUTO_VERSION)"
pluto_boot_environment_path[] = Scratch.@get_scratch!(pluto_boot_environment_name)
Expand Down Expand Up @@ -125,17 +147,9 @@ function __init__()
# create empty file to indicate that we've shown the banner
write(fn, "");
end

bad_depots = filter(d -> !isabspath(expanduser(d)), DEPOT_PATH)
if !isempty(bad_depots)
@error """Pluto: The provided depot path is not an absolute path. Pluto will not be able to run correctly.
Did you recently change the DEPOT path setting? Change your setting to use an absolute path.
Do you not know what this means? Please get in touch! https://github.com/fonsp/Pluto.jl/issues
""" bad_depots DEPOT_PATH
end
end

warn_julia_compat()
end

end
4 changes: 1 addition & 3 deletions src/webserver/WebServer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,7 @@ function run!(session::ServerSession)
@info "Loading..."
end

if VERSION < v"1.10.0"
@warn("\nPluto is running on an old version of Julia ($(VERSION)) that is no longer supported. Visit https://julialang.org/downloads/ for more information about upgrading Julia.")
end
warn_julia_compat()

pluto_router = http_router_for(session)
store_session_middleware = create_session_context_middleware(session)
Expand Down

0 comments on commit 42ef2b4

Please sign in to comment.