invenia / Memento.jl

A flexible logging library for Julia
https://invenia.github.io/Memento.jl/latest
Other
87 stars 14 forks source link

Updates for Julia 1.0 #101

Closed ararslan closed 6 years ago

ararslan commented 6 years ago

Now info and warn are only imported and extended from Base when they're defined in Base. Travis and AppVeyor have been updated to handle versions 0.6 through 1.0.

Supersedes #100.

codecov[bot] commented 6 years ago

Codecov Report

Merging #101 into master will decrease coverage by 0.29%. The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #101     +/-   ##
=========================================
- Coverage   97.53%   97.24%   -0.3%     
=========================================
  Files          11       11             
  Lines         284      290      +6     
=========================================
+ Hits          277      282      +5     
- Misses          7        8      +1
Impacted Files Coverage Δ
src/Memento.jl 100% <ø> (ø) :arrow_up:
src/records.jl 94.44% <83.33%> (-5.56%) :arrow_down:
src/stdlib.jl 25% <0%> (+12.5%) :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 f491d13...4199c14. Read the comment docs.

ararslan commented 6 years ago

Wow, the userimage tests segfault on 0.7 and 1.0. :grimacing:

ararslan commented 6 years ago

Since we're using TestSetExtensions in the tests here, we might need https://github.com/ssfrr/TestSetExtensions.jl/pull/7 before this will work properly. :confused:

ararslan commented 6 years ago

The userimg tests segfaulting might actually indicate issues with the library. The root cause should be identified and documented.

It's unrelated to Memento:

$ cat thingo.jl 
VERSION >= v"0.7.0-DEV.3382" && using Libdl
BINDIR = VERSION < v"0.7.0-DEV.3073" ? Base.JULIA_HOME : Sys.BINDIR
LIB_PATH = abspath(BINDIR, Base.LIBDIR)
sysimg_lib = joinpath(LIB_PATH, "julia", "sys.$(Libdl.dlext)")
userimg_o = "userimg.o"
userimg_lib = "userimg.$(Libdl.dlext)"
run(`$(Base.julia_cmd()) --output-o $userimg_o --sysimage $sysimg_lib --startup-file=no -e "println(1)"`)
$ julia-0.6 thingo.jl
1
$ ls
thingo.jl  userimg.o
$ julia-0.7 thingo.jl

