-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Follow up changes for InitError #12742
Conversation
ccall((:MKL_Set_Interface_Layer, Base.libblas_name), Void, (Cint,), USE_BLAS64 ? 1 : 0) | ||
end | ||
catch ex | ||
#Base.showerror_nostdio(ex, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was this not able to show the details from the exception?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I just mistakenly didn't revert some of my last tests. Fixing now.
13dacd3
to
419539d
Compare
Hmm, needing to wrap all of these |
end | ||
try | ||
if gmp_version().major != GMP_VERSION.major || gmp_bits_per_limb() != GMP_BITS_PER_LIMB | ||
error(string("The dynamically loaded GMP library (version $(gmp_version()) with __gmp_bits_per_limb == $(gmp_bits_per_limb()))\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this just be warn(string(...
. The try... catch
seems strange, when the only possible exception comes from an explicit error()
Please verify if warn
work in __init__
, there might be issues with STDOUT there too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not just that error
call, but any ccall
into libgmp that might throw. The goal is to let Base
load even when any of the shared libraries are actually missing, though I don't know how that situation might arise.
warn
was the first thing I tried and it didn't work which led to the new showerror
function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
though I don't know how that situation might arise.
people embedding julia into a different language or wanting to deploy standalone executables might not always need bigint's
It should provide good incentive to not do shared library loading in Base if possible. Another option would be to catch all |
Bump. Is this ready? |
It would be nice to leave a note somewhere explaining why the |
end | ||
catch ex | ||
Base.showerror_nostdio(ex, | ||
"WARNING: Error during initialization of module LinAlg") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing the :\n
at the end of this message. However I think it's better to print the formatting stuff (colon and newline) where it's needed rather than making it part of the message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving it to the showerror
function now.
Prevents them from throwing any InitError exceptions that will not get handled
419539d
to
fe0337e
Compare
Follow up changes for InitError
Per the comments in #12576, this no longer escapes
InitError
s from being wrapped inLoadError
s.I also wrapped all the Base submodule
__init__
functions that use external libraries intry
...catch
so they don't throw but I'm not sure if it's the best approach to take.