-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
cleanup julia_init options #9266
Conversation
moves all configuration options into jl_compileropts compute the abspath/realpath of file paths in the config to avoid issues with chdir
💯 |
I like this. +1 |
@@ -1002,20 +1107,17 @@ void jl_compile_all(void); | |||
|
|||
DLLEXPORT int julia_trampoline(int argc, char **argv, int (*pmain)(int ac,char *av[])) | |||
{ | |||
#if defined(_OS_WINDOWS_) | |||
SetUnhandledExceptionFilter(exception_handler); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change related?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved this line to be with the rest of the signal handlers (https://github.com/JuliaLang/julia/pull/9266/files#diff-885908120835b66f90958a39baeb2018R1073). i think that should be more consistent with what these functions are intended to do (and hence falls in line with "cleanup of julia init")
@JeffBezanson these latests commits add a few more initialization-related cleanup items (also driven by #8745-related work) |
DLLEXPORT jl_jmp_buf jl_base_ctx; | ||
static jl_jmp_buf * volatile jl_jmp_target; | ||
|
||
#if defined(_CPU_X86_64_) || defined(_CPU_X86_) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be #if (defined(_CPU_X86_64_) || defined(_CPU_X86_)) && !defined(_MSC_VER)
since inline assembly doesn't appear to be supported in MSVC for 64 bit
Also note the appveyor failure with mingw64, I'll see if I can reproduce that locally when I get a chance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's incredibly annoying.
at some point, someone will have to copy the ASM instructions to a MASM file, but for now, that's why I left the option here (plus I don't have an ARM computer to test on)
The embedding docs should be updated; they mention |
{ | ||
// this runs the first time we switch to a task | ||
jl_task_t *t = jl_current_task; | ||
jl_value_t *arg = jl_task_arg_in_transit; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might as well git rid of this while you're at it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do. the diff in that other issue was actually against this branch, i just didn't want to include it if it wasn't correct (something about Jeff not wanting to have too many different changes happening in the same PR...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR already entirely replaces the relevant code so it's kind of moot.
i think that addresses all comments thus far |
return out; | ||
} | ||
|
||
static void jl_resolve_sysimg_location(JL_IMAGE_SEARCH rel) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a comment that describes what this function does? And that it operates by reading and writing jl_compileropts
.
cleanup julia_init options
This is broken on Win64! Debug builds don't work, and it segfaults in the tests. Can we pay attention to the statuses here? |
agreed. i'm currently trying to look into why that win64 build is consistently failing |
Sorry. Will it be a quick fix or should I revert? |
Not sure on the test issue. It's a MemoryError on the most recent appveyor builds but a segfault locally. The debug build fails with
so I think |
no, i can fix it quick. i'm just being too exact about the amount of stack I'm copying on linux and win32, %RSP points to the top of the function stack frame on win64, %RSP points to the top of the stack frame, but there's a spill area above that equal to |
|
this attempts to be more consistent and centralized about initializing julia paths (build_path, image_file, julia_home). this is in an attempt to make embedding julia easier. also, it should help with spawning child processes (by providing more reliable access to the parameters, without dependence of the working directory)
@tkelman @ihnorton @staticfloat