-
Notifications
You must be signed in to change notification settings - Fork 235
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
[Fix] MacOS build when xcode is not installed #1045
Conversation
Thanks for contributing! Could you rebase into fewer (perhaps 1 if there isn't reason for more) commits and force-push? That needs to happen anyway, so reviewers might as well look at what you think should go in, vs an intermediate state. I prefer to wait until then to read the diff, as I don't really have enough cycles for unison maintenance. (I do have a mac I can test on.) When rebasing, please ensure that the rationale for how things are ends up in comments and the rationale for the change is fully in the commit message. The union of the commit messages doesn't read like that now ;-) The PR comments will be lost on merge. Compiler tools on mac are a bit of a mess. I guess you are talking about having CLT but not the rest. Please make sure the explanation of the problem can be followed by someone who is a little hazy on exactly how oddly Apple does this. My belief is that even people with CS degrees who have macs are generally a little unclear on CLT/XCode and how things relate, now and in earlier versions - it seems to keep changing. Perhaps we should instead change the logic so that the mac gui is not built by default, but only when an explicit target is requested. I'm not 100% comfortable with "mac gui is built on mac, except when it isn't". We could also consider a better error message for the gui build, so it fails more cleanly and the invoker rapidly understands. |
1c17aa5
to
507ebd0
Compare
I only keep one commit. Yes I talk about the command line tools without xcode, sorry if I wasn't clear. |
Do you think we should change the default and only build the mac gui if it's explicitly intended or provided a better error message when it fails ? |
I am not really sure. But I don't really like silently not building it if there's isn't enough xcode support. I know there is a tradition of enabling options if things are present in build systems, but as a packager that's more of a bug. So far, we have had "build mac gui if a mac". So that argues that the lesser change is to keep doing that, and turn a hard-to-read error into "Can't build Unison.app because XCode is not installed:" or something more useful. The big question is how normal it is to have a setup where you can build C programs but don't have XCode, and how people in that situation got there. And also how this relates to following the instructions in INSTALL.txt. |
But currently it causes the opam install of
|
One example to get in this situation is to install homebrew, homebrew requires you to install the |
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'd prefer to align this with "On macOS, don't build native GUI if XCode is not installed" and leave the "non-XCode version of xcodebuild" confusing detail to the detail. (The real point of 1st-line commit messages is to have the first 54 characters give enough of a clue that someone can get the big picture and know if they want to read the whole commit or not. I know I'm being picky, but that's partially for future me looking back, and partially for others :-)
507ebd0
to
be7c790
Compare
I can't comment on the Mac particulars but overall I'm fine with this patch. Just a couple of nit-picks. Move the comment into the first |
be7c790
to
f76376f
Compare
I move the comment, Is it what you meant ? |
Looks good to me - thanks for engaging with review/fixups. I have enabled the workflow again to run regression tests. |
Yes, thank you. I've only looked at the patch in GH but indendation and spaces-vs-tabs look broken to me. Please fix before it gets merged. |
bb6d51e
to
8b860cd
Compare
MacOS has two way to install tools you need to develop (make, git, cc, ...). Either install Xcode or something called Command Line Tools. But the Command Line Tools version doesn't include all the necessary programs to build Apple applications. For example xcodebuild, which if invoked without XCode installed will tell that xcode is not installed and exit with an non 0 exit code.
There were spaces before the tab ;-) To just finish I just removed them and forced-push. |
Thanks again for being cooperative with our software process! |
Thanks you |
You are welcome, it's a pleasure to help. Thanks you @gdt, @tleedjarv for your time. |
On MacOS, there is two way to install tools you need to develop (make, git, cc, ...). EIther install
Xcode
or something calledCommand Line Tools
. But theCommand Line Tools
version doesn't include all the necessary programs to build Apple applications.Currently the src/Makefile.OCaml assumes that if the
OSARCH
isDarwin
so it can build the macui but if the xcode version of xcodebuild is not installed, any usage ofxcodebuild
will trigger the following message and stop the build process with an error.