Skip to content

Instantly share code, notes, and snippets.

@hbina
Created March 6, 2021 01:14
Show Gist options
  • Select an option

  • Save hbina/d4746c03a1ecb41a1dc3ab13da6748ac to your computer and use it in GitHub Desktop.

Select an option

Save hbina/d4746c03a1ecb41a1dc3ab13da6748ac to your computer and use it in GitHub Desktop.
# Docker configurations
image: ubuntu:latest
test:
except:
- tags
script:
# Configure TZ
- export TZ=Europe/Kiev
- ln -snf /usr/share/zoneinfo/$TZ /etc/localtime
- echo $TZ > /etc/timezone
# Prepare dependencies
- apt-get update -y
- apt-get install -y --no-install-recommends gcc-mingw-w64-x86-64 curl pkg-config clang cmake git ca-certificates gcc make
# Install OpenSSL
- git clone https://github.com/openssl/openssl.git --branch OpenSSL_1_0_2-stable --single-branch openssl_source
- cd openssl_source
- OPENSSL_DIR=`pwd`
- ./config --prefix="$OPENSSL_DIR/_install" -no-shared
- make && make install
- export OPENSSL_STATIC=true
- export OPENSSL_DIR="$OPENSSL_DIR/_install"
- cd ..
# Install Rust
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --verbose --profile minimal
- source $HOME/.cargo/env
- cargo --version
# Just to be sure
- cargo check
- cargo test --all
build_release:
only:
- tags
- "v*.*.*"
artifacts:
expire_in: 1 week
name: "$CI_PROJECT_NAME-$CI_COMMIT_TAG-tmp"
paths:
- dist/lupinas-lullaby-linux.tar.gz
- dist/lupinas-lullaby-macos.tar.gz
- dist/lupinas-lullaby-win64.tar.gz
script:
# Configure TZ
- export DEBIAN_FRONTEND=noninteractive
- export TZ=Europe/Kiev
- ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Prepare dependencies
- apt-get update -y
- apt-get install -y --no-install-recommends gcc-mingw-w64-x86-64 curl pkg-config clang cmake git ca-certificates gcc make wget
# Install OpenSSL
- git clone https://github.com/openssl/openssl.git --branch OpenSSL_1_0_2-stable --single-branch openssl_source
- cd openssl_source
- OPENSSL_DIR=`pwd`
- ./config --prefix="$OPENSSL_DIR/_install" -no-shared
- make && make install
- export OPENSSL_STATIC=true
- export OPENSSL_DIR="$OPENSSL_DIR/_install"
- cd ..
# Install Rust
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --verbose --profile minimal
- source $HOME/.cargo/env
- rustup target add x86_64-pc-windows-gnu
- rustup target add x86_64-unknown-linux-gnu
- rustup target add x86_64-apple-darwin
- cargo --version
# Just to be sure
- cargo check
- cargo test --all
# Install dependencies for MacOS cross-compilation
- git clone --recursive https://github.com/tpoechtrager/osxcross
- cd osxcross
- tools/get_dependencies.sh
- wget -nc https://s3.dockerproject.org/darwin/v2/MacOSX10.10.sdk.tar.xz
- mv MacOSX10.10.sdk.tar.xz tarballs/
- UNATTENDED=yes OSX_VERSION_MIN=10.7 ./build.sh
- cd ..
- export PATH="$(pwd)/osxcross/target/bin:$PATH"
- export LIBZ_SYS_STATIC=1
- export CC=o64-clang
- export CXX=o64-clang++
# Prepare folders
- mkdir builds
- mkdir dist
# Linux installation
- cargo rustc --bin lupinas-lullaby --release --verbose --target=x86_64-unknown-linux-gnu
- mkdir builds/lupinas-lullaby-linux
- cp target/x86_64-unknown-linux-gnu/release/lupinas-lullaby builds/lupinas-lullaby-linux/lupinas-lullaby-linux
- tar -C builds -czvf dist/lupinas-lullaby-linux.tar.gz lupinas-lullaby-linux
# Windows installation
- cargo rustc --bin lupinas-lullaby --release --verbose --target=x86_64-pc-windows-gnu -- -C linker=x86_64-w64-mingw32-gcc
- mkdir builds/lupinas-lullaby-win64
- cp target/x86_64-pc-windows-gnu/release/lupinas-lullaby.exe builds/lupinas-lullaby-win64/lupinas-lullaby-win64.exe
- tar -C builds -czvf dist/lupinas-lullaby-win64.tar.gz lupinas-lullaby-win64
# MacOS installion
- cargo build --bin lupinas-lullaby --release --verbose --target x86_64-apple-darwin
- mkdir builds/lupinas-lullaby-macos
- cp target/x86_64-apple-darwin/release/lupinas-lullaby builds/lupinas-lullaby-macos/lupinas-lullaby-macos
- tar -C builds -czvf dist/lupinas-lullaby-macos.tar.gz lupinas-lullaby-macos
< ----- snip ------------->
Compiling lupinas-lullaby v0.3.1 (/builds/project-0)
Running `rustc --crate-name openapi --edition=2018 src/openapi/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C linker-plugin-lto -C metadata=3fc09eda27b5855f -C extra-filename=-3fc09eda27b5855f --out-dir /builds/project-0/target/x86_64-apple-darwin/release/deps --target x86_64-apple-darwin -C linker=x86_64-apple-darwin14-clang -L dependency=/builds/project-0/target/x86_64-apple-darwin/release/deps -L dependency=/builds/project-0/target/release/deps --extern clap=/builds/project-0/target/x86_64-apple-darwin/release/deps/libclap-dfa7ee4d5c781676.rmeta --extern reqwest=/builds/project-0/target/x86_64-apple-darwin/release/deps/libreqwest-68061a8d84e61abc.rmeta --extern serde=/builds/project-0/target/x86_64-apple-darwin/release/deps/libserde-50a30cd900126cad.rmeta --extern serde_json=/builds/project-0/target/x86_64-apple-darwin/release/deps/libserde_json-79d1234ddf2da739.rmeta --extern serde_yaml=/builds/project-0/target/x86_64-apple-darwin/release/deps/libserde_yaml-d710f569916a15ed.rmeta`
Running `rustc --crate-name lupinas_lullaby --edition=2018 src/bin/lupinas-lullaby.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C opt-level=3 -C lto -C metadata=b0368c6058fe20e7 --out-dir /builds/project-0/target/x86_64-apple-darwin/release/deps --target x86_64-apple-darwin -C linker=x86_64-apple-darwin14-clang -L dependency=/builds/project-0/target/x86_64-apple-darwin/release/deps -L dependency=/builds/project-0/target/release/deps --extern clap=/builds/project-0/target/x86_64-apple-darwin/release/deps/libclap-dfa7ee4d5c781676.rlib --extern openapi=/builds/project-0/target/x86_64-apple-darwin/release/deps/libopenapi-3fc09eda27b5855f.rlib --extern reqwest=/builds/project-0/target/x86_64-apple-darwin/release/deps/libreqwest-68061a8d84e61abc.rlib --extern serde=/builds/project-0/target/x86_64-apple-darwin/release/deps/libserde-50a30cd900126cad.rlib --extern serde_json=/builds/project-0/target/x86_64-apple-darwin/release/deps/libserde_json-79d1234ddf2da739.rlib --extern serde_yaml=/builds/project-0/target/x86_64-apple-darwin/release/deps/libserde_yaml-d710f569916a15ed.rlib`
error: linking with `x86_64-apple-darwin14-clang` failed: exit code: 1
|
= note: "x86_64-apple-darwin14-clang" "-m64" "-arch" "x86_64" "-L" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib" "/builds/project-0/target/x86_64-apple-darwin/release/deps/lupinas_lullaby.lupinas_lullaby.bn7njmnh-cgu.2.rcgu.o" "-o" "/builds/project-0/target/x86_64-apple-darwin/release/deps/lupinas_lullaby" "-Wl,-dead_strip" "-nodefaultlibs" "-L" "/builds/project-0/target/x86_64-apple-darwin/release/deps" "-L" "/builds/project-0/target/release/deps" "-L" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-57851e98e05f8123.rlib" "-framework" "Security" "-framework" "CoreFoundation" "-liconv" "-lSystem" "-lresolv" "-lc" "-lm"
= note: Undefined symbols for architecture x86_64:
"_SecTrustEvaluateWithError", referenced from:
security_framework::secure_transport::MidHandshakeClientBuilder$LT$S$GT$::handshake::h1e72be237be33dcd in lupinas_lullaby.lupinas_lullaby.bn7njmnh-cgu.2.rcgu.o
security_framework::secure_transport::MidHandshakeClientBuilder$LT$S$GT$::handshake::h9af4b917b181f81a in lupinas_lullaby.lupinas_lullaby.bn7njmnh-cgu.2.rcgu.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: aborting due to previous error
error: could not compile `lupinas-lullaby`
Caused by:
process didn't exit successfully: `rustc --crate-name lupinas_lullaby --edition=2018 src/bin/lupinas-lullaby.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C opt-level=3 -C lto -C metadata=b0368c6058fe20e7 --out-dir /builds/project-0/target/x86_64-apple-darwin/release/deps --target x86_64-apple-darwin -C linker=x86_64-apple-darwin14-clang -L dependency=/builds/project-0/target/x86_64-apple-darwin/release/deps -L dependency=/builds/project-0/target/release/deps --extern clap=/builds/project-0/target/x86_64-apple-darwin/release/deps/libclap-dfa7ee4d5c781676.rlib --extern openapi=/builds/project-0/target/x86_64-apple-darwin/release/deps/libopenapi-3fc09eda27b5855f.rlib --extern reqwest=/builds/project-0/target/x86_64-apple-darwin/release/deps/libreqwest-68061a8d84e61abc.rlib --extern serde=/builds/project-0/target/x86_64-apple-darwin/release/deps/libserde-50a30cd900126cad.rlib --extern serde_json=/builds/project-0/target/x86_64-apple-darwin/release/deps/libserde_json-79d1234ddf2da739.rlib --extern serde_yaml=/builds/project-0/target/x86_64-apple-darwin/release/deps/libserde_yaml-d710f569916a15ed.rlib` (exit code: 1)
ERROR: Failed to cleanup volumes
ERROR: Job failed: exit code 1
FATAL: exit code 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment