Skip to content

Commit 5099d14

Browse files
authored
chore: add support for x86_64-unknown-linux-musl releases (#654)
Signed-off-by: Ben Johnson <[email protected]>
1 parent 4e1e9e2 commit 5099d14

File tree

10 files changed

+51
-41
lines changed

10 files changed

+51
-41
lines changed

.circleci/config.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,23 @@ jobs:
141141
- "*-x86_64-unknown-linux-gnu.tar.gz"
142142
- "*-amd64.deb"
143143

144+
build-x86_64-unknown-linux-musl-archive:
145+
docker:
146+
- image: timberiodev/vector-builder-x86_64-unknown-linux-musl:latest
147+
resource_class: xlarge
148+
steps:
149+
- checkout
150+
- run:
151+
name: Build archive
152+
command: |
153+
export VERSION=$(make version)
154+
make build-archive FEATURES="jemallocator"
155+
- persist_to_workspace:
156+
root: target/artifacts
157+
paths:
158+
- "*-x86_64-unknown-linux-musl.tar.gz"
159+
- "*-amd64.deb"
160+
144161
#
145162
# Packaging
146163
#
@@ -414,6 +431,7 @@ build-requires: &build-requires
414431
package-requires: &package-requires
415432
requires:
416433
- build-x86_64-unknown-linux-gnu-archive
434+
- build-x86_64-unknown-linux-musl-archive
417435
- build-x86_64-apple-darwin-archive
418436

419437
verify-requires: &verify-requires
@@ -452,6 +470,9 @@ workflows:
452470
- build-x86_64-unknown-linux-gnu-archive:
453471
<<: *release-workflow-filters
454472
<<: *build-requires
473+
- build-x86_64-unknown-linux-musl-archive:
474+
<<: *release-workflow-filters
475+
<<: *build-requires
455476
- build-x86_64-apple-darwin-archive:
456477
<<: *release-workflow-filters
457478
<<: *build-requires

.metadata.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,10 +1308,6 @@ toml_table = "https://github.com/toml-lang/toml#table"
13081308
uuidv4 = "https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)"
13091309
vector_repo = "https://github.com/timberio/vector"
13101310
vector_initd_service = "https://github.com/timberio/vector/blob/master/distribution/init.d/vector"
1311-
vector_edge_x86_64-apple-darwin = "https://packages.timber.io/vector/edge/vector-edge-x86_64-apple-darwin.tar.gz"
1312-
vector_latest_x86_64-apple-darwin = "https://packages.timber.io/vector/latest/vector-latest-x86_64-apple-darwin.tar.gz"
1313-
vector_edge_x86_64-unknown-linux-gnu = "https://packages.timber.io/vector/edge/vector-edge-x86_64-unknown-linux-gnu.tar.gz"
1314-
vector_latest_x86_64-unknown-linux-gnu = "https://packages.timber.io/vector/latest/vector-latest-x86_64-unknown-linux-gnu.tar.gz"
13151311
vector_systemd_file = "https://github.com/timberio/vector/blob/master/distribution/systemd/vector.service"
13161312
vote_feature = "https://github.com/timberio/vector/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc+label%3A%22Type%3A+New+Feature%22"
13171313
vector_chat = "https://chat.vector.dev"

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ test: ## Spins up Docker resources and runs _every_ test
5252

5353
##@ Releasing
5454

55+
build-archive: FEATURES = "default"
5556
build-archive: ## Build a Vector archive for a given $TARGET and $VERSION
56-
@scripts/build-archive.sh
57+
@FEATURES=$(FEATURES) scripts/build-archive.sh
5758

5859
build-ci-docker-images: ## Build the various Docker images used for CI
5960
@scripts/build-ci-docker-images.sh

docs/setup/installation/manual/from-archives.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ architectures. If you don't see an architecture, then we recommend
2424
| :------------| :-----: | :---- |
2525
| [`x86_64-apple-darwin`][url.vector_latest_x86_64-apple-darwin] | `latest` | 64-bit OSX (10.7+, Lion+) |
2626
| [`uknown-linux-gnu`][url.vector_latest_x86_64-unknown-linux-gnu] | `latest` | 64-bit Linux (2.6.18+) |
27+
| [`uknown-linux-musl`][url.vector_latest_x86_64-unknown-linux-musl] | `latest` | 64-bit Linux with MUSL |
2728

2829
{% endtab %}
2930
{% tab title="Edge" %}
@@ -37,7 +38,8 @@ using them over the "latest" alternatives.
3738
| Architecture | Channel | Notes |
3839
| :------------| :-----: | :---- |
3940
| [`x86_64-apple-darwin`][url.vector_edge_x86_64-apple-darwin] | `edge` | 64-bit OSX (10.7+, Lion+) |
40-
| [`uknown-linux-gnu`][url.vector_edge_x86_64-unknown-linux-gnu] | `latest` | 64-bit Linux (2.6.18+) |
41+
| [`uknown-linux-gnu`][url.vector_edge_x86_64-unknown-linux-gnu] | `edge` | 64-bit Linux (2.6.18+) |
42+
| [`uknown-linux-musl`][url.vector_edge_x86_64-unknown-linux-musl] | `edge` | 64-bit Linux with MUSL |
4143
{% endtab %}
4244
{% endtabs %}
4345

scripts/build-archive.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,18 @@
1313

1414
set -eu
1515

16-
echo "Building version $VERSION for target $TARGET"
16+
echo "Building -- version: $VERSION, target: $TARGET, features: $FEATURES"
1717

1818
artifacts_dir="target/artifacts"
1919
target_dir="target/$TARGET"
2020
archive_dir_name="vector-$VERSION"
2121
archive_dir="$target_dir/$archive_dir_name"
2222

23-
cargo build --target $TARGET --release
23+
if [ "$FEATURES" == "default" ]; then
24+
cargo build --target $TARGET --release
25+
else
26+
cargo build --no-default-features --features $FEATURES --target $TARGET --release
27+
fi
2428

2529
# Build the archive directory
2630
rm -rf $archive_dir

scripts/build-ci-docker-images.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ function extend_cross_base_image() {
4545
# The following images are basic Docker images that do not extend a
4646
# cross base image.
4747
build_image "builder-x86_64-unknown-linux-gnu"
48+
build_image "builder-x86_64-unknown-linux-musl"
4849
build_image "checker"
4950
build_image "packager-deb"
5051
build_image "packager-rpm"
Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,20 @@
11
FROM japaric/x86_64-unknown-linux-musl:latest
22

3-
# Install the git repository to ensure we get the latest version.
4-
# This is important for determining the current Vector version number.
53
RUN apt-get update
64
RUN apt-get install -y software-properties-common
75
RUN add-apt-repository ppa:git-core/ppa
86

9-
RUN echo "deb http://dk.archive.ubuntu.com/ubuntu/ trusty main universe
10-
deb http://dk.archive.ubuntu.com/ubuntu/ trusty-updates main universe" | > /etc/apt/sources.list.d/fury.list
11-
12-
RUN apt-get update
13-
14-
# Note: We do not call `apt-get upgrade` because we do not want Vector to
15-
# depend on newer versions of libraries. This is just an assumption,
16-
# I could be completely wrong with how this works.
17-
18-
RUN apt-get install -y --no-install-recommends \
7+
RUN apt-get update && \
8+
apt-get install -y --no-install-recommends \
199
build-essential \
2010
curl \
21-
g++-4.4 \
22-
gcc-4.4 \
2311
git \
2412
openssh-server \
2513
vim \
26-
libleveldb-dev \
27-
libsnappy-dev
28-
29-
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 50
30-
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.4 50
31-
32-
RUN update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30
33-
RUN update-alternatives --set cc /usr/bin/gcc
34-
35-
RUN update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30
36-
RUN update-alternatives --set c++ /usr/bin/g++
37-
38-
# Note: We do not compile or install leveldb or rdkafka libraries because
39-
# those Rust creates automatically build and link the libraries for
40-
# this target. Unfortunately, this is not the case for other targets,
41-
# hence the reason we only support this target currently.
14+
zlib1g-dev
4215

4316
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable
4417
ENV PATH="$PATH:/root/.cargo/bin"
18+
RUN cargo install cargo-deb
4519
ENV TARGET=x86_64-unknown-linux-musl
4620
RUN rustup target add x86_64-unknown-linux-musl

scripts/generate/metadata/links.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,11 @@ def parse(full_name)
296296
label = "#{type.titleize}: #{name}"
297297
VECTOR_ISSUES_ROOT + "/new?" + {"labels" => [label]}.to_query
298298

299+
when /^url\.vector_(edge|latest)_(.*)/
300+
channel = $1
301+
target = $2
302+
"https://packages.timber.io/vector/#{channel}/vector-#{channel}-#{target}.tar.gz"
303+
299304
when /^url\.(.*)_test$/
300305
name = $1
301306
"#{TEST_HARNESS_ROOT}/tree/master/cases/#{name}"

scripts/package-rpm.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export RELEASE=1
2121
export CLEANED_VERSION=$VERSION
2222
CLEANED_VERSION=$(echo $CLEANED_VERSION | sed 's/-/\./g')
2323

24-
# The arch is the first part of the part
24+
# The arch is the first part of the target
2525
ARCH=$(echo $TARGET | cut -d'-' -f1)
2626

2727
# Create source dir

scripts/release-s3.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ if [ -z "$CHANNEL" ]; then
2222
exit 1
2323
fi
2424

25+
escaped_version=$(echo $VERSION | sed "s/\./\\\./g")
2526

2627
#
2728
# S3
@@ -34,19 +35,24 @@ aws s3 cp "target/artifacts/" "s3://packages.timber.io/vector/$VERSION/" --recur
3435
echo "Uploading all artifacts to s3://packages.timber.io/vector/edge/"
3536
td=$(mktemp -d)
3637
cp -a "target/artifacts/." "$td"
37-
escaped_version=$(echo $VERSION | sed "s/\./\\\./g")
3838
rename -v "s/$escaped_version/edge/" "$td/*"
39+
echo "Renamed all builds: via \"s/$escaped_version/edge/\""
40+
ls $td
3941
aws s3 rm --recursive "s3://packages.timber.io/vector/edge/"
4042
aws s3 cp "$td" "s3://packages.timber.io/vector/edge/" --recursive
4143
rm -rf $td
44+
echo "Uploaded edge archives"
4245

4346
if [[ "$CHANNEL" == "latest" ]]; then
4447
# Update the "latest" files
4548
echo "Uploading all artifacts to s3://packages.timber.io/vector/latest/"
4649
td=$(mktemp -d)
4750
cp -a "target/artifacts/." "$td"
48-
rename -v "s/edge/latest/" "$td/*"
51+
rename -v "s/$escaped_version/latest/" "$td/*"
52+
echo "Renamed all builds: via \"s/$escaped_version/latest/\""
53+
ls $td
4954
aws s3 rm --recursive "s3://packages.timber.io/vector/latest/"
5055
aws s3 cp "$td" "s3://packages.timber.io/vector/latest/" --recursive
5156
rm -rf $td
57+
echo "Uploaded latest archives"
5258
fi

0 commit comments

Comments
 (0)