Skip to content
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

ccall: report static compile-time load issues correctly #34062

Merged
merged 3 commits into from
Dec 12, 2019
Merged

Conversation

vtjnash
Copy link
Member

@vtjnash vtjnash commented Dec 9, 2019

fix #34061

Should have a test added that checks that something like:

./julia --output-o=x.o -e 'Base.reinit_stdio(); 
    f() = ccall((:dne, :does_not_exist), Cvoid, ());
    precompile(f, ())'

doesn't crash, or that calling f() exits the process early (no output-o file) with the message:

ERROR: could not load library "does_not_exist"
dlopen(does_not_exist.dylib, 1): image not found
Stacktrace:
 [1] f() at ./none:2
 [2] top-level scope at none:3

@KristofferC
Copy link
Member

KristofferC commented Dec 9, 2019

Confirmed this fixes the original use-case that caused me to file #34061.

@vtjnash vtjnash added the needs tests Unit tests are required for this change label Dec 10, 2019
@KristofferC
Copy link
Member

Pushed a test

@JeffBezanson JeffBezanson removed the needs tests Unit tests are required for this change label Dec 11, 2019
@JeffBezanson
Copy link
Member

Ready to merge?

Copy link
Member Author

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

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

This test may be too slow (adds maybe 1 to 4 minutes) for something fairly trivial

test/ccall.jl Outdated Show resolved Hide resolved
@vtjnash
Copy link
Member Author

vtjnash commented Dec 13, 2019

@KristofferC You didn't address my review comment. Also, please cleanup up the commit messages when merging.

@KristofferC
Copy link
Member

Strange, I completely missed that comment. I can change it to the fast fail version.

KristofferC pushed a commit that referenced this pull request Dec 17, 2019
* ccall: report static compile-time load issues correctly

fix #34061

* add a test

* Update ccall.jl

(cherry picked from commit 8a47793)
@KristofferC KristofferC mentioned this pull request Dec 17, 2019
18 tasks
KristofferC pushed a commit that referenced this pull request Apr 11, 2020
* ccall: report static compile-time load issues correctly

fix #34061

* add a test

* Update ccall.jl
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.

precompile shouldn't try opening dylibs
3 participants