Skip to content

Conversation

@tkf
Copy link
Member

@tkf tkf commented Oct 17, 2018

TODO:


I think deps/build.jl is complex enough to require some tests. I should have added some tests in #556.

This PR fixes a yet another bug introduced in #556. From the first version of the comment #592 (comment):

│ ERROR: LoadError: UndefVarError: libpath_lib not defined
│ Stacktrace:
│  [1] show_dlopen_error(::ErrorException) at /home/dicbro/.julia/packages/PyCall/0jMpb/deps/build.jl:63
│  [2] find_libpython(::String) at /home/dicbro/.julia/packages/PyCall/0jMpb/deps/build.jl:78
│  [3] top-level scope at logging.jl:313
│  [4] top-level scope at /home/dicbro/.julia/packages/PyCall/0jMpb/deps/build.jl:170
│  [5] include at ./boot.jl:317 [inlined]
│  [6] include_relative(::Module, ::String) at ./loading.jl:1041
│  [7] include(::Module, ::String) at ./sysimg.jl:29
│  [8] include(::String) at ./client.jl:388
│  [9] top-level scope at none:0
│ in expression starting at /home/dicbro/.julia/packages/PyCall/0jMpb/deps/build.jl:144
└ @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Operations.jl:1069

The error was produced here:

PyCall.jl/deps/build.jl

Lines 61 to 63 in ae9bbba

function show_dlopen_error(e)
if PYCALL_DEBUG_BUILD
println(stderr, "dlopen($libpath_lib) ==> ", e)

closes #596


I opened an alternative fix-only version here: #596

tkf added a commit to tkf/PyCall.jl that referenced this pull request Oct 17, 2018
The previous code accidentally worked presumably because $PWD was set
do deps when running deps/build.jl.  Cherry-picked from JuliaPy#595.
@tkf tkf force-pushed the fix-find_libpython branch from fa635ab to 325f16b Compare October 17, 2018 08:36
env = copy(ENV)
if dirname(cmd.exec[1]) == abspath(Conda.PYTHONDIR)
pythonvars = String[]
for var in keys(env)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we just call Conda._set_conda_env?

Copy link
Member Author

@tkf tkf Oct 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this may be required for Conda with Python >= 3.7. JuliaPy/Conda.jl#125 (comment)

It's probably better to define Conda.run which is like Base.run but with appropriate environment variables. I think you'll need it in IJulia as well to let Python running Jupyter server to load appropriate DLL in Windows. Using "private" function starting with underscore is a bit awkward.

stevengj pushed a commit that referenced this pull request Oct 17, 2018
* Fix show_dlopen_error

See the first version of the comment
#592 (comment)

* Fix a possible bug in exec_find_libpython

The previous code accidentally worked presumably because $PWD was set
do deps when running deps/build.jl.  Cherry-picked from #595.
@tkf tkf reopened this Feb 1, 2019
@tkf tkf force-pushed the fix-find_libpython branch 2 times, most recently from bdb3b91 to eb797f7 Compare February 1, 2019 04:29
@tkf tkf force-pushed the fix-find_libpython branch from eb797f7 to 7df92b9 Compare February 7, 2019 00:31
@stevengj stevengj merged commit 79d5141 into JuliaPy:master Feb 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants