JuliaLang / Compat.jl

Compatibility across Julia versions
Other
144 stars 117 forks source link

Port Base.current_exceptions() to older Julia versions #746

Closed c42f closed 3 years ago

c42f commented 3 years ago

See https://github.com/JuliaLang/julia/pull/29901

This is limited to julia-1.1 and above because earlier versions don't have the necessary runtime library support (Base.catch_stack() etc).

codecov[bot] commented 3 years ago

Codecov Report

Merging #746 (d5a5199) into master (ad9a668) will increase coverage by 0.28%. The diff coverage is 88.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #746      +/-   ##
==========================================
+ Coverage   81.71%   81.99%   +0.28%     
==========================================
  Files           4        4              
  Lines         536      561      +25     
==========================================
+ Hits          438      460      +22     
- Misses         98      101       +3     
Impacted Files Coverage Δ
src/Compat.jl 82.02% <88.00%> (+0.32%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ad9a668...d5a5199. Read the comment docs.

c42f commented 3 years ago

Failing tests on nightly are #745

martinholters commented 3 years ago

With a README entry and after a rebase, this looks good to me.

c42f commented 3 years ago

I added the readme entry and rebased.

Also I've added julia-1.0 compatibility (in that case, the best we can do is just return the current exception as a single-element stack)

c42f commented 3 years ago

whether this does the right thing.

It should do the right thing to the extent that the right thing can be done at all in julia 1.0 (there were some nasty bugs with exceptions and backtraces going missing completely in julia-1.0 due to task switching. But Compat can't work around that.)

I figured it was better to have the API with only approximate runtime compatibility in 1.0, than to not have the API at all — it's a lot easier for users if they can at least rely on the API being present on all versions supported by Compat.

martinholters commented 3 years ago

I don't disagree. Only question: Merge as is or mention the limitation re: Julia 1.0 in the README?

c42f commented 3 years ago

Yeah, it's worth mentioning the Julia-1.0 limitations in the readme. I did that.

martinholters commented 3 years ago

Alright, there was plenty of time for others to chime in on this, bu no one did, so here we go...