crystal-lang / distribution-scripts

40 stars 24 forks source link

Use LLVM 10.0.0 on darwin omnibus builds #97

Closed bcardiff closed 3 years ago

bcardiff commented 3 years ago

This PR bumps the llvm used on darwin tar.gz and .pkg build to llvm 10.0.0.

A preview of the build is available in https://app.circleci.com/pipelines/github/crystal-lang/crystal/5790/workflows/09bc4327-d5bd-4910-82c8-1143e7c7285f

The build of llvm 10.0.0 is uploaded to the s3 bucket. llvm 10.0.1 was not used to avoid failing into the libxml2.tbd issue.

As it is, it would be used in crystal 1.1.0. But it would be possible to build a 1.0.0-2 for darwin if we need to. The benefit would be to use 1.0.0-2 as part of the boot resource in homebrew formula and detect problem there earlier. Otherwise we might need to release a 1.1.0-2 later with a downgraded llvm when a 1.2.0 is released.

From #96 it seems there are more stories needed to bring omnibus up to date. But I think we can tackle those stories one by one: updating omnibus itself for arm. updating openssl. building and using llvm 11. cc: @maxfierke

Smoke testing the result of the preview build would be greatly appreciated.

bcardiff commented 3 years ago

Build ready at https://60732-6887813-gh.circle-artifacts.com/0/build/crystal-ci-update-dev-1-darwin-x86_64.tar.gz

bcardiff commented 3 years ago

The changes in the dependencies it make me doubt if I was doing things right is the addition of CoreFoundation:

% otool -L ~/Downloads/crystal-1.0.0-1/embedded/bin/crystal 
/Users/bcardiff/Downloads/crystal-1.0.0-1/embedded/bin/crystal:
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.0.0)
    /usr/lib/libxml2.2.dylib (compatibility version 10.0.0, current version 10.9.0)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 800.6.0)
    /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)

% otool -L ~/Downloads/crystal-ci-update-dev-1/embedded/bin/crystal 
/Users/bcardiff/Downloads/crystal-ci-update-dev-1/embedded/bin/crystal:
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.0.0)
    /usr/lib/libxml2.2.dylib (compatibility version 10.0.0, current version 10.9.0)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 800.6.0)
    /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1670.10.0)

In particular I don't have a BigSur installation to check if this is an issue for Crystal.

Other than that the updated compiler with llvm seems to work well for developing the compiler in darwin.

maxfierke commented 3 years ago

I'm planning on playing around with this tonight on my Big Sur install, but my expectation is that it'll not be an issue (I think the reliance on CoreFoundation is a fairly standard thing in newer Xcode to work with newer macOS features such as hardware permissions and entitlements)

If it's missing on disk in Big Sur, I would hope and expect it'll still work given the amount of software that works fine on Big Sur without re-compiling (IIRC, those dylib don't exist on disk either)

maxfierke commented 3 years ago

Looks good to me! Works fine on Big Sur (other than working around lack of code-signing/notarization). Confirmed release mode compilation works fine in a few of my programs. Compiling the compiler in release mode with the built omnibus compiler worked as well.