Skip to content

Commit

Permalink
Some futzing with the static-musl branch
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
pkgw committed Nov 20, 2018
1 parent 69b85c0 commit 4fcb5a3
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 21 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
5 changes: 0 additions & 5 deletions build-docker-image.sh

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2018 The Tectonic Project
# Licensed under the MIT License.

FROM alpine:edge

RUN apk update && \
Expand Down Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/sh
# Copyright 2018 The Tectonic Project
# Licensed under the MIT License.

set -ex

Expand Down
5 changes: 0 additions & 5 deletions run-docker-image.sh

This file was deleted.

0 comments on commit 4fcb5a3

Please sign in to comment.