Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn when using future Julia versions #3113

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading