diff --git a/.github/workflows/insider-linux.yml b/.github/workflows/insider-linux.yml index 5c61d6c..1b86675 100644 --- a/.github/workflows/insider-linux.yml +++ b/.github/workflows/insider-linux.yml @@ -74,7 +74,7 @@ jobs: compile: needs: - check - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 env: MS_COMMIT: ${{ needs.check.outputs.MS_COMMIT }} MS_TAG: ${{ needs.check.outputs.MS_TAG }} @@ -221,6 +221,9 @@ jobs: run: sudo apt-get update -y && sudo apt-get install -y libkrb5-dev if: env.DISABLED != 'yes' && env.SHOULD_BUILD == 'yes' + - uses: actions-rust-lang/setup-rust-toolchain@v1 + if: env.DISABLED != 'yes' && env.SHOULD_BUILD == 'yes' + - name: Download vscode artifact uses: actions/download-artifact@v4 with: @@ -268,7 +271,7 @@ jobs: needs: - check - compile - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: @@ -383,7 +386,7 @@ jobs: needs: - check - compile - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: diff --git a/.github/workflows/insider-windows.yml b/.github/workflows/insider-windows.yml index ccd68d3..83c0308 100644 --- a/.github/workflows/insider-windows.yml +++ b/.github/workflows/insider-windows.yml @@ -72,7 +72,7 @@ jobs: compile: needs: - check - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 env: MS_COMMIT: ${{ needs.check.outputs.MS_COMMIT }} MS_TAG: ${{ needs.check.outputs.MS_TAG }} diff --git a/.github/workflows/stable-linux.yml b/.github/workflows/stable-linux.yml index ca2d533..f16d5b1 100644 --- a/.github/workflows/stable-linux.yml +++ b/.github/workflows/stable-linux.yml @@ -73,7 +73,7 @@ jobs: compile: needs: - check - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 env: MS_COMMIT: ${{ needs.check.outputs.MS_COMMIT }} MS_TAG: ${{ needs.check.outputs.MS_TAG }} @@ -222,6 +222,9 @@ jobs: run: sudo apt-get update -y && sudo apt-get install -y libkrb5-dev if: env.DISABLED != 'yes' && env.SHOULD_BUILD == 'yes' + - uses: actions-rust-lang/setup-rust-toolchain@v1 + if: env.DISABLED != 'yes' && env.SHOULD_BUILD == 'yes' + - name: Download vscode artifact uses: actions/download-artifact@v4 with: @@ -269,7 +272,7 @@ jobs: needs: - check - compile - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: @@ -384,7 +387,7 @@ jobs: needs: - check - compile - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: diff --git a/.github/workflows/stable-windows.yml b/.github/workflows/stable-windows.yml index f1a676c..d6ab4b5 100644 --- a/.github/workflows/stable-windows.yml +++ b/.github/workflows/stable-windows.yml @@ -71,7 +71,7 @@ jobs: compile: needs: - check - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 env: MS_COMMIT: ${{ needs.check.outputs.MS_COMMIT }} MS_TAG: ${{ needs.check.outputs.MS_TAG }} diff --git a/build/linux/package_bin.sh b/build/linux/package_bin.sh index 9752ee7..0224fa1 100755 --- a/build/linux/package_bin.sh +++ b/build/linux/package_bin.sh @@ -136,4 +136,6 @@ fi find "../VSCode-linux-${VSCODE_ARCH}" -print0 | xargs -0 touch -c +. ../build_cli.sh + cd .. diff --git a/build/windows/package.sh b/build/windows/package.sh index 9c3794e..83f927d 100755 --- a/build/windows/package.sh +++ b/build/windows/package.sh @@ -26,6 +26,8 @@ node build/azure-pipelines/distro/mixin-npm npm run gulp "vscode-win32-${VSCODE_ARCH}-min-ci" +. ../build_cli.sh + if [[ "${VSCODE_ARCH}" == "x64" ]]; then if [[ "${SHOULD_BUILD_REH}" != "no" ]]; then echo "Building REH" diff --git a/build_cli.sh b/build_cli.sh index 82c2897..efdf3d0 100755 --- a/build_cli.sh +++ b/build_cli.sh @@ -11,6 +11,10 @@ export VSCODE_CLI_BINARY_NAME="$( node -p "require(\"../product.json\").serverAp TUNNEL_APPLICATION_NAME="$( node -p "require(\"../product.json\").tunnelApplicationName" )" NAME_SHORT="$( node -p "require(\"../product.json\").nameShort" )" +npm pack @vscode/openssl-prebuilt@0.0.11 +mkdir openssl +tar -xvzf vscode-openssl-prebuilt-0.0.11.tgz --strip-components=1 --directory=openssl + if [[ "${OS_NAME}" == "osx" ]]; then if [[ "${VSCODE_ARCH}" == "arm64" ]]; then VSCODE_CLI_TARGET="aarch64-apple-darwin" @@ -18,6 +22,9 @@ if [[ "${OS_NAME}" == "osx" ]]; then VSCODE_CLI_TARGET="x86_64-apple-darwin" fi + export OPENSSL_LIB_DIR="$( pwd )/openssl/out/${VSCODE_ARCH}-osx/lib" + export OPENSSL_INCLUDE_DIR="$( pwd )/openssl/out/${VSCODE_ARCH}-osx/include" + cargo build --release --target "${VSCODE_CLI_TARGET}" --bin=code cp "target/${VSCODE_CLI_TARGET}/release/code" "../../VSCode-darwin-${VSCODE_ARCH}/${NAME_SHORT}.app/Contents/Resources/app/bin/${TUNNEL_APPLICATION_NAME}" @@ -29,29 +36,48 @@ elif [[ "${OS_NAME}" == "windows" ]]; then VSCODE_CLI_TARGET="x86_64-pc-windows-msvc" export VSCODE_CLI_RUSTFLAGS="-Ctarget-feature=+crt-static -Clink-args=/guard:cf -Clink-args=/CETCOMPAT" fi - export VSCODE_CLI_CFLAGS="/guard:cf /Qspectre" - rustup target add x86_64-pc-windows-msvc + export VSCODE_CLI_CFLAGS="/guard:cf /Qspectre" + export OPENSSL_LIB_DIR="$( pwd )/openssl/out/${VSCODE_ARCH}-windows-static/lib" + export OPENSSL_INCLUDE_DIR="$( pwd )/openssl/out/${VSCODE_ARCH}-windows-static/include" + + rustup target add "${VSCODE_CLI_TARGET}" cargo build --release --target "${VSCODE_CLI_TARGET}" --bin=code cp "target/${VSCODE_CLI_TARGET}/release/code.exe" "../../VSCode-win32-${VSCODE_ARCH}/bin/${TUNNEL_APPLICATION_NAME}.exe" else + export OPENSSL_LIB_DIR="$( pwd )/openssl/out/${VSCODE_ARCH}-linux/lib" + export OPENSSL_INCLUDE_DIR="$( pwd )/openssl/out/${VSCODE_ARCH}-linux/include" + export VSCODE_SYSROOT_DIR="../.build/sysroots" + if [[ "${VSCODE_ARCH}" == "arm64" ]]; then VSCODE_CLI_TARGET="aarch64-unknown-linux-gnu" + + export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc + export CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc + export CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++ + export PKG_CONFIG_ALLOW_CROSS=1 + + sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu crossbuild-essential-arm64 elif [[ "${VSCODE_ARCH}" == "armhf" ]]; then VSCODE_CLI_TARGET="armv7-unknown-linux-gnueabihf" + + export OPENSSL_LIB_DIR="$( pwd )/openssl/out/arm-linux/lib" + export OPENSSL_INCLUDE_DIR="$( pwd )/openssl/out/arm-linux/include" + export CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc + export CC_armv7_unknown_linux_gnueabihf=arm-linux-gnueabihf-gcc + export CXX_armv7_unknown_linux_gnueabihf=arm-linux-gnueabihf-g++ + export PKG_CONFIG_ALLOW_CROSS=1 + + sudo apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf crossbuild-essential-armhf elif [[ "${VSCODE_ARCH}" == "x64" ]]; then VSCODE_CLI_TARGET="x86_64-unknown-linux-gnu" - elif [[ "${VSCODE_ARCH}" == "ppc64le" ]]; then - VSCODE_CLI_TARGET="powerpc64-unknown-linux-gnu" - elif [[ "${VSCODE_ARCH}" == "riscv64" ]]; then - VSCODE_CLI_TARGET="riscv64-unknown-linux-gnu" - elif [[ "${VSCODE_ARCH}" == "loong64" ]]; then - VSCODE_CLI_TARGET="loongarch64-unknown-linux-gnu" fi if [[ -n "${VSCODE_CLI_TARGET}" ]]; then + rustup target add "${VSCODE_CLI_TARGET}" + cargo build --release --target "${VSCODE_CLI_TARGET}" --bin=code cp "target/${VSCODE_CLI_TARGET}/release/code" "../../VSCode-linux-${VSCODE_ARCH}/bin/${TUNNEL_APPLICATION_NAME}"