iroddis / asdf-mysql

A MySQL Plugin for asdf
GNU General Public License v2.0
19 stars 8 forks source link

Use `macos11` OS association for MySQL 8.x #13

Closed eahanson closed 3 years ago

eahanson commented 3 years ago

Before this change, it would only use macos11 OS association for versions greater than 8.x, which caused the install to fail on MacOS 11 (at least on my computer).

dblanken commented 3 years ago

Yes, it looks as if the mirror sites have updated the macOS versions to use the macos11 + architecture naming convention, although on a 2019 MacBook Pro running latest OS version I get an arch of i386, which match to x86_64 on the mirror site. I noticed that using mysql-version-macos11* in the script downloaded both the arm and x86 versions, although CFILE is taking the one with the largest file size, and right now that is the ARM version (below is the ls after the untar for 8.0.26):

total 335448
drwx------   5 user staff       160 Aug  4 07:35 .
drwx------ 172 user staff      5504 Aug  4 07:34 ..
drwxr-xr-x  11 user staff       352 Aug  4 07:35 mysql-8.0.26-macos11-arm64
-r--r--r--   1 user staff 171938353 Jul  1 03:03 mysql-8.0.26-macos11-arm64.tar.gz
-r--r--r--   1 user staff 171555285 Jul  1 03:44 mysql-8.0.26-macos11-x86_64.tar.gz

@ehanson, Are you using an arm processor? Because with your change on my Intel, I get a "Bad CPU type in executable" error due to the arm version being used when trying to execute mysql due to it being the arm version.

Should a case be added to convert the arch macOS gives to the string the mirrors expect? Then you could add that to the end of the macOS filename?

# Make * arm since I can't test what it returns
case "$(arch)" in
  i386)
    ARCH="x86_64"
    ;;
  *)
    ARCH="arm64"
    ;;
esac

Granted this change is needed since without your PR I don't get any version installed. 😄

On a separate note, I believe they removed all macOS versions from less than version 8--at least, in that mirror site above I don't see them.

iroddis commented 3 years ago

I'm going to merge this, and build on your comment, @dblanken . Thanks for the input. As usual, MySQL makes things difficult, and only references architecture from 8.0.26 onward, so a bit more work is required.