plentico / osxcross-target

Provides darwin (Mac) binary support on Linux when cross-compiling Go apps that have CGO dependencies

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

For target x86_64-apple-darwin20.4 I got error while loading shared libraries: libtinfo.so.6

tiero opened this issue · comments

I always used this osxcross target till now without any problem. Without any change to my cgo dependencies, I am failing to cross compile.

My goreleaser step fails with

/home/runner/work/osxcross/target/bin/x86_64-apple-darwin20.4-ld: error while loading shared libraries: libtinfo.so.6: cannot open shared object file: No such file or directory
clang: error: unable to execute command: No such file or directory
clang: error: linker command failed due to signal (use -v to see invocation)

Your GitHub Action is locked to ubuntu-18.04 here. I just updated this project on 4/6/21 to work with Ubuntu 20.04 and upgraded the SDK from MacOSX10.15 to MacOSX11.3, which is why your shared libraries are out of sync.

You have two options:

  1. Keep running things on Ubuntu 18.04 and download an older version of this project. You could do this by checking out an older commit after downloading the project:
- name: OSXCross for CGO Support
  run: |
    mkdir ../../osxcross
    git clone https://github.com/plentico/osxcross-target.git ../../osxcross/target
    cd ../../osxcross/target
    git checkout 73d4cf13c477d0dc6c7e684664d3342d57b946e8
  1. Update your runs-on environment here from ubuntu-18.04 to ubuntu-20.04. Just note that you'll likely have to add another step to avoid "libcrypto (OpenSSL)" errors:
-
  name: Downgrade libssl
  run: |
    echo 'deb http://security.ubuntu.com/ubuntu bionic-security main' | sudo tee -a /etc/apt/sources.list
    sudo apt update && apt-cache policy libssl1.0-dev
    sudo apt-get install libssl1.0-dev

Can you let me know if one of these works for you? Thanks!

WOW, option 2 works flawless (yes I locked ubuntu-18.04 in the past, I guess for the libcrypto errors)

Thank you so much!