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

versioninfo(): include build info and unofficial warning #50635

Merged
merged 2 commits into from
Jul 26, 2023
Merged
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
21 changes: 19 additions & 2 deletions stdlib/InteractiveUtils/src/InteractiveUtils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,25 @@ function versioninfo(io::IO=stdout; verbose::Bool=false)
if !isempty(Base.GIT_VERSION_INFO.commit_short)
println(io, "Commit $(Base.GIT_VERSION_INFO.commit_short) ($(Base.GIT_VERSION_INFO.date_string))")
end
if Base.isdebugbuild()
println(io, "DEBUG build")
official_release = Base.TAGGED_RELEASE_BANNER == "Official https://julialang.org/ release"
Copy link
Member

Choose a reason for hiding this comment

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

This sounds like a relatively fragile check. We could introduce a separate variable to identify official builds. But maybe that would be overkill.

Copy link
Member Author

Choose a reason for hiding this comment

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

It is brittle, but I feel like setting the exact string "Official https://julialang.org/ release" may be a bit more of a barrier/statement than flipping an official build flag

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I agree. We haven't changed this banner in almost a decade, I don't think it's ever going to change.

Copy link
Member

Choose a reason for hiding this comment

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

OK. Do we have a way to check that we don't print this message in official builds. It's not easy to design tests for this kind of feature...

Copy link
Member Author

Choose a reason for hiding this comment

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

We can check on alpha's & rc's given it's set for those

               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.10.0-alpha1 (2023-07-06)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

Copy link
Member Author

Choose a reason for hiding this comment

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

I've sometimes wondered though whether the trailing / should be removed in the url..? Or is it more proper to have it?

if Base.isdebugbuild() || !isempty(Base.TAGGED_RELEASE_BANNER) || (Base.GIT_VERSION_INFO.tagged_commit && !official_release)
println(io, "Build Info:")
if Base.isdebugbuild()
println(io, " DEBUG build")
end
if !isempty(Base.TAGGED_RELEASE_BANNER)
println(io, " ", Base.TAGGED_RELEASE_BANNER)
end
if Base.GIT_VERSION_INFO.tagged_commit && !official_release
println(io,
"""

Note: This is an unofficial build, please report bugs to the project
responsible for this build and not to the Julia project unless you can
reproduce the issue using official builds available at https://julialang.org/downloads
"""
)
end
end
println(io, "Platform Info:")
println(io, " OS: ", Sys.iswindows() ? "Windows" : Sys.isapple() ?
Expand Down