From 4fcb5a3c99d2df57afe815801f0e7e80003f0ea2 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Tue, 20 Nov 2018 18:21:49 -0500 Subject: [PATCH] Some futzing with the `static-musl` branch - Don't bother with the Docker shell scripts, which were one-liners - docker/x86_musl => dist/docker/x86-alpine-linux-musl - The rename of AES_cbc_encrypt is now permanently applied - Run the test suite inside the static container - Add copyright/license headers - Move the pkg-config-rs patching script to the specific Docker directory - Add Cargo.toml note about tracking the correct version of pkg-config.rs --- .travis.yml | 6 +++--- Cargo.toml | 2 +- build-docker-image.sh | 5 ----- .../docker/x86_64-alpine-linux-musl}/Dockerfile | 14 +++++++------- .../x86_64-alpine-linux-musl}/pkg-config-rs.sh | 2 ++ run-docker-image.sh | 5 ----- 6 files changed, 13 insertions(+), 21 deletions(-) delete mode 100755 build-docker-image.sh rename {docker/x86_64-musl => dist/docker/x86_64-alpine-linux-musl}/Dockerfile (71%) rename {docker => dist/docker/x86_64-alpine-linux-musl}/pkg-config-rs.sh (89%) delete mode 100755 run-docker-image.sh diff --git a/.travis.yml b/.travis.yml index a2f406ebf..c15e351c8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,7 +29,7 @@ matrix: sudo: required dist: xenial rust: nightly - env: IMAGE=x86_64-musl + env: IMAGE=x86_64-alpine-linux-musl allow_failures: - rust: nightly @@ -90,8 +90,8 @@ script: cargo build --verbose && cargo test else - ./build-docker-image.sh $IMAGE && - ./run-docker-image.sh $IMAGE + docker build -t ttci-$IMAGE dist/docker/$IMAGE/ && + docker run -v $(pwd):/tectonic ttci-$IMAGE fi after_success: | diff --git a/Cargo.toml b/Cargo.toml index bb4b72f7e..c49b88fdd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,7 +33,7 @@ crate-type = ["rlib"] [build-dependencies] cc = "^1.0" -pkg-config = "^0.3" +pkg-config = "^0.3" # note: sync dist/docker/*/pkg-config-rs.sh with the version in Cargo.lock regex = "^1.0" sha2 = "^0.8" diff --git a/build-docker-image.sh b/build-docker-image.sh deleted file mode 100755 index 1e4b44354..000000000 --- a/build-docker-image.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -image=$1 - -docker build -t $image docker/ -f docker/$image/Dockerfile diff --git a/docker/x86_64-musl/Dockerfile b/dist/docker/x86_64-alpine-linux-musl/Dockerfile similarity index 71% rename from docker/x86_64-musl/Dockerfile rename to dist/docker/x86_64-alpine-linux-musl/Dockerfile index 62fd83382..038920cc3 100644 --- a/docker/x86_64-musl/Dockerfile +++ b/dist/docker/x86_64-alpine-linux-musl/Dockerfile @@ -1,3 +1,6 @@ +# Copyright 2018 The Tectonic Project +# Licensed under the MIT License. + FROM alpine:edge RUN apk update && \ @@ -31,12 +34,9 @@ ENV OPENSSL_DIR=/usr ENV CXXSTDLIB="" ENV RUSTFLAGS="-L /usr/lib -l static=stdc++ -C target-feature=+crt-static" -# use a patched pkg-config-rs to allow static linking with system libraries -# rename AES_cbc_encrypt to avoid name conflict with openssl +# Use a patched pkg-config-rs to allow static linking with system libraries. +# The --no-default-features flag removes serde-derive as a dep, which doesn't +# work when linking statically (rust-lang#40147). CMD cd /tectonic && \ echo -e "[patch.crates-io]\npkg-config = { path = \"/pkg-config-rs\" }" >> Cargo.toml && \ - sed -i -e 's/AES_cbc_encrypt/AES_cbc_encrypt2/g' \ - ./tectonic/dpx-dpxcrypt.h \ - ./tectonic/dpx-pdfencrypt.c \ - ./tectonic/dpx-dpxcrypt.c && \ - cargo build --release + cargo test --release --no-default-features diff --git a/docker/pkg-config-rs.sh b/dist/docker/x86_64-alpine-linux-musl/pkg-config-rs.sh similarity index 89% rename from docker/pkg-config-rs.sh rename to dist/docker/x86_64-alpine-linux-musl/pkg-config-rs.sh index a0bdd37a9..6edf7b458 100755 --- a/docker/pkg-config-rs.sh +++ b/dist/docker/x86_64-alpine-linux-musl/pkg-config-rs.sh @@ -1,4 +1,6 @@ #!/bin/sh +# Copyright 2018 The Tectonic Project +# Licensed under the MIT License. set -ex diff --git a/run-docker-image.sh b/run-docker-image.sh deleted file mode 100755 index fffea3e1b..000000000 --- a/run-docker-image.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -image=$1 - -docker run -v $(pwd):/tectonic $image