From 08907d09d51ae159c753f0581338be325cdd6e5d Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Mon, 18 Oct 2021 20:03:14 -0700 Subject: [PATCH] CI: nuke cross compile --- .github/workflows/build-alpine.yml | 14 +------- .github/workflows/build-linux.yml | 44 +------------------------ .github/workflows/build-linuxstatic.yml | 17 +--------- Dockerfile.alpine | 23 ++----------- Dockerfile.linuxcross | 42 ----------------------- Dockerfile.linuxllvm | 43 ------------------------ 6 files changed, 5 insertions(+), 178 deletions(-) delete mode 100644 Dockerfile.linuxcross delete mode 100644 Dockerfile.linuxllvm diff --git a/.github/workflows/build-alpine.yml b/.github/workflows/build-alpine.yml index 53e1c03..519854c 100644 --- a/.github/workflows/build-alpine.yml +++ b/.github/workflows/build-alpine.yml @@ -11,14 +11,6 @@ jobs: fail-fast: false matrix: target-node: [10, 12, 14, 16] - target-arch: [x64, arm64] - include: - - target-arch: x64 - target-triple: x86_64-linux-musl - host-arch: x86_64 - - target-arch: arm64 - target-triple: aarch64-linux-musl - host-arch: x86_64 steps: - uses: actions/checkout@v2 @@ -30,14 +22,10 @@ jobs: uses: docker/build-push-action@v2 with: build-args: | - HOST_ARCH=${{ matrix.host-arch }} - TARGET_TRIPLE=${{ matrix.target-triple }} - PKG_FETCH_OPTION_a=${{ matrix.target-arch }} PKG_FETCH_OPTION_n=node${{ matrix.target-node }} PKG_FETCH_OPTION_p=alpine context: . file: ./Dockerfile.alpine - platforms: linux/amd64 outputs: type=tar,dest=../out.tar - name: Extract binaries from Docker image @@ -52,5 +40,5 @@ jobs: - uses: actions/upload-artifact@v2 if: steps.check_file.outputs.EXISTS == 'true' with: - name: node${{ matrix.target-node }}-alpine-${{ matrix.target-arch }} + name: node${{ matrix.target-node }}-alpine-x64 path: root/pkg-fetch/dist/* diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 81bf161..836be40 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: jobs: - linux-x64: + linux: runs-on: ubuntu-20.04 strategy: @@ -25,7 +25,6 @@ jobs: PKG_FETCH_OPTION_n=node${{ matrix.target-node }} context: . file: ./Dockerfile.linux - platforms: linux/amd64 outputs: type=tar,dest=../out.tar - name: Extract binaries from Docker image @@ -42,44 +41,3 @@ jobs: with: name: node${{ matrix.target-node }}-linux-x64 path: root/pkg-fetch/dist/* - - linux-arm64: - runs-on: ubuntu-20.04 - - strategy: - fail-fast: false - matrix: - target-node: [10, 12, 14, 16] - - steps: - - uses: actions/checkout@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - - name: Build - uses: docker/build-push-action@v2 - with: - build-args: | - TARGET_TOOLCHAIN_ARCH=aarch64 - PKG_FETCH_OPTION_a=arm64 - PKG_FETCH_OPTION_n=node${{ matrix.target-node }} - context: . - file: ./Dockerfile.linuxcross - platforms: linux/amd64 - outputs: type=tar,dest=../out.tar - - - name: Extract binaries from Docker image - run: | - tar xvf ../out.tar root/pkg-fetch/dist - - - name: Check if binary is compiled - id: check_file - run: | - (test -f root/pkg-fetch/dist/*.sha256sum && echo ::set-output name=EXISTS::true) || echo ::set-output name=EXISTS::false - - - uses: actions/upload-artifact@v2 - if: steps.check_file.outputs.EXISTS == 'true' - with: - name: node${{ matrix.target-node }}-linux-arm64 - path: root/pkg-fetch/dist/* diff --git a/.github/workflows/build-linuxstatic.yml b/.github/workflows/build-linuxstatic.yml index 129a9f2..277dbe3 100644 --- a/.github/workflows/build-linuxstatic.yml +++ b/.github/workflows/build-linuxstatic.yml @@ -11,17 +11,6 @@ jobs: fail-fast: false matrix: target-node: [10, 12, 14, 16] - target-arch: [x64, arm64, armv7] - include: - - target-arch: x64 - target-triple: x86_64-linux-musl - host-arch: x86_64 - - target-arch: arm64 - target-triple: aarch64-linux-musl - host-arch: x86_64 - - target-arch: armv7 - target-triple: armv7l-linux-musleabihf - host-arch: i686 steps: - uses: actions/checkout@v2 @@ -33,14 +22,10 @@ jobs: uses: docker/build-push-action@v2 with: build-args: | - HOST_ARCH=${{ matrix.host-arch }} - TARGET_TRIPLE=${{ matrix.target-triple }} - PKG_FETCH_OPTION_a=${{ matrix.target-arch }} PKG_FETCH_OPTION_n=node${{ matrix.target-node }} PKG_FETCH_OPTION_p=linuxstatic context: . file: ./Dockerfile.alpine - platforms: linux/amd64 outputs: type=tar,dest=../out.tar - name: Extract binaries from Docker image @@ -55,5 +40,5 @@ jobs: - uses: actions/upload-artifact@v2 if: steps.check_file.outputs.EXISTS == 'true' with: - name: node${{ matrix.target-node }}-linuxstatic-${{ matrix.target-arch }} + name: node${{ matrix.target-node }}-linuxstatic-x64 path: root/pkg-fetch/dist/* diff --git a/Dockerfile.alpine b/Dockerfile.alpine index 3002191..7836c86 100644 --- a/Dockerfile.alpine +++ b/Dockerfile.alpine @@ -1,9 +1,5 @@ -ARG HOST_ARCH=x86_64 -ARG TARGET_TRIPLE=aarch64-linux-musl +FROM alpine -FROM muslcc/$HOST_ARCH:$TARGET_TRIPLE - -ARG PKG_FETCH_OPTION_a ARG PKG_FETCH_OPTION_n ARG PKG_FETCH_OPTION_p @@ -15,25 +11,10 @@ RUN apk add --no-cache build-base git linux-headers npm python2 python3 yarn # https://gitlab.alpinelinux.org/alpine/aports/-/issues/8626 ENV CFLAGS=-U_FORTIFY_SOURCE -ENV CFLAGS_host=-U_FORTIFY_SOURCE ENV CXXFLAGS=-U_FORTIFY_SOURCE -ENV CXXFLAGS_host=-U_FORTIFY_SOURCE - -ENV CC=/bin/gcc -ENV CXX=/bin/g++ -ENV AR=/bin/ar -ENV NM=/bin/nm -ENV READELF=/bin/readelf -ENV STRIP=/bin/strip - -ENV CC_host=/usr/bin/gcc -ENV CXX_host=/usr/bin/g++ -ENV AR_host=/usr/bin/ar -ENV NM_host=/usr/bin/nm -ENV READELF_host=/usr/bin/readelf COPY . ./ RUN yarn install -RUN yarn start --arch $PKG_FETCH_OPTION_a --node-range $PKG_FETCH_OPTION_n --platform $PKG_FETCH_OPTION_p --output dist +RUN yarn start --node-range $PKG_FETCH_OPTION_n --platform $PKG_FETCH_OPTION_p --output dist diff --git a/Dockerfile.linuxcross b/Dockerfile.linuxcross deleted file mode 100644 index 5eae7f1..0000000 --- a/Dockerfile.linuxcross +++ /dev/null @@ -1,42 +0,0 @@ -FROM ubuntu:bionic - -USER root:root -WORKDIR /root/pkg-fetch/ -ENV DEBIAN_FRONTEND=noninteractive - -RUN apt-get update -RUN apt-get install -y curl software-properties-common -RUN curl -fsSL https://deb.nodesource.com/setup_14.x | bash - -RUN apt-get install -y nodejs - -RUN apt-get install -y binutils g++-8 git make patch python python3 python3-distutils - -ARG TARGET_TOOLCHAIN_ARCH - -RUN [ `uname -m` = ${TARGET_TOOLCHAIN_ARCH} ] || \ - apt-get install -y binutils-${TARGET_TOOLCHAIN_ARCH}-linux-gnu g++-8-${TARGET_TOOLCHAIN_ARCH}-linux-gnu - -ENV CC=${TARGET_TOOLCHAIN_ARCH}-linux-gnu-gcc-8 -ENV CXX=${TARGET_TOOLCHAIN_ARCH}-linux-gnu-g++-8 -ENV AR=${TARGET_TOOLCHAIN_ARCH}-linux-gnu-ar -ENV NM=${TARGET_TOOLCHAIN_ARCH}-linux-gnu-nm -ENV RANLIB=${TARGET_TOOLCHAIN_ARCH}-linux-gnu-ranlib -ENV READELF=${TARGET_TOOLCHAIN_ARCH}-linux-gnu-readelf -ENV STRIP=${TARGET_TOOLCHAIN_ARCH}-linux-gnu-strip -ENV CC_host=gcc-8 -ENV CXX_host=g++-8 -ENV AR_host=ar -ENV NM_host=nm -ENV RANLIB_host=ranlib -ENV READELF_host=readelf - -RUN npm install -g yarn - -COPY . ./ - -RUN yarn install - -ARG PKG_FETCH_OPTION_a -ARG PKG_FETCH_OPTION_n - -RUN yarn start --arch $PKG_FETCH_OPTION_a --node-range $PKG_FETCH_OPTION_n --output dist diff --git a/Dockerfile.linuxllvm b/Dockerfile.linuxllvm deleted file mode 100644 index a35af0b..0000000 --- a/Dockerfile.linuxllvm +++ /dev/null @@ -1,43 +0,0 @@ -FROM ubuntu:bionic - -USER root:root -WORKDIR /root/pkg-fetch/ -ENV DEBIAN_FRONTEND=noninteractive - -RUN apt-get update -RUN apt-get install -y curl software-properties-common -RUN curl -fsSL https://deb.nodesource.com/setup_14.x | bash - -RUN apt-get install -y nodejs - -RUN apt-get install -y binutils g++ git make patch python python3 python3-distutils - -RUN echo "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic main" >> /etc/apt/sources.list -RUN curl https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - -RUN apt-get update -RUN apt-get install -y clang lld llvm - -ARG TARGET_TOOLCHAIN_ARCH - -RUN [ `uname -m` = ${TARGET_TOOLCHAIN_ARCH} ] || \ - apt-get install -y g++-${TARGET_TOOLCHAIN_ARCH}-linux-gnu - -ENV CC="clang --target=${TARGET_TOOLCHAIN_ARCH}-unknown-linux-gnu -fuse-ld=lld" -ENV CXX="clang++ --target=${TARGET_TOOLCHAIN_ARCH}-unknown-linux-gnu -fuse-ld=lld" -ENV AR=llvm-ar -ENV NM=llvm-nm -ENV RANLIB=llvm-ranlib -ENV READELF=llvm-readelf -ENV STRIP=llvm-strip -ENV CC_host=clang -ENV CXX_host=clang++ - -RUN npm install -g yarn - -COPY . ./ - -RUN yarn install - -ARG PKG_FETCH_OPTION_a -ARG PKG_FETCH_OPTION_n - -RUN yarn start --arch $PKG_FETCH_OPTION_a --node-range $PKG_FETCH_OPTION_n --output dist