Closed tkf closed 2 years ago
Merging #937 (b787aba) into master (4e5c12c) will not change coverage. The diff coverage is
0.00%
.
@@ Coverage Diff @@
## master #937 +/- ##
=======================================
Coverage 68.24% 68.24%
=======================================
Files 20 20
Lines 2012 2012
=======================================
Hits 1373 1373
Misses 639 639
Flag | Coverage Δ | |
---|---|---|
unittests | 68.24% <0.00%> (ø) |
Flags with carried forward coverage won't be shown. Click here to find out more.
Impacted Files | Coverage Δ | |
---|---|---|
src/startup.jl | 53.12% <0.00%> (ø) |
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 4e5c12c...b787aba. Read the comment docs.
Seems reasonable to me. Any symbol should work.
Thanks! By any chance, do you have any idea why this is happening? I'm just puzzled that main
is "gone," presumably after it's called via _start
.
Did you check the dynamic symbol table nm -D
? They may have decided to hide it.
Indeed main
does not show up in python3.9
but it does in python3.8
!
$ nm -D ~/.pyenv/versions/3.9.7/bin/python3.9
0000000000201010 B __bss_start
w __cxa_finalize
0000000000201000 D __data_start
0000000000201000 W data_start
0000000000201010 D _edata
0000000000201018 B _end
00000000000008b4 T _fini
w __gmon_start__
00000000000006d0 T _init
00000000000008c0 R _IO_stdin_used
w _ITM_deregisterTMCloneTable
w _ITM_registerTMCloneTable
00000000000008b0 T __libc_csu_fini
0000000000000840 T __libc_csu_init
U __libc_start_main
U Py_BytesMain
0000000000000730 T _start
$ nm -D ~/.pyenv/versions/3.8.12/bin/python3.8
0000000000201010 B __bss_start
w __cxa_finalize
0000000000201000 D __data_start
0000000000201000 W data_start
0000000000201010 D _edata
0000000000201018 B _end
00000000000008e4 T _fini
w __gmon_start__
0000000000000700 T _init
00000000000008f0 R _IO_stdin_used
w _ITM_deregisterTMCloneTable
w _ITM_registerTMCloneTable
00000000000008e0 T __libc_csu_fini
0000000000000870 T __libc_csu_init
U __libc_start_main
0000000000000750 T main
U Py_BytesMain
0000000000000760 T _start
This patch changes
Libdl.dlsym(proc_handle, :main)
toLibdl.dlsym(proc_handle, :_start)
to fix https://github.com/JuliaPy/pyjulia/issues/459In Python >= 3.9,
main
cannot be accessed through the process handle (dlopen(NULL, ...)
):while it has been possible for < 3.9.
I'm not sure why this is the case since
python3.9
binary does seem to havemain
:That said, https://github.com/JuliaPy/pyjulia/issues/459 can now be solved by checking
_start
instead. (Should we checkmain
first and then fallback to_start
?)A better fix probably is to use Preferences.jl as the build-time option (#835) and get rid of automatic detection. But I wonder if this is good enough for now?
@Keno It'd be great if you can look at this, as you wrote this originally in #419.