Skip to content
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

reformat OS X build instrcs, add 10.8 + Homebrew #2026

Conversation

colindean
Copy link
Contributor

I reformatted the entire document to look pretty in both standard text and Markdown. This should make it a lot easier to read.

Also, I incorporated my OS X 10.8 build instructions with Homebrew as the package manager. I originally posted them on the Bitcoin Stackexchange in the question Trouble compiling bitcoind on OSX with homebrew. I've used these instructions twice now, so I'm fairly certain they'll work.

I do recognize that I need to find a way to get the Makefile to look at Homebrew's Cellar without needing to be patched. WIP on my branch entitled feature/osx10.8-bitcoind-compilation.

should be put, or just try the below command.

echo "rpcuser=bitcoinrpc
rpcpassword=HdAseQSRkirfoNuUSzqzixyL9sM1T6ABfzV1nyNmbuwg" > "/Users/${USER}/Library/Application Support/Bitcoin/bitcoin.conf"
Copy link
Contributor

Choose a reason for hiding this comment

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

rpcpassword=$(xxd -l 16 -p /dev/urandom) > ...etc would be better to create a random 16-hex-character password.

@colindean
Copy link
Contributor Author

Updated as suggested!

@BitcoinPullTester
Copy link

Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/933304fe886c8e7f3dd6d90acec3f8ee7cd60980 for binaries and test log.

@gavinandresen
Copy link
Contributor

Question: why is openssl special with homebrew? It'd be really nice not to have to ship a Makefile.osx patch that is likely to break when we change Makefile.osx in the future, and it looks like openssl is the only change that couldn't just be made to Makefile.osx directly.

Also: I think breaking the instructions into three sections:

  • Installing for development using MacPorts
  • Installing for development using HomeBrew
  • Special notes on creating release builds
    (that I'd write)

... would be less confusing.

Finally: can you squash all this into one commit?

@colindean
Copy link
Contributor Author

Homebrew doesn't link openssl like it does other packages because "The OpenSSL provided by OS X is too old for some software." It installs in "keg-only" mode, and has to be manually linked only if required:

What does keg-only mean? It means the formula is installed only into the Cellar, it is not linked into /usr/local. This means most tools will not find it. We don’t do this for stupid reasons. You can link the formula in still if you need to with brew link. - Homebrew FAQ

I interpret this to mean that if we rely on openssl to be linked already or include an instruction to link it, things may break. I'd rather not see Bitcoin as the cause of a broken dev system because a newer version of openssl is causing problems for Apple's stuff.

One can get the path to Homebrew's installation of openssl with brew --prefix openssl. However, it appears that the current makefile.osx doesn't account for the possibility of multiple hierarchies to get the include and lib for all necessary libraries. It relies on DEPSDIR to set INCLUDEPATHS and LIBPATHS.

This also exacerbates static building, because it, too, relies on DEPSDIR and everything being in the same hierarchy. Maybe static compilation as coded is not so much a problem if the releaser is always using MacPorts.

That said, I'd rather not see a separate makefile.osx just for Homebrew folk. The patch does just enough to make it work for now. I could further improve the patch and the instructions to allow passing of brew --prefix openssl at compilation time in order to eliminate the possibility of an openssl version bump messing up the paths added in the patch.

If we* could alter makefile.osx to better account for the differences between Homebrew and MacPorts, and do so dynamically, we could remove the need for the patch and remove the need for a separate path of instructions for each packaging system.

Unfortunately, I don't have access to a system with MacPorts installed and I'm hesitant to introduce it onto mine for fear of messing up my own environment for other things ;-)

If what's here now in this pull request is good enough for 0.8, I'll split the HOWTO into sections as suggested and squash these commits somehow (is there a way to do that without having to delete and recreate the branch? I've only had to squash once and just ended up doing that and resubmitting a PR) and get them ready. Otherwise, perhaps a makefile.osx modification is in order for 0.9.

*we = someone involved in the project with perhaps stronger Makefile kung-foo than I

@colindean
Copy link
Contributor Author

I note also that I'll need to remove the USE_IPV6=1 from the make command, per #2064.

@gavinandresen
Copy link
Contributor

I just set up a machine to do a release build a couple of days ago for the 0.7.2 release, so I went through my bash history and updated the instructions:

https://gist.github.com/4224563

@colindean
Copy link
Contributor Author

I've not forgotten about this. I intend to get to it mid week.

@colindean
Copy link
Contributor Author

I've incorporated the suggested changes and squashed everything together.

@BitcoinPullTester
Copy link

Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/82cc0ea4fb3e6847ba7475d4fa28942132009de4 for binaries and test log.

@BitcoinPullTester
Copy link

Automatic sanity-testing: FAILED MERGE, see http://jenkins.bluematt.me/pull-tester/82cc0ea4fb3e6847ba7475d4fa28942132009de4 for test log.

This pull does not merge cleanly onto current master

@luke-jr
Copy link
Member

luke-jr commented Jan 30, 2013

@colindean, rebase needed

@colindean
Copy link
Contributor Author

@luke-jr I think I did it right...?

@colindean
Copy link
Contributor Author

I updated my branch to ensure that it merges cleanly with master.

@colindean
Copy link
Contributor Author

I just updated again, resyncing with master and with two optimizations:

  • OpenSSL 1.0.1c is no longer hardcoded
  • Static compilation now works (tested on another 10.8 machine without any of the dev dependencies)

The makefile patch is still necessary. A future optimization would ideally remove this necessity, but I don't have another machine available running MacPorts on which I can test.

@colindean
Copy link
Contributor Author

Another update, after discovering a new formula in Homebrew for building berkeley-db4 without having to revert to an older version of the formula. Revised the makefile patch and the instructions to reflect this. Now, the only existing difference between the Homebrew and MacPorts instructions is the need to patch the makefile because of path differences between the two systems.

* reformatted the entire document to look pretty in both standard text and
  Markdown
* incorporated [my OS X 10.8 build instructions with Homebrew as the package
  manager](http://bitcoin.stackexchange.com/questions/3672/trouble-compiling-bitcoind-on-osx-with-homebrew/5253#5253)
* incorporated @gavinandresen's MacPorts and release build instructions based on
  an earlier revision of this commit
* added makefile patch necessary for Homebrew compilation to `contrib`
@colindean
Copy link
Contributor Author

Rebased to current master as of 0.8.0 release.

@gavinandresen @luke-jr, anything else?

gavinandresen added a commit that referenced this pull request Feb 22, 2013
…nstructions

reformat OS X build instrcs, add 10.8 + Homebrew
@gavinandresen gavinandresen merged commit 69c5609 into bitcoin:master Feb 22, 2013
laudney pushed a commit to reddcoin-project/reddcoin-3.10 that referenced this pull request Mar 19, 2014
…e-osx-instructions

reformat OS X build instrcs, add 10.8 + Homebrew
KolbyML pushed a commit to KolbyML/bitcoin that referenced this pull request Dec 5, 2020
578e308 [Cleanup] Remove stale siphash.py file (Fuzzbawls)

Pull request description:

  This file managed to get reintroduced after we moved the regression test
   suite to the `test` folder. Remove it as it isn't used anywhere.

ACKs for top commit:
  random-zebra:
    Yeah, the one we use is the `test` folder. utACK 578e308
  furszy:
    utACK 578e308

Tree-SHA512: 5a96e8b9086ce6ecea7a5e20416a6021e59c756144f98a34160fa8d1d7da2b0ed97df1ab3fad67d281e02bdcd3cd282dd01190a24ebff14fcac354fae4b58560
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
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

4 participants