signal (11): Segmentation fault
in expression starting at no file:0
uv_write2 at /buildworker/worker/package_linux64/build/deps/srccache/libuv-ed3700c849289ed01fe04273a7bf865340b2bd7e/src/unix/stream.c:1432
uv_write at /buildworker/worker/package_linux64/build/deps/srccache/libuv-ed3700c849289ed01fe04273a7bf865340b2bd7e/src/unix/stream.c:1524
jl_uv_write at /buildworker/worker/package_linux64/build/src/jl_uv.c:454
uv_write_async at ./stream.jl:810
uv_write at ./stream.jl:778
unsafe_write at ./stream.jl:834
macro expansion at ./gcutils.jl:87 [inlined]
write at ./strings/io.jl:152 [inlined]
show at ./show.jl:568 [inlined]
print at ./strings/io.jl:31
print at ./strings/io.jl:42
println at ./strings/io.jl:69
unknown function (ip: 0x7f77483c2507)
jl_fptr_trampoline at /buildworker/worker/package_linux64/build/src/gf.c:1829
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2182
println at ./coreio.jl:4
unknown function (ip: 0x7f77483c2453)
jl_fptr_trampoline at /buildworker/worker/package_linux64/build/src/gf.c:1829
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2182
do_call at /buildworker/worker/package_linux64/build/src/interpreter.c:324
eval_value at /buildworker/worker/package_linux64/build/src/interpreter.c:428
eval_stmt_value at /buildworker/worker/package_linux64/build/src/interpreter.c:363 [inlined]
eval_body at /buildworker/worker/package_linux64/build/src/interpreter.c:686
jl_interpret_toplevel_thunk_callback at /buildworker/worker/package_linux64/build/src/interpreter.c:799
unknown function (ip: 0xfffffffffffffffe)
unknown function (ip: 0x7f774b6c5b8f)
unknown function (ip: 0xffffffffffffffff)
jl_interpret_toplevel_thunk at /buildworker/worker/package_linux64/build/src/interpreter.c:808
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:831
jl_toplevel_eval_in at /buildworker/worker/package_linux64/build/src/builtins.c:633
eval at ./boot.jl:319
jl_fptr_trampoline at /buildworker/worker/package_linux64/build/src/gf.c:1829
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2182
macro expansion at ./logging.jl:317 [inlined]
exec_options at ./client.jl:229
_start at ./client.jl:432
jl_fptr_trampoline at /buildworker/worker/package_linux64/build/src/gf.c:1829
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2182
jl_apply at /buildworker/worker/package_linux64/build/ui/../src/julia.h:1538 [inlined]
true_main at /buildworker/worker/package_linux64/build/ui/repl.c:112
main at /buildworker/worker/package_linux64/build/ui/repl.c:233
__libc_start_main at /build/glibc-Cl5G7W/glibc-2.23/csu/../csu/libc-start.c:291
_start at /home/alex/Projects/past-julia/0.7/bin/julia (unknown line)
Allocations: 726978 (Pool: 726579; Big: 399); GC: 0
ERROR: LoadError: failed process: Process(`/home/alex/Projects/past-julia/0.7/bin/julia -Cnative -J/home/alex/Projects/past-julia/0.7/lib/julia/sys.so --compile=yes --depwarn=yes --output-o userimg.o --sysimage /home/alex/Projects/past-julia/0.7/lib/julia/sys.so --startup-file=no -e 'println(1)'`, ProcessSignaled(11)) [0]
Stacktrace:
 [1] error(::String, ::Base.Process, ::String, ::Int64, ::String) at ./error.jl:42
 [2] pipeline_error at ./process.jl:712 [inlined]
 [3] #run#509(::Bool, ::Function, ::Cmd) at ./process.jl:670
 [4] run(::Cmd) at ./process.jl:668
 [5] top-level scope at none:0
 [6] include at ./boot.jl:317 [inlined]
 [7] include_relative(::Module, ::String) at ./loading.jl:1038
 [8] include(::Module, ::String) at ./sysimg.jl:29
 [9] exec_options(::Base.JLOptions) at ./client.jl:239
 [10] _start() at ./client.jl:432
in expression starting at /home/alex/Projects/test/thingo.jl:7

Apparently as of https://github.com/JuliaLang/julia/pull/24410, the --output-o option is to be considered unstable and was hidden from the --help output. It seems that it's since bitrotted.

iamed2 commented 6 years ago

We'll need to change it to use build_sysimg I guess then

ararslan commented 6 years ago

build_sysimg has also bitrotted. See https://github.com/JuliaLang/julia/pull/27629. The recommendation is to use PackageCompiler, but that too does not support 0.7 or newer.

iamed2 commented 6 years ago

So the documented function doesn't work? https://docs.julialang.org/en/latest/devdocs/sysimg/#Building-the-Julia-system-image-1

That's...worrying

ararslan commented 6 years ago

I didn't realize we had it documented. I think once https://github.com/JuliaLang/julia/pull/21849 landed, rebuilding the sysimage became pretty uncommon, so no one paid much attention to the machinery in place that worked around the initial limitation.

ararslan commented 6 years ago

Well, I fixed the segfault but the userimage tests still don't work. ¯\_(ツ)_/¯

iamed2 commented 6 years ago

Seems like the script that runs it just needs to tell Pkg3 where to find Memento?

ararslan commented 6 years ago

Maybe, but I'm not sure; in testing I've been using the stdlib Test rather than Memento, which should be easier for Julia to find, but it still errors saying it can't find it. Kristoffer was helping me diagnose the other day but we didn't come to a conclusion.