servo: Unable to build Servo on a Mac with Xcode 10 (crash / freeze)
I’ve recently noticed(in the last week) that it has become impossible to do a successful ./mach build -d -p servo on a machine with 4GB of RAM.
At the dsymutil stage of the build, memory usage skyrockets, the UI becomes unresponsive, and finally the machine reboots…
For the past two years, it was always quite slow, however with enough patience it was possible. dsymutil was always the most memory-consuming part, yet it would build-up slowly instead of skyrocketing like it seems to be doing now.
My machine is probably coming towards the end of it’s lifetime, so this might be a temporary problem for me personally, however, I am wondering if we’re not setting the bar too high for new contributors in terms of machine specs? A slow build is one thing, an impossible one is quite another…
I’m also wondering what caused this sudden change in behavior of the build? Could this be prevented with a flag of some sorts? I remember a while back I had a problem of too much memory usage with dsymutil(although not to the point of reboot) because both libsimpleservo and libservo would build, and using the -p servo flag solved that.
Could be related to https://github.com/servo/servo/issues/21745
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 38 (35 by maintainers)
Commits related to this issue
- Auto merge of #21799 - codehag:bug_1172897_rename_tab_actor, r=jdm Bug 1172897 - Rename Tab Actor to BrowsingContextActor As part of [Bug 1172987](https://bugzilla.mozilla.org/show_bug.cgi?id=117289... — committed to servo/servo by deleted user 8 years ago
- Auto merge of #21799 - codehag:bug_1172897_rename_tab_actor, r=jdm Bug 1172897 - Rename Tab Actor to BrowsingContextActor As part of [Bug 1172987](https://bugzilla.mozilla.org/show_bug.cgi?id=117289... — committed to servo/servo by deleted user 8 years ago
- README: Specify Xcode version. Fix #21792 — committed to servo/servo by paulrouget 8 years ago
- Auto merge of #23147 - servo:paulrouget-patch-2, r=jdm README: Specify Xcode version. Fix #21792 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" hei... — committed to servo/servo by deleted user 8 years ago
- Auto merge of #23147 - servo:paulrouget-patch-2, r=jdm README: Specify Xcode version. Fix #21792 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" hei... — committed to servo/servo by deleted user 8 years ago
- README: Specify Xcode version. Fix #21792 — committed to robert-snakard/servo by paulrouget 8 years ago
tl;dr: The reason why the linker can’t find lstd++ is because Apple no longer places the
/usr/includedirectory when installing XCode 10 and CLI tools. You need to run the package in/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkgafter installing the command line tools withxcode-select --install.I was experiencing the issue noted by @Walther here as well as here and was unsatisfied by the ‘install xcode 9’ solution. I experienced the linking issue on 10.14.1 and 10.14.2 with no relief. I started digging and eventually found this stackoverflow post that also explained issues I was having with Homebrew. The
/usr/include/directory is no longer being placed by Apple when installing XCode/XCode CLI tools. The net result is random breaks when installing certain packages from Homebrew. More importantly, unix-style build chain tools malfunction on OS X Mojave with XCode 10. Apple actually notes this in the release notes for XCode 10.With respect to the freezing/crash issue, I observed during the compilation of
layout-thread,rustcuses about 5.5 gb of memory. On Macs with <8 GB of ram I can see that causing freezes/crashes. During the compilation oflibservo, the wired memory usage on my MBP topped 13 GB, though I couldn’t find which process it was being attributed to. My MBP started freezing up and lead to me panic closing every application. My guess is its either some sort of bug in 10.14.x that the final linking causes to go bonkers or something is opening too many file handles. I’ll dig some more now that I’m able to successfully compile.I’m gonna go ahead and close the bug on Apple’s side. Memory doesn’t blow up anymore, and there is not perceptible freeze.
I will keep this issue open until Apple officially release Xcode 10.2.
For now, if you want to work around the problem, install Xcode 10.2 beta,
xcode-select -s ./Xcode-beta.app, thenmach clean, and rebuild servo.So reverting to xcode 9.4.1 appears to solve the problem.
It’s a temporary workaround, but here is how to do it:
sudo xcode-select -s path/to/Xcode.appXcode 10.2 works for me, too! 🎉🎉🎉
I filed a bug report: https://bugreport.apple.com/web/?problemID=44819811
I am on MacOS 10.14.6 with Xcode 10.3. Every time I start installing the .dmg file it crashes my laptop. Any ideas?
I just upgraded my macOS to
10.14.4which includes Xcode 10.2 (https://developer.apple.com/documentation/macos_release_notes/macos_mojave_10_14_4_release_notes).However, I will still be freezed with Xcode that I need to keep using the
Xcode-beta🤔Using:
A OSX debug build does freeze my laptop.
I’m running into this issue as well. On my Mac, which is very recent (2016, 16 GB), at link time, the OS becomes unresponsive to a point that I can’t do any work, for about 5 minutes, then my Mac restarts.
dsymutil + kernel_tasks are full CPU/memory.
This is fairly recent.
By the way,
./mach build -r -p servostill works fine, and there is perhaps something we can improve about the feedback received when trying to run the wpt tests after having done a release build.Currently, doing
./mach test-wptwill print out “The dev profile is not built. Please run ‘./mach build’ and try again.”This actually gave me the impression that the wpt tests can only be run with a dev profile, while actually doing a
/.mach test-wpt <name of the test> --relasewill work fine.I’m assuming using the dev build will be crucial for some type of debugging, yet for someone currently unable to do a
./mach build -ddue to machine specs, using a release profile to run the unit-test might be a good solution to be aware of, instead of rushing to the store to buy a new machine 😃see https://github.com/servo/servo/blob/647796ede66ad84acf6239d8b556ee3735bfc6a6/python/servo/command_base.py#L396
from a quick glance I would actually expect this conditional to return the release path in case it has been build, and no other argument have been passed to the command: https://github.com/servo/servo/blob/647796ede66ad84acf6239d8b556ee3735bfc6a6/python/servo/command_base.py#L390
It instead appears that
devisTrueby default(although not in the function signature) when doing a./mach test-wptwithout further arguments…We could also change the print statement to read something like: “The dev profile is not built and you haven’t specified --release. Please build a dev profile or specify that you want to use a release profile”.