Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

Install all dependencies on macOS using Homebrew #101

Closed
wants to merge 5 commits into from

Conversation

hawkw
Copy link
Contributor

@hawkw hawkw commented Nov 16, 2016

Closes #53.

This PR adds a Brewfile which, when used with Homebrew's brew bundle command, will install all the tools needed to build intermezzOS. I've also updated the documentation to match.

@hawkw
Copy link
Contributor Author

hawkw commented Nov 16, 2016

I can also open a similar PR for intermezzOS/bare-bones, if you'd like?

That line is no longer relevant, since Homebrew will install the
x86_64-pc-elf toolchain to /usr/local/bin rather than to
/Users/yourusername/opt/bin.
@hawkw
Copy link
Contributor Author

hawkw commented Nov 16, 2016

Well, the build broke, but I don't think it has anything to do with the changes in this PR – my Rust OS project's build broke on Travis with the same error. Looks like something changed upstream, maybe in xargo?

@steveklabnik
Copy link
Member

Nice! @ashleygwilliams , maybe give this a try on your mac later to double check?

@hawkw I agree the failures seem strange; I'll try to investigate soon.

@steveklabnik
Copy link
Member

steveklabnik commented Nov 16, 2016

oh look https://users.rust-lang.org/t/compile-failures-with-1-15-0-nightly-2016-11-14/8032

TL;DR: rust-lang/rust#37786 will fix the build with the next nightly.

@ashleygwilliams ashleygwilliams self-assigned this Nov 16, 2016
@ashleygwilliams
Copy link
Member

cool- will take a look in a second!

@hawkw
Copy link
Contributor Author

hawkw commented Nov 16, 2016

@ashleygwilliams thanks! I've got everything working on my machine, but of course that doesn't mean that it'll work everywhere – I'm eager to hear if it'll work for you, too.

N.B. that if you're not installing from the Brewfile, you need to pass the flags --with-x86_64-pc-elf --HEAD to brew install grub; the formula isn't 100% complete and won't install successfully unless you're on HEAD.

@steveklabnik
Copy link
Member

Hey @hawkw , thanks again for this! Hoping to have some time for intermezzOS soon; it's been a busy few months.

@hawkw
Copy link
Contributor Author

hawkw commented Dec 24, 2016

@steveklabnik, you're quote welcome! Do let me know if you hit any trouble.

@ashleygwilliams
Copy link
Member

hey! just ran this on my mac, running 10.11.6
is full xcode a dependency of this brew script? previously it did not require full xcode. lemme know! thanks! and sorry the review has taken so long

Tapping hawkw/grub
Installing grub formula. It is not currently installed.
==> Installing grub from hawkw/grub
grub: A full installation of Xcode.app is required to compile this software.
Installing just the Command Line Tools is not sufficient.
Xcode can be installed from the App Store.
Error: An unsatisfied requirement failed this build.
Installing grub has failed!
Homebrew Bundle failed! 1 Brewfile dependencies failed to install.
Kernel.exit
Error: Kernel.exit
Ashleys-MacBook-Pro:kernel ag_dubs$

Copy link
Member

@ashleygwilliams ashleygwilliams left a comment

Choose a reason for hiding this comment

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

i'd like to see a CI test for this, see also Travis Docs on OSX builds https://docs.travis-ci.com/user/osx-ci-environment/#Homebrew

@hawkw
Copy link
Contributor Author

hawkw commented Jan 1, 2017

@ashleygwilliams: there is a CI build set up for the x86-64-pc-elf-binutils tap: https://travis-ci.org/hawkw/homebrew-x86_64-pc-elf; I'll see about setting one up for grub as well.

@steveklabnik
Copy link
Member

https://docs.travis-ci.com/user/multi-os/#Example-Multi-OS-Build-Matrix is probably a better link; @hawkw , we were thinking about the intermezzOS build itself, not just the sub-components. We don't have any testing so far, so in my opinion, doing that here isn't required, but it'd be a good thing to have.

I tried looking at your brew scripts and it wasn't obvious to me why it required the full XCode Tools...

@hawkw
Copy link
Contributor Author

hawkw commented Jan 1, 2017 via email

@hawkw
Copy link
Contributor Author

hawkw commented Jan 2, 2017

Okay, 02901a0 adds a macOS build to your .travis.yml.

The first macOS build will take within sigma of forever - building gcc is slow – but I've set it up to cache the Homebrew package directories so future builds shouldn't take quite so long.

@steveklabnik
Copy link
Member

Ahhh this is great, thanks!

As for the XCode requirement, if I recall correctly, it was about the only way I could get Homebrew to use a version of gcc that could actually compile Grub.

Ahh interesting, so I wonder if the issue here is that when we build our own gcc, we can build grub, but when we use homebrew's gcc, we can't. I wonder if there's someone we can ask about this....

@hawkw
Copy link
Contributor Author

hawkw commented Jan 2, 2017

@steveklabnik I suspect there might be another way to make Homebrew use a gcc that Grub's makefile doesn't balk at, but I don't know enough about Homebrew to make it work. Using Xcode's gcc is definitely not ideal, but it works for now...

@steveklabnik
Copy link
Member

Two different people on twitter (one private) told me that setting HOMEBREW_CC= might be the answer

@steveklabnik
Copy link
Member

So https://github.com/hawkw/homebrew-grub/blob/master/Formula/grub.rb#L25 is the line that requires it.

You had said that

it was about the only way I could get Homebrew to use a version of gcc that could actually compile Grub.

Do you remember the errors you got? Maybe we can fix them...

@hawkw
Copy link
Contributor Author

hawkw commented Jan 2, 2017

@steveklabnik hmm, it was a while ago...there were a couple of checks in the configure script that were going wrong, depending on which CC it was getting - I don't remember precisely, sorry.

@hawkw
Copy link
Contributor Author

hawkw commented Jan 2, 2017

The problem, as I remember it, is that "gcc" on the Mac is not unlike a box of chocolates...you never really know what you're gonna get. Stuff will claim to be gcc and actually be symlinked to clang, and so on, and Homebrew has a big wad of shims it injects into the build environment that just confuses this.

Tomorrow, I'll see if I can extract anything useful from the formula's commit history?

@hawkw
Copy link
Contributor Author

hawkw commented Jan 2, 2017

hawkw/homebrew-grub@c9c0cc2 removes the Xcode requirement to build grub – I tested it on my machine and it seems to work fine.

@steveklabnik
Copy link
Member

guh. sorry that i am the worst and let this sit for over a year. I feel terrible. I'm trying to get back to a clean slate here, so sadly, i need to close this. I hope you got something out of this, sorry for failing you :(

@hawkw
Copy link
Contributor Author

hawkw commented Mar 9, 2018

That's fine, don't worry about it --- I'm in more or less the same place with my hobby OS project. I think the homebrew taps are out of date anyway, but if you try using them again and have any issues, please let me know!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants