Skip to content

Commit

Permalink
Remove no longer used tools from Docker image and wasm-tools
Browse files Browse the repository at this point in the history
  • Loading branch information
kateinoigakukun committed Jan 17, 2024
1 parent 8da3863 commit 157dd8a
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 49 deletions.
22 changes: 0 additions & 22 deletions .github/workflows/build_swift_tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ jobs:
include:
- swift-version: 5.9.1
carton-version: 0.20.0
swift-format-version: 508.0.1
swift-lint-version: 0.52.3

steps:
- name: Checkout the repo
Expand Down Expand Up @@ -52,24 +50,6 @@ jobs:
tar xf swift-toolcahin.tar.gz
mv swift-wasm-* wasm-${{ matrix.swift-version }}-RELEASE
- name: Build Swift-format version ${{ matrix.swift-format-version }}
env:
GH_TOKEN: ${{ github.token }}
run: |
gh repo clone apple/swift-format -- --branch ${{ matrix.swift-format-version }} --single-branch
cd swift-format
swift build -c release
.build/release/swift-format --version
- name: Build SwiftLint version ${{ matrix.swift-lint-version }}
env:
GH_TOKEN: ${{ github.token }}
run: |
gh repo clone realm/SwiftLint -- --branch ${{ matrix.swift-lint-version }} --single-branch
cd SwiftLint
swift build -c release -Xswiftc -static-stdlib --product swiftlint
.build/release/swiftlint --version
- name: Create WASM build tools bundle
id: create-build
run: |
Expand All @@ -78,8 +58,6 @@ jobs:
mkdir -p $wasm_tools_dir
mv carton/.build/release/carton $wasm_tools_dir/carton
mv binaryen/bin/wasm-opt $wasm_tools_dir/wasm-opt
mv swift-format/.build/release/swift-format $wasm_tools_dir/swift-format
mv SwiftLint/.build/release/swiftlint $wasm_tools_dir/
mv wasm-${{ matrix.swift-version }}-RELEASE $wasm_tools_dir/
tar cf - $wasm_tools_dir | lz4 -12 > $wasm_tools_dir.tar.lz4
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,9 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
tags: ghcr.io/${{ env.REPOSITORY_LC }}:${{ env.DOCKER_TAG }}
build-args: |
SWIFLINT_DOCKER_IMAGE=ghcr.io/realm/swiftlint:0.52.3
CARTON_TAG=0.20.0
SWIFT_DOCKER_IMAGE=swift:5.9.0-jammy
SWIFT_TAG=wasm-5.9.1-RELEASE
SWIFT_FORMAT_TAG=508.0.1
NODE_VERSION=18.x
OPEN_JDK_VERSION=11
CYPRESS_VERSION=12.3.0
Expand Down
25 changes: 0 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
ARG SWIFLINT_DOCKER_IMAGE
ARG SWIFT_DOCKER_IMAGE

FROM $SWIFLINT_DOCKER_IMAGE as swiftLint

FROM $SWIFT_DOCKER_IMAGE as carton-builder
ARG SWIFT_TAG
ARG CARTON_TAG
Expand All @@ -14,20 +12,6 @@ RUN git clone https://github.com/swiftwasm/carton.git && \
swift build -c release && \
mv .build/release/carton /usr/bin

FROM $SWIFT_DOCKER_IMAGE as swift-format-builder

ARG SWIFT_FORMAT_TAG

# FIXME(katei): The sed hack is required to pin the swift-syntax version to `0.50700.0`.
# Without this hack, SwiftPM uses swift-syntax `0.50700.1`, which is incompatible with 5.7.0
# Docker image. Remove the hack after Apple folks will release an image compatible with swift-syntax
# `0.50700.1` (probably `swift:5.7.1`?)
RUN git clone https://github.com/apple/swift-format.git && \
cd swift-format && \
git checkout "tags/$SWIFT_FORMAT_TAG" && \
sed -i -e 's/.upToNextMinor(from: "0.50700.0")/exact: "0.50700.0"/' Package.swift && \
swift build -c release

FROM ubuntu:22.04 as binaryen

RUN apt-get update && apt-get install -y curl
Expand Down Expand Up @@ -131,19 +115,12 @@ RUN wget --no-verbose -O /tmp/firefox.tar.bz2 \
&& rm /tmp/firefox.tar.bz2 \
&& ln -fs /opt/firefox/firefox /usr/bin/firefox

# Intall swift lint from docker
COPY --from=swiftLint /usr/bin/swiftlint /usr/bin/swiftlint
COPY --from=swiftLint /usr/lib/libsourcekitdInProc.so /usr/lib/

# Install latest carton tool
COPY --from=carton-builder /usr/bin/carton /usr/bin/carton

# Install latest binaryen tools (carton still uses some legacy version)
COPY --from=binaryen binaryen-version_105/bin/* /usr/local/bin

# Install swift format
COPY --from=swift-format-builder swift-format/.build/release/swift-format /usr/local/bin/swift-format

COPY --from=symbolicator-builder wasm-split /usr/local/bin

# Print Installed Versions
Expand All @@ -153,8 +130,6 @@ RUN node --version
RUN npm --version
RUN npx --version
RUN yarn --version
RUN swiftlint --version
RUN swift-format --version
RUN cypress --version
RUN wasm-opt --version
RUN brotli --version
Expand Down

0 comments on commit 157dd8a

Please sign in to comment.