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

Switch remaining julia code bool envs to get_bool_envs #48383

Merged
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
9 changes: 3 additions & 6 deletions base/errorshow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -372,12 +372,9 @@ function showerror_nostdio(err, msg::AbstractString)
ccall(:jl_printf, Cint, (Ptr{Cvoid},Cstring), stderr_stream, "\n")
end

stacktrace_expand_basepaths()::Bool =
tryparse(Bool, get(ENV, "JULIA_STACKTRACE_EXPAND_BASEPATHS", "false")) === true
stacktrace_contract_userdir()::Bool =
tryparse(Bool, get(ENV, "JULIA_STACKTRACE_CONTRACT_HOMEDIR", "true")) === true
stacktrace_linebreaks()::Bool =
tryparse(Bool, get(ENV, "JULIA_STACKTRACE_LINEBREAKS", "false")) === true
stacktrace_expand_basepaths()::Bool = Base.get_bool_env("JULIA_STACKTRACE_EXPAND_BASEPATHS", false) === true
IanButterworth marked this conversation as resolved.
Show resolved Hide resolved
stacktrace_contract_userdir()::Bool = Base.get_bool_env("JULIA_STACKTRACE_CONTRACT_HOMEDIR", true) === true
IanButterworth marked this conversation as resolved.
Show resolved Hide resolved
stacktrace_linebreaks()::Bool = Base.get_bool_env("JULIA_STACKTRACE_LINEBREAKS", false) === true
IanButterworth marked this conversation as resolved.
Show resolved Hide resolved

function show_method_candidates(io::IO, ex::MethodError, @nospecialize kwargs=())
is_arg_types = isa(ex.args, DataType)
Expand Down
2 changes: 1 addition & 1 deletion contrib/generate_precompile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const PARALLEL_PRECOMPILATION = true
const debug_output = devnull # or stdout

# Disable fancy printing
const fancyprint = (stdout isa Base.TTY) && (get(ENV, "CI", nothing) != "true")
const fancyprint = (stdout isa Base.TTY) && Base.get_bool_env("CI", false) !== true
IanButterworth marked this conversation as resolved.
Show resolved Hide resolved
##

CTRL_C = '\x03'
Expand Down
2 changes: 1 addition & 1 deletion stdlib/LinearAlgebra/test/special.jl
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ end
@testset "concatenations of annotated types" begin
N = 4
# The tested annotation types
testfull = Bool(parse(Int,(get(ENV, "JULIA_TESTFULL", "0"))))
testfull = Base.get_bool_env("JULIA_TESTFULL", false)
utriannotations = (UpperTriangular, UnitUpperTriangular)
ltriannotations = (LowerTriangular, UnitLowerTriangular)
triannotations = (utriannotations..., ltriannotations...)
Expand Down
2 changes: 1 addition & 1 deletion stdlib/Profile/src/Profile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function profile_printing_listener()
while true
wait(PROFILE_PRINT_COND[])
peek_report[]()
if get(ENV, "JULIA_PROFILE_PEEK_HEAP_SNAPSHOT", nothing) === "1"
if Base.get_bool_env("JULIA_PROFILE_PEEK_HEAP_SNAPSHOT", false) === true
IanButterworth marked this conversation as resolved.
Show resolved Hide resolved
println(stderr, "Saving heap snapshot...")
fname = take_heap_snapshot()
println(stderr, "Heap snapshot saved to `$(fname)`")
Expand Down
6 changes: 1 addition & 5 deletions test/choosetests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,7 @@ function choosetests(choices = [])

net_required_for = filter!(in(tests), NETWORK_REQUIRED_LIST)
net_on = true
JULIA_TEST_NETWORKING_AVAILABLE = get(ENV, "JULIA_TEST_NETWORKING_AVAILABLE", "") |>
strip |>
lowercase |>
s -> tryparse(Bool, s) |>
x -> x === true
JULIA_TEST_NETWORKING_AVAILABLE = Base.get_bool_env("JULIA_TEST_NETWORKING_AVAILABLE", false) === true
IanButterworth marked this conversation as resolved.
Show resolved Hide resolved
# If the `JULIA_TEST_NETWORKING_AVAILABLE` environment variable is set to `true`, we
# always set `net_on` to `true`.
# Otherwise, we set `net_on` to true if and only if networking is actually available.
Expand Down