-
-
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
Support building of system image in binary builds #9376
Conversation
Hey, that was fast, thanks. That segfault's no good though... |
Yep. I did a bit of a hack-n-slash port, which is why I wanted to see what Travis thought of it. ;) |
Looks like this is good to go. I'll squash then merge. |
On second thought, nobody but me has used this yet. I'll let it settle a little and see if there are improvements that need making. |
Yeah I like that plan |
Nice feature! Did you test it on windows? I see too possible issues.
|
No I haven't had a chance to test this yet, thank you @few for doing some testing before I could get to it! If you download the 0.4 nightlies from https://status.julialang.org/ this should be built-in, so let's make sure this is working properly on master then we can update this PR with the final version. Does WinRPM not have an Yeah we should be going deeper into sys-root\mingw$(Sys.ARCH)-w64-mingw32\bin. I think the sys-root\mingw\bin is where the Linux-host copy of mingw ld (or a symlink to it) lives on a cross-compile system. |
Now trying with 0.4 nightly:
I guess using "using" is not possible inside a function.
Now onto running build_sysimg("E:\sys").
So much for the success.
|
Ouch. Okay, this clearly needs a lot of work still. I was wanting to get it merged to master sooner rather than later since it kept getting conflicts from everyone else wanting to add new command-line flags (seriously can we try to stop doing that, am I the only one who'd rather see fewer of them, not more?), and probably doesn't break anything that was previously working. |
Forget the segfault. This was me passing -J sys.dll instead of -J sys.ji |
This PR adds new command line flag as well... |
Right which is why the version for master had to be rebased so many times. I don't think this PR is breaking (actually, it might break @staticfloat do you mind if I commit Windows fixes to this branch? |
Go right ahead. Coding is a low priority for me, so I might not take a look at this for a day or two, although I will try and do something about the OSX nightlies. |
Was out today but I'll work on the Windows side of this over the next few days. Considering #9380 this should not be merged until the mac issues on master can be resolved. |
This is proving to be tricky. If I add a
So we probably need to ensure the mingw-runtime is installed? Any better ideas than requiring |
{ "build", required_argument, 0, 'b' }, | ||
{ "lisp", no_argument, &lisp_prompt, 1 }, | ||
{ "help", no_argument, 0, 'h' }, | ||
{ "sysimage", required_argument, 0, 'J' }, | ||
{ "code-coverage", optional_argument, 0, 'c' }, | ||
{ "cpu-target", required_argument, 0, 'C' }, |
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.
following gcc/clang, we should probably call this -march=
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.
+1 to that.
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.
:/ where was the bikeshedding in #8074 ? Does getopt
let you do long args with a single dash? If not then the closest we could get would be --march=...
. We could look into switching to whatever LLVM uses for command-line option parsing, but that's not a right-before-the-tag type change.
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.
Ew. That's such a terrible option name and we don't support the single dash form. I'd prefer to use better names, although in this case I can kind of see the argument for matching the compiler weirdo names like march
.
@skumagai thanks so much! very very helpful. |
@tkelman The build generated working |
Thanks for picking up the torch on windows, Tony. And thank you for testing stuff out for us Seiji. Very helpful! |
Still not quite working. I'm going to try adding most of that crt junk to |
This commit adds a few new pieces of functionality: * The `contrib/build_sysimg.jl` script which builds a new system image. This method can save the system image wherever the user desires, e.g. it could be stored in `~/.julia`, to allow for per-user system images each customized with packages in their own `userimg.jl`. Or on a restricted system, this allows for creation of a system image without root access. * The removal of compile-time `JULIA_CPU_TARGET`, in favor of runtime `--cpu-target`/`-C` command-line flags which default to `"native"` but can be set to `"native"`, `"i386"`, `"core2"` or any other LLVM cpu target. This allows the creation of a system image targeting user-supplied cpu features, e.g. `cd base; ../julia -C i386 --build /tmp/sys_i386 sysimg.jl`. * I implemented runtime selection of the cpu target by adding a new member to the `jl_compileropts_t` structure called `cpu_target`. * Because all julia executables are now created equal, (rather than before where a julia executable needed to have the same `JULIA_CPU_TARGET` set internally as the system image had when it was built) we need to know what CPU feature set the system image is targeting before we initialize code generation. So a new function `jl_get_system_image_cpu_target()` is exported, which does exactly what it sounds like. * I added newlines to the end of a few error messages. * I found an old parser option `-T` which hadn't been removed yet, so I took the opportunity to do so. * Documentation on this has been added to doc/devdocs/sysimg.rst Forgot missing colon
Wha? There are no changes to Base here. A few changes to Doesn't adding the
I'd be fine, though slightly disappointed, with that option. However I don't want to ship |
The good news is, modulo whatever we're doing with
Sorry, I thought the |
Yes, that is good news. I feel more confident about that kind of thing now than with previous releases thanks to AppVeyor, but occasionally things sneak by so always good to check.
What, specifically, are you proposing we revert? I believe in the current code as of bf042d7, in both places that |
I'm sorry, I was completely confused. I thought due to recent discussion on |
Support building of system image in binary builds
The only remaining issues here as far as I can tell are:
Which does make sense to me. We should do that on master, get a feel for it. Anyway, checklist time? Holiday-themed release, apparently? |
Ouch, @staticfloat, we goofed here. The We aren't testing julia-debug on AppVeyor to save time, so this went unnoticed for a while. We should really revisit running the tests on the Windows buildbots, where we build a little less frequently and aren't as constrained on time. |
ah yes, there's where someone tried to open sys.dll on julia-debug.exe on windows: 86b1094#diff-669d4cc5c9c8f4573c5f8d57f5dcab20R1200 (it's mildly OK on other platforms since libjulia isn't linked to anything else on those platforms, but we should probably be loading it with the platform-specific LOAD_ONLY flags, so it doesn't run code or link itself into anything) |
backtrace, if at all useful https://gist.github.com/d1774892dda5962820a2 |
this causes libjulia and libjulia-debug to get loaded into the same process. the net effect is that symbol resolution becomes partially ambiguous and the result is a segfault shortly thereafter. the backtrace isn't particularly meaningful, since the fault could happen anywhere, the behavior is simply undefined if multiple libjulia versions get loaded into the same process. |
Ah, whoops. Yes, this makes a lot of sense. I'll try to test out a PR today. |
Wait, I'm confused. Why does this cause |
At least, those are the ones I'm loading directly. |
|
I see. This is because of this line in I can't find any mention of I'll note here that I don't get a segfault when starting the latest 0.4 |
no, that wouldn't help because the damage has already been done. i think tkelman is running the spawn test to trigger this. i don't know exactly what flags should be used, there are a couple that might be correct: https://msdn.microsoft.com/en-us/library/windows/desktop/ms684179%28v=vs.85%29.aspx |
@staticfloat on master the segfault happens in the spawn test, #10111. On release-0.3 it happens just from starting julia-debug when sys.dll is present. |
I'm having a hard time triggering this bug, so it's going to be hard for me to come up with a fix and see that it's made a difference. This is on my win64 buildbot. With a clean build on
Not only does it startup, but it runs the |
How was that built/installed? If it was doing |
It was running within the source tree of a buildbot. |
Was |
Yes, it's present. Here's it running on 0.3.6 on the buildbot:
|
I'm confused then. What is the buildbot doing differently than my machine? I forget, what version of windows are the VM's using? |
They're running 8.1 On Wed, Feb 18, 2015 at 12:35 PM, Tony Kelman notifications@github.com
|
|
Seems to be something different between Windows 7 and 8+. Using a VM of Windows Server 2012 R2 (which should be similar to Windows 8), I can run the spawn test just fine with julia-debug on master (via |
I'm going to wait for travis to turn green before I merge