This project uses soloist and librarian-chef to run a custom set of the recipes in sprout-wrap's cookbooks.
Additionally, it adds the lyraphase_workstation
cookbook for
installing a Digital Audio Workstation (DAW), and miscellaneous audio and development tools.
Keeping this bootstrap provisioning project working on each macOS update sure is a lot of work! If you find this project useful and appreciate my work, would you be willing to click one of the buttons below to Sponsor this project and help me continue?
Method | Button |
---|---|
GitHub | π Sponsor |
Liberapay | |
PayPal |
Every little bit is appreciated! Thank you! π
This guide assumes that you have an Apple machine running a recent version of macOS.
The Semi-Manual way section assumes that you know how to use RVM to install Ruby and Bundler to install Ruby Gems, but gives some commands to assist you in installing the supported versions.
Open a terminal and run:
\curl -Ls https://git.io/Jy0EQ | bash
Alternatively, run:
git clone https://github.com/LyraPhase/sprout-wrap.git
cd sprout-wrap
make bootstrap
Download and install XCode or the XCode command line tools.
xcode-select --install
To provision your machine, open up Terminal and enter the following:
sudo xcodebuild -license
xcode-select --install
git clone https://github.com/LyraPhase/sprout-wrap.git
cd sprout-wrap
bash -c "./bootstrap-scripts/bootstrap-rvm.sh $USER"
export PATH="$PATH:$HOME/.rvm/bin"
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
sprout_ruby_version=$(tr -d '\n' < "${REPO_BASE}/.ruby-version")
sprout_ruby_gemset=$(tr -d '\n' < "${REPO_BASE}/.ruby-gemset")
sprout_rubygems_ver=$(tr -d '\n' < "${REPO_BASE}/.rubygems-version") ## Passed to gem update --system
sprout_bundler_ver=$(grep -A 1 "BUNDLED WITH" Gemfile.lock | tail -n 1 | tr -d '[:blank:]')
# Install Ruby, Create Gemset and install Bundler + RubyGems
## NOTE: You might need to set compilation options for native gem extensions (e.g.: libffi, nokogiri)
rvm install "ruby-${sprout_ruby_version}"
rvm use "ruby-${sprout_ruby_version}"
rvm gemset create "$sprout_ruby_gemset"
rvm use "ruby-${sprout_ruby_version}"@"${sprout_ruby_gemset}"
rvm "${sprout_ruby_version}" do gem update --system "${sprout_rubygems_ver}"
rvm "${sprout_ruby_version}" do gem install --default "bundler:${sprout_bundler_ver}"
if ! bundle list | grep -q "bundler.*${sprout_bundler_ver}"; then
bundle exec gem install --default "bundler:${sprout_bundler_ver}"
fi
bundle config set --local path 'vendor/bundle' ;
bundle config set --local without 'development' ;
bundle install
caffeinate ./sprout
The caffeinate
command will keep your computer awake while installing;
depending on your network connection, soloistrc
, and run_list
,
soloist can take from 10 minutes to 2 hours to complete.
As of macOS 10.14
, the behavior of underlying ObjectiveC macOS Foundation framework changed.
(Big surprise, Apple changes fundamental development platform dependencies so often it causes many things to break ππ©)
This results in the following errors:
objc[37813]: +[__NSPlaceholderDictionary initialize] may have been in progress in another thread when fork() was called.
objc[37813]: +[__NSPlaceholderDictionary initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
[2020-07-20T16:25:31-06:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process terminated by signal 6 (IOT)
[2020-07-20T16:25:31-06:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process terminated by signal 6 (IOT)
The workaround is to run soloist
/ chef-solo
with the following environment variable:
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
bundle exec soloist run_recipe homebrew::install_casks ## For example
If you receive errors like this:
clang: error: unknown argument: '-multiply_definedsuppress'
then try downgrading those errors like this:
sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future bundle
If you receive a message about the update server being unavailable and are on Mavericks, then you already have the command line tools.
This project uses soloist and librarian-chef to run a subset of the recipes in sprout's cookbooks.
Fork it to customize its attributes in soloistrc and the list of recipes you'd like to use for your team. You may also want to add other cookbooks to its Cheffile, perhaps one of the many community cookbooks. By default it configures an macOS workstation for development and as a Digital Audio Workstation environment.
Finally, if you've never used Chef before - we highly recommend you buy & watch this excellent 17 minute screencast by Ryan Bates.
- Homebrew path prefix has changed on Apple Silicon to
/opt/homebrew
. You may encounter issues after migrating from an Intel Mac unless running under RosettaTerminal.app
. Fresh installs onarm64
based hardware will use the new location and compile natively for Apple Silicon. - Homebrew cask has been integrated with Homebrew proper.
If you are experiencing problems installing casks and have an older installation of Homebrew,
running
brew uninstall --force brew-cask; brew update
should fix things. - If you are updating from an older version of
sprout-wrap
, your homebrew configuration insoloistrc
might be undernode_attributes.sprout.homebrew.formulae
andnode_attributes.sprout.homebrew.casks
. These will need to be updated tonode_attributes.homebrew.formulas
(note the change from formulae to formulas) andnode_attributes.homebrew.casks
.
Some helpful commands and tricks to know when working on this repo:
-
To run
bootstrap.sh
with a customsoloistrc
:export SOLOISTRC='soloistrc.lyra.yml'
-
To test
bootstrap.sh
curl
piped tobash
mode on a development branch (withset -x
trace mode):export SPROUT_WRAP_BRANCH=my-feature-branch export SOLOISTRC=soloistrc.my-feature-test \curl -Ls https://raw.githubusercontent.com/LyraPhase/sprout-wrap/${SPROUT_WRAP_BRANCH}/bootstrap-scripts/bootstrap.sh | bash -x
-
To replicate what
bootstrap
CI workflow does:export CI=true # Ensure you have same Ruby + RubyGems + Bundler versions bundle install bundle exec make bootstrap
-
To replicate what
test
CI workflow does:export CI=true # Ensure you have same Ruby + RubyGems + Bundler versions bundle install bundle exec make test
-
To run
sprout
:make sprout
-
For extra Makefile targets:
make help
-
To clear GitHub Actions Cache (invalidates hash key prefix):
make clear-github-cache
See LyraPhase Sprout Project Tracker: https://github.com/orgs/LyraPhase/projects/1
Join LyraPhase/sprout-wrap Discussions to discuss this fork. You might also want to join [email protected] if you use Sprout. (Note: This may not be very active anymore)
- Slides from @hiremaga's lightning talk on Sprout at Pivotal Labs in June 2013
- Railscast on chef-solo by Ryan Bates (PAID)