pantsbuild / binaries

A temporary home for pants static binaries and scripts
16 stars 37 forks source link

macOS mojave support #82

Open michaelgmiller opened 6 years ago

michaelgmiller commented 6 years ago

Similar to https://github.com/pantsbuild/binaries/issues/17, pants needs binaries for macOS mojave

Exception message: Update --binaries-path-by-id to find binaries for (u'darwin', u'18')

benjyw commented 6 years ago

@mateor you were able to do this last time, feel like taking it on again? Also, is this possible to do in some scratch mac on https://www.macstadium.com/ ? Happy to do it if so and you remind me how...

benjyw commented 6 years ago

@michaelgmiller are you able to work around this with

[GLOBAL]
binaries_path_by_id = +{('darwin', '18'): ('mac', '10.13')}

or --binaries-path-by-id="+{('darwin', '18'): ('mac', '10.13')}"

for now?

michaelgmiller commented 6 years ago

@michaelgmiller are you able to work around this with

[GLOBAL]
binaries_path_by_id = {('darwin', '18'): ('mac', '10.13')}

or --binaries-path-by-id="{('darwin', '18'): ('mac', '10.13')}'

for now?

Yup, I've been using that as a workaround in the mean time!

benjyw commented 6 years ago

See https://github.com/pantsbuild/pants/pull/6591 for a more permanent fix that should cover future mac upgrades (at least until Macs change their hardware arch, or there's some other breaking change...)

mateor commented 5 years ago

Hi all. Sorry I missed this ping. I only saw it now when I realized that watchman wasn't updated.

Rebuilding the binaries properly requires wide triaging of Make files for bitrot across a variety of ecosystems, and was a real pain when I did it for 10.12. I think that Benjy's patch is a big win overall.

John took the shortest path for 10.13 and generously documented his approach in the commit:

$ find $PWD/build-support/bin -wholename "*/mac/10.12/*" -type f | {
  while read binary
  do
    newbin=${binary/\/10.12\//\/10.13\/}

    binary=$(basename ${newbin})
    newdir=$(dirname ${newbin})
    version=$(basename ${newdir})

    rm -rf ${newdir}
    mkdir -p ${newdir}
    cd ${newdir}
    ln -s ../../10.12/${version}/${binary}
  done
}

My org has been using the remapping trick via environmental variable, so AFIACT the compatibility guarantees have held.

          # Hack(s) to allow OSX 10.14 early adopters to use the 10.13 binaries before we upload copies to that namespace.
          export PANTS_BINARIES_PATH_BY_ID=${PANTS_BINARIES_PATH_BY_ID:-'{ ("darwin", "18"): ("mac", "10.13") }'}

I can't break away to do a full rebuild but given that our upstream solution of resuse is live in newer Pants distributions, how about I run that snippet and update this codebase with 10.14 symlinks for anyone using a Pants version that predates your patch?