From 16a4a7ecbbd40023fd590d7202da0c01aeaca517 Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Fri, 20 Dec 2024 13:18:27 +1100 Subject: [PATCH 01/43] linux are completed --- Cross.toml | 67 +++++++++++++++++++++++++++++++ Cross.toml.bk | 80 +++++++++++++++++++++++++++++++++++++ crates/goose-cli/Cargo.toml | 5 ++- crates/goose/Cargo.toml | 7 +++- 4 files changed, 156 insertions(+), 3 deletions(-) create mode 100644 Cross.toml create mode 100644 Cross.toml.bk diff --git a/Cross.toml b/Cross.toml new file mode 100644 index 000000000..3a3fed3bb --- /dev/null +++ b/Cross.toml @@ -0,0 +1,67 @@ +# BUILD +# ----- +# Set build configurations for all targets. + +[build] +## Use xargo when cross-compiling for targets without a pre-built +## standard library. Prefer `build-std` for most targets. This +## requires nightly. +#xargo = true +## Use `-Zbuild-std` when cross-compiling for targets without a +## pre-built standard library. This overrides `xargo`: if enabled, +## `xargo` will not be used. +#build-std = true +## Default target to build if the target is not provided via +## `--target` or `CARGO_BUILD_TARGET`. +#default-target = "x86_64-unknown-linux-gnu" +## Additional commands to run prior to building the package. +## These are translated into RUN commands to add to the Docker +## image prior to running cross. +#pre-build = [ +# "dpkg --add-architecture $CROSS_DEB_ARCH", +# "apt-get update && apt-get install --assume-yes libssl-dev:$CROSS_DEB_ARCH" +#] +## A custom Dockerfile to use for all targets. This can be +## provided as a struct or string. See below for a target +## for the struct variant. Both pre-build hooks can a custom +## Dockerfile can be provided: the pre-build hooks will be added +## to the end of the Dockerfile. +#dockerfile = "Dockerfile" +# +## BUILD ENVIRONMENT +## ----------------- +## Set the build environment for all targets. +# +#[build.env] +## Volumes to be mounted, passed via the value of an environment +## variable. These will be passed to the container both as +## a mountpoint and an environment variable. For example, the +## path to `VOL2_ARG` will be available as `$VOL2_ARG`, and +## the path will be mounted at `/path/to/volume`. +## A value for the environment variable containing the +## path to the volume can provided. +#volumes = ["VOL1_ARG", "VOL2_ARG=/path/to/volume"] +## Environment variables to be passed through to the container. +## A value for the environment variable can provided. +#passthrough = ["VAR1_ARG", "VAR2_ARG=VALUE"] + +# TARGET +# ------ +# Set build configurations for a single target. These +# values override those present in `[build]`. + +[target.aarch64-unknown-linux-gnu] +xargo = false +pre-build = [ + "dpkg --add-architecture $CROSS_DEB_ARCH && apt-get update --fix-missing && apt-get install --assume-yes libxcb1-dev:$CROSS_DEB_ARCH libdbus-1-dev:$CROSS_DEB_ARCH pkg-config:$CROSS_DEB_ARCH", +] + +[target.aarch64-unknown-linux-gnu.env] +passthrough = ["PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig"] + +[target.x86_64-unknown-linux-gnu] +xargo = false +pre-build = [ + "dpkg --add-architecture $CROSS_DEB_ARCH && apt-get update --fix-missing && apt-get install --assume-yes libxcb1-dev:$CROSS_DEB_ARCH libdbus-1-dev:$CROSS_DEB_ARCH pkg-config:$CROSS_DEB_ARCH", +] + diff --git a/Cross.toml.bk b/Cross.toml.bk new file mode 100644 index 000000000..c0eb13b06 --- /dev/null +++ b/Cross.toml.bk @@ -0,0 +1,80 @@ +# BUILD +# ----- +# Set build configurations for all targets. + +#[build] +## Use xargo when cross-compiling for targets without a pre-built +## standard library. Prefer `build-std` for most targets. This +## requires nightly. +#xargo = true +## Use `-Zbuild-std` when cross-compiling for targets without a +## pre-built standard library. This overrides `xargo`: if enabled, +## `xargo` will not be used. +#build-std = true +## Default target to build if the target is not provided via +## `--target` or `CARGO_BUILD_TARGET`. +#default-target = "x86_64-unknown-linux-gnu" +## Additional commands to run prior to building the package. +## These are translated into RUN commands to add to the Docker +## image prior to running cross. +#pre-build = [ +# "dpkg --add-architecture $CROSS_DEB_ARCH", +# "apt-get update && apt-get install --assume-yes libssl-dev:$CROSS_DEB_ARCH" +#] +## A custom Dockerfile to use for all targets. This can be +## provided as a struct or string. See below for a target +## for the struct variant. Both pre-build hooks can a custom +## Dockerfile can be provided: the pre-build hooks will be added +## to the end of the Dockerfile. +#dockerfile = "Dockerfile" +# +## BUILD ENVIRONMENT +## ----------------- +## Set the build environment for all targets. +# +#[build.env] +## Volumes to be mounted, passed via the value of an environment +## variable. These will be passed to the container both as +## a mountpoint and an environment variable. For example, the +## path to `VOL2_ARG` will be available as `$VOL2_ARG`, and +## the path will be mounted at `/path/to/volume`. +## A value for the environment variable containing the +## path to the volume can provided. +#volumes = ["VOL1_ARG", "VOL2_ARG=/path/to/volume"] +## Environment variables to be passed through to the container. +## A value for the environment variable can provided. +#passthrough = ["VAR1_ARG", "VAR2_ARG=VALUE"] + +# TARGET +# ------ +# Set build configurations for a single target. These +# values override those present in `[build]`. + +[target.aarch64-unknown-linux-gnu] +# Disable xargo for only `aarch64-unknown-linux-gnu`. +xargo = false +# Also disable `build-std` for `aarch64-unknown-linux-gnu`, +# since it already has a std library pre-built. +#build-std = true +# An optional runner to override the default runner, +# for example, allowing the use of Qemu or a native +# runner for binaries. Defaults to `qemu-user` for +# non-native binaries, or `native` for native binaries. +#runner = "qemu-user" +# A custom Docker image for `cross` to execute the build +# commands in. This image must be pre-built and will override +# the pre-build hooks. +#image = "repository:tag" +# Additional commands to run prior to building the package. +# These override the commands present in `[build]`: they +# will not merge. +#linker = "aarch64-linux-gnu-ld" +pre-build = [ + "dpkg --add-architecture $CROSS_DEB_ARCH && apt-get update --fix-missing && apt-get install --assume-yes libssl-dev:$CROSS_DEB_ARCH libxcb1-dev:$CROSS_DEB_ARCH libdbus-1-dev:$CROSS_DEB_ARCH pkg-config:$CROSS_DEB_ARCH && ln -s /usr/include/aarch64-linux-gnu/openssl/opensslconf.h /usr/include/openssl/opensslconf.h && ln -s /usr/include/aarch64-linux-gnu/openssl/configuration.h /usr/include/openssl/configuration.h && echo 'export LIBRARY_PATH=/usr/lib/aarch64-linux-gnu:$LIBRARY_PATH' >> /etc/profile && echo 'export LD_LIBRARY_PATH=/usr/lib/aarch64-linux-gnu:$LD_LIBRARY_PATH' >> /etc/profile && . /etc/profile", +# "dpkg --add-architecture $CROSS_DEB_ARCH", +# "apt-get update && apt-get install --assume-yes openssl:$CROSS_DEB_ARCH libssl-dev:$CROSS_DEB_ARCH libxcb1-dev:$CROSS_DEB_ARCH libdbus-1-dev:$CROSS_DEB_ARCH", +# "ln -s /usr/include/aarch64-linux-gnu/openssl/opensslconf.h /usr/include/openssl/opensslconf.h", +] + +[target.aarch64-unknown-linux-gnu.env] +passthrough = ["CROSS_DEBUG=true","PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig", "LIBRARY_PATH=/usr/lib/aarch64-linux-gnu", "LD_LIBRARY_PATH=/usr/lib/aarch64-linux-gnu"] diff --git a/crates/goose-cli/Cargo.toml b/crates/goose-cli/Cargo.toml index 4821c57c8..85db48650 100644 --- a/crates/goose-cli/Cargo.toml +++ b/crates/goose-cli/Cargo.toml @@ -30,7 +30,7 @@ serde_yaml = "0.9" dirs = "4.0" strum = "0.26" strum_macros = "0.26" -reqwest = "0.11.27" +reqwest = { version = "0.11", features = ["json", "rustls-tls"], default-features = false } rand = "0.8.5" async-trait = "0.1" rustyline = "15.0.0" @@ -41,3 +41,6 @@ rust_decimal_macros = "1.36.0" tempfile = "3" temp-env = { version = "0.3.6", features = ["async_closure"] } +#[target.aarch64-unknown-linux-gnu] +#linker = "aarch64-linux-gnu-ld" + diff --git a/crates/goose/Cargo.toml b/crates/goose/Cargo.toml index 4b68fd443..6a3437492 100644 --- a/crates/goose/Cargo.toml +++ b/crates/goose/Cargo.toml @@ -9,7 +9,7 @@ description.workspace = true [build-dependencies] tokio = { version = "1.36", features = ["full"] } -reqwest = { version = "0.11", features = ["json"] } +reqwest = { version = "0.11", features = ["json", "rustls-tls"], default-features = false } [dependencies] mcp-core = { path = "../mcp-core" } @@ -18,7 +18,7 @@ anyhow = "1.0" thiserror = "1.0" futures = "0.3" tokio-stream = "0.1" -reqwest = { version = "0.11", features = ["json"] } +reqwest = { version = "0.11", features = ["json", "rustls-tls"], default-features = false } tokio = { version = "1.0", features = ["full"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" @@ -73,3 +73,6 @@ path = "examples/databricks_oauth.rs" [[bench]] name = "tokenization_benchmark" harness = false + +#[target.aarch64-unknown-linux-gnu] +#linker = "aarch64-linux-gnu-ld" \ No newline at end of file From 0d3528e17caa3d695589eca3f99431adba3cebf7 Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Fri, 20 Dec 2024 16:23:45 +1100 Subject: [PATCH 02/43] use cross to build --- .github/workflows/cli-release.yml | 82 +++++++++++++------------------ 1 file changed, 34 insertions(+), 48 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index fedf38ac8..8ca795523 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -1,7 +1,7 @@ on: push: tags: - - "v1.*" + - "v_lifei.*" workflow_dispatch: concurrency: @@ -12,68 +12,54 @@ name: Release CLI jobs: build: - name: Build ${{ matrix.os }}-${{ matrix.architecture }} + name: Build ${{ matrix.architecture }}-${{ matrix.suffix }} runs-on: ${{ matrix.os }} strategy: - fail-fast: false +# fail-fast: false matrix: - include: - # Linux x86_64 build on Ubuntu - - os: ubuntu-latest - architecture: x86_64 - suffix: unknown-linux-gnu - - # TODO: Linux aarch64 (ARM64) build on Ubuntu via cross-compilation - probably use `cross-rs` - - # macOS x86_64 build - - os: macos-latest - architecture: x86_64 - suffix: apple-darwin - - # macOS ARM64 build - - os: macos-latest - architecture: aarch64 - suffix: apple-darwin + os: [ ubuntu-latest ] + architecture: [ x86_64, aarch64 ] + include: + - os: ubuntu-latest + target-suffix: unknown-linux-gnu +# - os: macos-latest +# target-suffix: apple-darwin +# include: +# # Linux x86_64 build on Ubuntu +# - os: ubuntu-latest +# architecture: x86_64 +# suffix: unknown-linux-gnu +# +# # TODO: Linux aarch64 (ARM64) build on Ubuntu via cross-compilation - probably use `cross-rs` +# +# # macOS x86_64 build +# - os: macos-latest +# architecture: x86_64 +# suffix: apple-darwin +# +# # macOS ARM64 build +# - os: macos-latest +# architecture: aarch64 +# suffix: apple-darwin steps: # Step 1: Checkout the code - name: Checkout code uses: actions/checkout@v4 - # Step 2: Set up Rust toolchain - # This will install the specified target as per matrix - name: Set up Rust toolchain - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - target: ${{ matrix.architecture }}-${{ matrix.suffix }} - - # Step 3: Install dependencies for macOS ARM64 builds - - name: Install dependencies for macOS ARM64 - if: matrix.os == 'macos-latest' && matrix.architecture == 'aarch64' - run: | - brew install llvm - rustup target add aarch64-apple-darwin - echo "export PATH=$(brew --prefix llvm)/bin:\$PATH" >> $GITHUB_ENV - - # Step 4: Install Libs for Ubuntu (x86_64 and aarch64) - - name: Install Libs for Ubuntu - if: matrix.os == 'ubuntu-latest' - run: | - sudo apt update -y - sudo apt install -y libdbus-1-dev gnome-keyring libxcb1-dev - gnome-keyring-daemon --components=secrets --daemonize --unlock <<< 'foobar' - + uses: actions-rs/toolchain@v1 - # Step 5: Build the project - - name: Build + - name: build run: | - export TARGET=${{ matrix.architecture }}-${{ matrix.suffix }} - cargo build --release --target $TARGET + export TARGET=${{ matrix.architecture }}-${{ matrix.target-suffix }} + rustup target add "${TARGET}" + cargo install cross --git https://github.com/cross-rs/cross + cross build --release --target ${TARGET} cd target/${TARGET}/release tar -cjf goose-${TARGET}.tar.bz2 goose goosed echo "ARTIFACT=target/${TARGET}/release/goose-${TARGET}.tar.bz2" >> $GITHUB_ENV - # Step 6: Upload artifacts - name: Upload artifact uses: actions/upload-artifact@v4 with: @@ -83,7 +69,7 @@ jobs: release: name: Release runs-on: ubuntu-latest - needs: [build] + needs: [ build ] permissions: contents: write steps: From b2dbcbebee0c7548bf66eb8b93b442a324bbd699 Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Fri, 20 Dec 2024 16:34:00 +1100 Subject: [PATCH 03/43] added toolchain properites --- .github/workflows/cli-release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 8ca795523..055618872 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -49,6 +49,9 @@ jobs: - name: Set up Rust toolchain uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true - name: build run: | From af4bec373dbc52f0aa369fe161e4a4fe35065b08 Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Fri, 20 Dec 2024 17:07:25 +1100 Subject: [PATCH 04/43] added debug message to find pkg-config path --- Cross.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cross.toml b/Cross.toml index 3a3fed3bb..cc92bc903 100644 --- a/Cross.toml +++ b/Cross.toml @@ -53,7 +53,7 @@ [target.aarch64-unknown-linux-gnu] xargo = false pre-build = [ - "dpkg --add-architecture $CROSS_DEB_ARCH && apt-get update --fix-missing && apt-get install --assume-yes libxcb1-dev:$CROSS_DEB_ARCH libdbus-1-dev:$CROSS_DEB_ARCH pkg-config:$CROSS_DEB_ARCH", + "dpkg --add-architecture $CROSS_DEB_ARCH && apt-get update --fix-missing && apt-get install --assume-yes libxcb1-dev:$CROSS_DEB_ARCH libdbus-1-dev:$CROSS_DEB_ARCH pkg-config:$CROSS_DEB_ARCH && which pkg-config && pkg-config --version", ] [target.aarch64-unknown-linux-gnu.env] From 86cbb51d96912396bc804852dce0058c81866f2b Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Fri, 20 Dec 2024 17:20:31 +1100 Subject: [PATCH 05/43] set pkg env variable --- .github/workflows/cli-release.yml | 2 +- Cross.toml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 055618872..a02bec702 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -15,7 +15,7 @@ jobs: name: Build ${{ matrix.architecture }}-${{ matrix.suffix }} runs-on: ${{ matrix.os }} strategy: -# fail-fast: false + fail-fast: false matrix: os: [ ubuntu-latest ] architecture: [ x86_64, aarch64 ] diff --git a/Cross.toml b/Cross.toml index cc92bc903..e1d4f8047 100644 --- a/Cross.toml +++ b/Cross.toml @@ -53,11 +53,11 @@ [target.aarch64-unknown-linux-gnu] xargo = false pre-build = [ - "dpkg --add-architecture $CROSS_DEB_ARCH && apt-get update --fix-missing && apt-get install --assume-yes libxcb1-dev:$CROSS_DEB_ARCH libdbus-1-dev:$CROSS_DEB_ARCH pkg-config:$CROSS_DEB_ARCH && which pkg-config && pkg-config --version", + "dpkg --add-architecture $CROSS_DEB_ARCH && apt-get update --fix-missing && apt-get install --assume-yes libxcb1-dev:$CROSS_DEB_ARCH libdbus-1-dev:$CROSS_DEB_ARCH pkg-config:$CROSS_DEB_ARCH", ] [target.aarch64-unknown-linux-gnu.env] -passthrough = ["PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig"] +passthrough = ["PKG_CONFIG_ALLOW_SYSTEM_LIBS=0","PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=0","PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig"] [target.x86_64-unknown-linux-gnu] xargo = false From 31f84054ba1e09b105f2e690b55ec0809a26e0bf Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Fri, 20 Dec 2024 17:33:49 +1100 Subject: [PATCH 06/43] temperarily change the trigger of the job. disabled release --- .github/workflows/cli-release.yml | 42 +++++++++++++++---------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index a02bec702..c59e848f9 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -1,7 +1,7 @@ on: push: - tags: - - "v_lifei.*" + branches: + - "lifei/aarch64-linux" workflow_dispatch: concurrency: @@ -69,22 +69,22 @@ jobs: name: goose-${{ matrix.architecture }}-${{ matrix.suffix }} path: ${{ env.ARTIFACT }} - release: - name: Release - runs-on: ubuntu-latest - needs: [ build ] - permissions: - contents: write - steps: - # Step 1: Download all build artifacts - - name: Download all artifacts - uses: actions/download-artifact@v4 - with: - merge-multiple: true - - # Step 2: Create GitHub release with artifacts - - name: Create GitHub release - uses: ncipollo/release-action@v1 - with: - artifacts: "goose-*.tar.bz2" - token: ${{ secrets.GITHUB_TOKEN }} +# release: +# name: Release +# runs-on: ubuntu-latest +# needs: [ build ] +# permissions: +# contents: write +# steps: +# # Step 1: Download all build artifacts +# - name: Download all artifacts +# uses: actions/download-artifact@v4 +# with: +# merge-multiple: true +# +# # Step 2: Create GitHub release with artifacts +# - name: Create GitHub release +# uses: ncipollo/release-action@v1 +# with: +# artifacts: "goose-*.tar.bz2" +# token: ${{ secrets.GITHUB_TOKEN }} From 1c96c6bed2b455985937358706b6a33baace4b23 Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Fri, 20 Dec 2024 17:37:26 +1100 Subject: [PATCH 07/43] added backtrace --- .github/workflows/cli-release.yml | 4 ++-- Cross.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index c59e848f9..4582b8c16 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -18,7 +18,7 @@ jobs: fail-fast: false matrix: os: [ ubuntu-latest ] - architecture: [ x86_64, aarch64 ] + architecture: [ aarch64 ] include: - os: ubuntu-latest target-suffix: unknown-linux-gnu @@ -58,7 +58,7 @@ jobs: export TARGET=${{ matrix.architecture }}-${{ matrix.target-suffix }} rustup target add "${TARGET}" cargo install cross --git https://github.com/cross-rs/cross - cross build --release --target ${TARGET} + CROSS_BUILD_OPTS="--platform linux/amd64 --no-cache" CROSS_CONTAINER_OPTS="--platform linux/amd64" cross build --release --target ${TARGET} cd target/${TARGET}/release tar -cjf goose-${TARGET}.tar.bz2 goose goosed echo "ARTIFACT=target/${TARGET}/release/goose-${TARGET}.tar.bz2" >> $GITHUB_ENV diff --git a/Cross.toml b/Cross.toml index e1d4f8047..86bde5d41 100644 --- a/Cross.toml +++ b/Cross.toml @@ -57,7 +57,7 @@ pre-build = [ ] [target.aarch64-unknown-linux-gnu.env] -passthrough = ["PKG_CONFIG_ALLOW_SYSTEM_LIBS=0","PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=0","PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig"] +passthrough = ["RUST_BACKTRACE=1", "PKG_CONFIG_ALLOW_SYSTEM_LIBS=0","PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=0","PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig"] [target.x86_64-unknown-linux-gnu] xargo = false From d85aaff57a423efc8333973e4a15222ca408cea0 Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Fri, 20 Dec 2024 17:45:27 +1100 Subject: [PATCH 08/43] set backtrace to full --- Cross.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cross.toml b/Cross.toml index 86bde5d41..82700c621 100644 --- a/Cross.toml +++ b/Cross.toml @@ -57,7 +57,7 @@ pre-build = [ ] [target.aarch64-unknown-linux-gnu.env] -passthrough = ["RUST_BACKTRACE=1", "PKG_CONFIG_ALLOW_SYSTEM_LIBS=0","PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=0","PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig"] +passthrough = ["RUST_BACKTRACE=full", "PKG_CONFIG_ALLOW_SYSTEM_LIBS=0","PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=0","PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig"] [target.x86_64-unknown-linux-gnu] xargo = false From 54ab26fbfd0251f22c32607c3b8d1188889c9aaa Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Fri, 20 Dec 2024 17:58:08 +1100 Subject: [PATCH 09/43] set sysroot env --- Cross.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cross.toml b/Cross.toml index 82700c621..15025509a 100644 --- a/Cross.toml +++ b/Cross.toml @@ -57,7 +57,7 @@ pre-build = [ ] [target.aarch64-unknown-linux-gnu.env] -passthrough = ["RUST_BACKTRACE=full", "PKG_CONFIG_ALLOW_SYSTEM_LIBS=0","PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=0","PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig"] +passthrough = ["PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu","RUST_BACKTRACE=full", "PKG_CONFIG_ALLOW_SYSTEM_LIBS=0","PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=0","PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig"] [target.x86_64-unknown-linux-gnu] xargo = false From e0b4c278c8002af62fb18624e741dd9620f95c59 Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Fri, 20 Dec 2024 20:48:26 +1100 Subject: [PATCH 10/43] set more env var --- Cross.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cross.toml b/Cross.toml index 15025509a..eede36045 100644 --- a/Cross.toml +++ b/Cross.toml @@ -57,7 +57,7 @@ pre-build = [ ] [target.aarch64-unknown-linux-gnu.env] -passthrough = ["PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu","RUST_BACKTRACE=full", "PKG_CONFIG_ALLOW_SYSTEM_LIBS=0","PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=0","PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig"] +passthrough = ["PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu", "PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig", "RUST_BACKTRACE=full", "PKG_CONFIG_ALLOW_SYSTEM_LIBS=0","PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=0","PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig"] [target.x86_64-unknown-linux-gnu] xargo = false From 63f58957bb896968bd00a36748204124ffee8043 Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Fri, 20 Dec 2024 20:56:44 +1100 Subject: [PATCH 11/43] more env and with specific toolkit --- .github/workflows/cli-release.yml | 7 +++---- Cross.toml | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 4582b8c16..8bdf96278 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -12,7 +12,7 @@ name: Release CLI jobs: build: - name: Build ${{ matrix.architecture }}-${{ matrix.suffix }} + name: Build ${{ matrix.architecture }}-${{ matrix.target-suffix }} runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -48,10 +48,9 @@ jobs: uses: actions/checkout@v4 - name: Set up Rust toolchain - uses: actions-rs/toolchain@v1 + uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: stable - override: true + target: ${{ matrix.architecture }}-${{ matrix.target-suffix }} - name: build run: | diff --git a/Cross.toml b/Cross.toml index eede36045..b6a25e90c 100644 --- a/Cross.toml +++ b/Cross.toml @@ -57,7 +57,7 @@ pre-build = [ ] [target.aarch64-unknown-linux-gnu.env] -passthrough = ["PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu", "PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig", "RUST_BACKTRACE=full", "PKG_CONFIG_ALLOW_SYSTEM_LIBS=0","PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=0","PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig"] +passthrough = ["CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG=true","PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu", "PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig", "RUST_BACKTRACE=full", "PKG_CONFIG_ALLOW_SYSTEM_LIBS=0","PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=0","PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig"] [target.x86_64-unknown-linux-gnu] xargo = false From cf33c517f662712ba4ff6827e04fe021210696ab Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Fri, 20 Dec 2024 20:58:48 +1100 Subject: [PATCH 12/43] revert toolchain --- .github/workflows/cli-release.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 8bdf96278..824175803 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -48,9 +48,10 @@ jobs: uses: actions/checkout@v4 - name: Set up Rust toolchain - uses: actions-rust-lang/setup-rust-toolchain@v1 + uses: actions-rs/toolchain@v1 with: - target: ${{ matrix.architecture }}-${{ matrix.target-suffix }} + toolchain: stable + override: true - name: build run: | From 6914123928f3627c87d5c2ad0b83fe7e1d716a8a Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Fri, 20 Dec 2024 21:03:02 +1100 Subject: [PATCH 13/43] run on macos --- .github/workflows/cli-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 824175803..4e77e467b 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -13,7 +13,7 @@ name: Release CLI jobs: build: name: Build ${{ matrix.architecture }}-${{ matrix.target-suffix }} - runs-on: ${{ matrix.os }} + runs-on: macos-latest strategy: fail-fast: false matrix: From 13bdc49d3754376f2b31e428f75e10a68cdd48c8 Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Fri, 20 Dec 2024 21:06:33 +1100 Subject: [PATCH 14/43] revert change --- .github/workflows/cli-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 4e77e467b..824175803 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -13,7 +13,7 @@ name: Release CLI jobs: build: name: Build ${{ matrix.architecture }}-${{ matrix.target-suffix }} - runs-on: macos-latest + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: From 1f33d374b971fde5f6c3e461b80b759465d08743 Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Fri, 20 Dec 2024 21:21:20 +1100 Subject: [PATCH 15/43] remove env var --- Cross.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cross.toml b/Cross.toml index b6a25e90c..4e8dc7a2c 100644 --- a/Cross.toml +++ b/Cross.toml @@ -56,8 +56,8 @@ pre-build = [ "dpkg --add-architecture $CROSS_DEB_ARCH && apt-get update --fix-missing && apt-get install --assume-yes libxcb1-dev:$CROSS_DEB_ARCH libdbus-1-dev:$CROSS_DEB_ARCH pkg-config:$CROSS_DEB_ARCH", ] -[target.aarch64-unknown-linux-gnu.env] -passthrough = ["CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG=true","PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu", "PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig", "RUST_BACKTRACE=full", "PKG_CONFIG_ALLOW_SYSTEM_LIBS=0","PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=0","PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig"] +#[target.aarch64-unknown-linux-gnu.env] +#passthrough = ["CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG=true","PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu", "PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig", "RUST_BACKTRACE=full", "PKG_CONFIG_ALLOW_SYSTEM_LIBS=0","PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=0","PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig"] [target.x86_64-unknown-linux-gnu] xargo = false From 809d65b0e2f65ea5e78421a110c33eeca6465e2b Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Fri, 20 Dec 2024 21:39:31 +1100 Subject: [PATCH 16/43] not install pkg-config --- Cross.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cross.toml b/Cross.toml index 4e8dc7a2c..f64792a1a 100644 --- a/Cross.toml +++ b/Cross.toml @@ -53,7 +53,7 @@ [target.aarch64-unknown-linux-gnu] xargo = false pre-build = [ - "dpkg --add-architecture $CROSS_DEB_ARCH && apt-get update --fix-missing && apt-get install --assume-yes libxcb1-dev:$CROSS_DEB_ARCH libdbus-1-dev:$CROSS_DEB_ARCH pkg-config:$CROSS_DEB_ARCH", + "dpkg --add-architecture $CROSS_DEB_ARCH && apt-get update --fix-missing && apt-get install --assume-yes libxcb1-dev:$CROSS_DEB_ARCH libdbus-1-dev:$CROSS_DEB_ARCH", ] #[target.aarch64-unknown-linux-gnu.env] From ab1c3f738ec7ee65b9f0c1a7c1d7027d9cfebbf5 Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Fri, 20 Dec 2024 22:12:03 +1100 Subject: [PATCH 17/43] add release step --- .github/workflows/cli-release.yml | 42 +++++++++++++++---------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 824175803..67dcd0d84 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -1,7 +1,7 @@ on: push: - branches: - - "lifei/aarch64-linux" + tags: + - "v_lifei.*" workflow_dispatch: concurrency: @@ -69,22 +69,22 @@ jobs: name: goose-${{ matrix.architecture }}-${{ matrix.suffix }} path: ${{ env.ARTIFACT }} -# release: -# name: Release -# runs-on: ubuntu-latest -# needs: [ build ] -# permissions: -# contents: write -# steps: -# # Step 1: Download all build artifacts -# - name: Download all artifacts -# uses: actions/download-artifact@v4 -# with: -# merge-multiple: true -# -# # Step 2: Create GitHub release with artifacts -# - name: Create GitHub release -# uses: ncipollo/release-action@v1 -# with: -# artifacts: "goose-*.tar.bz2" -# token: ${{ secrets.GITHUB_TOKEN }} + release: + name: Release + runs-on: ubuntu-latest + needs: [ build ] + permissions: + contents: write + steps: + # Step 1: Download all build artifacts + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + merge-multiple: true + + # Step 2: Create GitHub release with artifacts + - name: Create GitHub release + uses: ncipollo/release-action@v1 + with: + artifacts: "goose-*.tar.bz2" + token: ${{ secrets.GITHUB_TOKEN }} From a42963b5e152b68d859612da601ef3b91bbd9567 Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Fri, 20 Dec 2024 22:14:08 +1100 Subject: [PATCH 18/43] fixed wrong variable --- .github/workflows/cli-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 67dcd0d84..706236817 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -66,7 +66,7 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: goose-${{ matrix.architecture }}-${{ matrix.suffix }} + name: goose-${{ matrix.architecture }}-${{ matrix.target-suffix }} path: ${{ env.ARTIFACT }} release: From 80317f825d6466a696994399dd8373afe25f9351 Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Fri, 20 Dec 2024 22:33:12 +1100 Subject: [PATCH 19/43] remove unnecessary env --- .github/workflows/cli-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 706236817..169c189ea 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -58,7 +58,7 @@ jobs: export TARGET=${{ matrix.architecture }}-${{ matrix.target-suffix }} rustup target add "${TARGET}" cargo install cross --git https://github.com/cross-rs/cross - CROSS_BUILD_OPTS="--platform linux/amd64 --no-cache" CROSS_CONTAINER_OPTS="--platform linux/amd64" cross build --release --target ${TARGET} + cross build --release --target ${TARGET} cd target/${TARGET}/release tar -cjf goose-${TARGET}.tar.bz2 goose goosed echo "ARTIFACT=target/${TARGET}/release/goose-${TARGET}.tar.bz2" >> $GITHUB_ENV From 7abd3d3e3d2ce468b6225ce6e178794edd7210ca Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Fri, 20 Dec 2024 22:44:28 +1100 Subject: [PATCH 20/43] turn on x86_64 linux --- .github/workflows/cli-release.yml | 2 +- Cross.toml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 169c189ea..00671f68a 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -18,7 +18,7 @@ jobs: fail-fast: false matrix: os: [ ubuntu-latest ] - architecture: [ aarch64 ] + architecture: [ aarch64, x86_64 ] include: - os: ubuntu-latest target-suffix: unknown-linux-gnu diff --git a/Cross.toml b/Cross.toml index f64792a1a..d97d14084 100644 --- a/Cross.toml +++ b/Cross.toml @@ -59,9 +59,9 @@ pre-build = [ #[target.aarch64-unknown-linux-gnu.env] #passthrough = ["CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG=true","PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu", "PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig", "RUST_BACKTRACE=full", "PKG_CONFIG_ALLOW_SYSTEM_LIBS=0","PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=0","PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig"] -[target.x86_64-unknown-linux-gnu] -xargo = false -pre-build = [ - "dpkg --add-architecture $CROSS_DEB_ARCH && apt-get update --fix-missing && apt-get install --assume-yes libxcb1-dev:$CROSS_DEB_ARCH libdbus-1-dev:$CROSS_DEB_ARCH pkg-config:$CROSS_DEB_ARCH", -] +#[target.x86_64-unknown-linux-gnu] +#xargo = false +#pre-build = [ +# "dpkg --add-architecture $CROSS_DEB_ARCH && apt-get update --fix-missing && apt-get install --assume-yes libxcb1-dev:$CROSS_DEB_ARCH libdbus-1-dev:$CROSS_DEB_ARCH pkg-config:$CROSS_DEB_ARCH", +#] From a71ffe799180984d8dd741ddba635b7ea12e3ad9 Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Fri, 20 Dec 2024 22:50:51 +1100 Subject: [PATCH 21/43] try x86_64 linux --- .github/workflows/cli-release.yml | 46 ++++++++++++++++--------------- Cross.toml | 10 +++---- 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 00671f68a..7ba3f94a6 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -1,7 +1,9 @@ on: push: - tags: - - "v_lifei.*" +# tags: +# - "v_lifei.*" + branches: + - "- lifei/aarch64-linux" workflow_dispatch: concurrency: @@ -18,7 +20,7 @@ jobs: fail-fast: false matrix: os: [ ubuntu-latest ] - architecture: [ aarch64, x86_64 ] + architecture: [ x86_64 ] include: - os: ubuntu-latest target-suffix: unknown-linux-gnu @@ -69,22 +71,22 @@ jobs: name: goose-${{ matrix.architecture }}-${{ matrix.target-suffix }} path: ${{ env.ARTIFACT }} - release: - name: Release - runs-on: ubuntu-latest - needs: [ build ] - permissions: - contents: write - steps: - # Step 1: Download all build artifacts - - name: Download all artifacts - uses: actions/download-artifact@v4 - with: - merge-multiple: true - - # Step 2: Create GitHub release with artifacts - - name: Create GitHub release - uses: ncipollo/release-action@v1 - with: - artifacts: "goose-*.tar.bz2" - token: ${{ secrets.GITHUB_TOKEN }} +# release: +# name: Release +# runs-on: ubuntu-latest +# needs: [ build ] +# permissions: +# contents: write +# steps: +# # Step 1: Download all build artifacts +# - name: Download all artifacts +# uses: actions/download-artifact@v4 +# with: +# merge-multiple: true +# +# # Step 2: Create GitHub release with artifacts +# - name: Create GitHub release +# uses: ncipollo/release-action@v1 +# with: +# artifacts: "goose-*.tar.bz2" +# token: ${{ secrets.GITHUB_TOKEN }} diff --git a/Cross.toml b/Cross.toml index d97d14084..43cf9bdba 100644 --- a/Cross.toml +++ b/Cross.toml @@ -59,9 +59,9 @@ pre-build = [ #[target.aarch64-unknown-linux-gnu.env] #passthrough = ["CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG=true","PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu", "PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig", "RUST_BACKTRACE=full", "PKG_CONFIG_ALLOW_SYSTEM_LIBS=0","PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=0","PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig"] -#[target.x86_64-unknown-linux-gnu] -#xargo = false -#pre-build = [ -# "dpkg --add-architecture $CROSS_DEB_ARCH && apt-get update --fix-missing && apt-get install --assume-yes libxcb1-dev:$CROSS_DEB_ARCH libdbus-1-dev:$CROSS_DEB_ARCH pkg-config:$CROSS_DEB_ARCH", -#] +[target.x86_64-unknown-linux-gnu] +xargo = false +pre-build = [ + "dpkg --add-architecture $CROSS_DEB_ARCH && apt-get update --fix-missing && apt-get install --assume-yes libxcb1-dev:$CROSS_DEB_ARCH libdbus-1-dev:$CROSS_DEB_ARCH", +] From 4902ceaf34911923fc75e9e60644d1c2037294e0 Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Fri, 20 Dec 2024 22:53:40 +1100 Subject: [PATCH 22/43] fixed workflow trigger --- .github/workflows/cli-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 7ba3f94a6..897ec551b 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -3,7 +3,7 @@ on: # tags: # - "v_lifei.*" branches: - - "- lifei/aarch64-linux" + - "lifei/aarch64-linux" workflow_dispatch: concurrency: From d8c804bf1f382c095adc5318e42266a19357bc72 Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Fri, 20 Dec 2024 23:06:00 +1100 Subject: [PATCH 23/43] turn on release x86_64 linux --- .github/workflows/cli-release.yml | 46 +++++++++++++++---------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 897ec551b..7f126e006 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -1,9 +1,9 @@ on: push: -# tags: -# - "v_lifei.*" - branches: - - "lifei/aarch64-linux" + tags: + - "v_lifei.*" +# branches: +# - "lifei/aarch64-linux" workflow_dispatch: concurrency: @@ -71,22 +71,22 @@ jobs: name: goose-${{ matrix.architecture }}-${{ matrix.target-suffix }} path: ${{ env.ARTIFACT }} -# release: -# name: Release -# runs-on: ubuntu-latest -# needs: [ build ] -# permissions: -# contents: write -# steps: -# # Step 1: Download all build artifacts -# - name: Download all artifacts -# uses: actions/download-artifact@v4 -# with: -# merge-multiple: true -# -# # Step 2: Create GitHub release with artifacts -# - name: Create GitHub release -# uses: ncipollo/release-action@v1 -# with: -# artifacts: "goose-*.tar.bz2" -# token: ${{ secrets.GITHUB_TOKEN }} + release: + name: Release + runs-on: ubuntu-latest + needs: [ build ] + permissions: + contents: write + steps: + # Step 1: Download all build artifacts + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + merge-multiple: true + + # Step 2: Create GitHub release with artifacts + - name: Create GitHub release + uses: ncipollo/release-action@v1 + with: + artifacts: "goose-*.tar.bz2" + token: ${{ secrets.GITHUB_TOKEN }} From cddd0cacf6eacc86408b6d669c866008c5232718 Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Fri, 20 Dec 2024 23:19:56 +1100 Subject: [PATCH 24/43] start macos x86_64 --- .github/workflows/cli-release.yml | 49 ++++++++++++++++--------------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 7f126e006..b78c40ece 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -1,9 +1,9 @@ on: push: - tags: - - "v_lifei.*" -# branches: -# - "lifei/aarch64-linux" +# tags: +# - "v_lifei.*" + branches: + - "lifei/aarch64-linux" workflow_dispatch: concurrency: @@ -19,7 +19,8 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-latest ] +# os: [ ubuntu-latest ] + os: [ macos-latest ] architecture: [ x86_64 ] include: - os: ubuntu-latest @@ -71,22 +72,22 @@ jobs: name: goose-${{ matrix.architecture }}-${{ matrix.target-suffix }} path: ${{ env.ARTIFACT }} - release: - name: Release - runs-on: ubuntu-latest - needs: [ build ] - permissions: - contents: write - steps: - # Step 1: Download all build artifacts - - name: Download all artifacts - uses: actions/download-artifact@v4 - with: - merge-multiple: true - - # Step 2: Create GitHub release with artifacts - - name: Create GitHub release - uses: ncipollo/release-action@v1 - with: - artifacts: "goose-*.tar.bz2" - token: ${{ secrets.GITHUB_TOKEN }} +# release: +# name: Release +# runs-on: ubuntu-latest +# needs: [ build ] +# permissions: +# contents: write +# steps: +# # Step 1: Download all build artifacts +# - name: Download all artifacts +# uses: actions/download-artifact@v4 +# with: +# merge-multiple: true +# +# # Step 2: Create GitHub release with artifacts +# - name: Create GitHub release +# uses: ncipollo/release-action@v1 +# with: +# artifacts: "goose-*.tar.bz2" +# token: ${{ secrets.GITHUB_TOKEN }} From 366aec2cfd251347dfae5b14f10074753672fc7a Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Fri, 20 Dec 2024 23:22:38 +1100 Subject: [PATCH 25/43] fixed workflow script --- .github/workflows/cli-release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index b78c40ece..c38666c38 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -23,10 +23,10 @@ jobs: os: [ macos-latest ] architecture: [ x86_64 ] include: - - os: ubuntu-latest - target-suffix: unknown-linux-gnu -# - os: macos-latest -# target-suffix: apple-darwin +# - os: ubuntu-latest +# target-suffix: unknown-linux-gnu + - os: macos-latest + target-suffix: apple-darwin # include: # # Linux x86_64 build on Ubuntu # - os: ubuntu-latest From ad7835277a992b600b426e64c9387c0a3c657b34 Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Fri, 20 Dec 2024 23:29:25 +1100 Subject: [PATCH 26/43] run aarch64 macos --- .github/workflows/cli-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index c38666c38..4f81b3dd1 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -21,7 +21,7 @@ jobs: matrix: # os: [ ubuntu-latest ] os: [ macos-latest ] - architecture: [ x86_64 ] + architecture: [ aarch64 ] include: # - os: ubuntu-latest # target-suffix: unknown-linux-gnu From b5bbd3069d6a50f15b6a146fe22f8d576c15a7ad Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Fri, 20 Dec 2024 23:33:38 +1100 Subject: [PATCH 27/43] added target of toolchain --- .github/workflows/cli-release.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 4f81b3dd1..c25d90c72 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -53,8 +53,10 @@ jobs: - name: Set up Rust toolchain uses: actions-rs/toolchain@v1 with: - toolchain: stable - override: true + target: ${{ matrix.architecture }}-${{ matrix.suffix }} +# with: +# toolchain: stable +# override: true - name: build run: | From cea042f524b475a66fbff6d2cf7011dd5bc1961c Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Fri, 20 Dec 2024 23:35:03 +1100 Subject: [PATCH 28/43] fixed variable --- .github/workflows/cli-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index c25d90c72..f378a19fa 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -53,7 +53,7 @@ jobs: - name: Set up Rust toolchain uses: actions-rs/toolchain@v1 with: - target: ${{ matrix.architecture }}-${{ matrix.suffix }} + target: ${{ matrix.architecture }}-${{ matrix.target-suffix }} # with: # toolchain: stable # override: true From fde066c2eabbf45a2d4cb64b1e7510cacc87b2b8 Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Fri, 20 Dec 2024 23:35:58 +1100 Subject: [PATCH 29/43] reverted change --- .github/workflows/cli-release.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index f378a19fa..a6cab6c37 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -53,9 +53,7 @@ jobs: - name: Set up Rust toolchain uses: actions-rs/toolchain@v1 with: - target: ${{ matrix.architecture }}-${{ matrix.target-suffix }} -# with: -# toolchain: stable + toolchain: stable # override: true - name: build From 457d55e5bfd4eaed9b15634641ae3a6063d56145 Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Fri, 20 Dec 2024 23:38:54 +1100 Subject: [PATCH 30/43] turn on full backtrace --- Cross.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Cross.toml b/Cross.toml index 43cf9bdba..b1fd798a1 100644 --- a/Cross.toml +++ b/Cross.toml @@ -65,3 +65,6 @@ pre-build = [ "dpkg --add-architecture $CROSS_DEB_ARCH && apt-get update --fix-missing && apt-get install --assume-yes libxcb1-dev:$CROSS_DEB_ARCH libdbus-1-dev:$CROSS_DEB_ARCH", ] +[target.aarch64-apple-darwin.env] +passthrough = ["CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG=true","BACKTRACE=full"] + From 319fab64a37f56c6a0e69e6bffd1d142a4d38e52 Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Sat, 21 Dec 2024 07:03:20 +1100 Subject: [PATCH 31/43] added CROSS_NO_WARNINGS=0 --- .github/workflows/cli-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index a6cab6c37..cacf22a92 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -61,7 +61,7 @@ jobs: export TARGET=${{ matrix.architecture }}-${{ matrix.target-suffix }} rustup target add "${TARGET}" cargo install cross --git https://github.com/cross-rs/cross - cross build --release --target ${TARGET} + CROSS_NO_WARNINGS=0 cross build --release --target ${TARGET} cd target/${TARGET}/release tar -cjf goose-${TARGET}.tar.bz2 goose goosed echo "ARTIFACT=target/${TARGET}/release/goose-${TARGET}.tar.bz2" >> $GITHUB_ENV From 075ec23b67cd822fb91a2284fd2575cbd9c0180f Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Sat, 21 Dec 2024 07:13:21 +1100 Subject: [PATCH 32/43] try x86_64 macos --- .github/workflows/cli-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index cacf22a92..f7dce981a 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -21,7 +21,7 @@ jobs: matrix: # os: [ ubuntu-latest ] os: [ macos-latest ] - architecture: [ aarch64 ] + architecture: [ x86_64 ] include: # - os: ubuntu-latest # target-suffix: unknown-linux-gnu From 77f414d745453728492bbfbcd7175d98e1bef4db Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Sat, 21 Dec 2024 07:21:45 +1100 Subject: [PATCH 33/43] turn on release for macos --- .github/workflows/cli-release.yml | 48 +++++++++++++++---------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index f7dce981a..973a36869 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -1,9 +1,9 @@ on: push: -# tags: -# - "v_lifei.*" - branches: - - "lifei/aarch64-linux" + tags: + - "v_lifei.*" +# branches: +# - "lifei/aarch64-linux" workflow_dispatch: concurrency: @@ -21,7 +21,7 @@ jobs: matrix: # os: [ ubuntu-latest ] os: [ macos-latest ] - architecture: [ x86_64 ] + architecture: [ aarch64, x86_64 ] include: # - os: ubuntu-latest # target-suffix: unknown-linux-gnu @@ -72,22 +72,22 @@ jobs: name: goose-${{ matrix.architecture }}-${{ matrix.target-suffix }} path: ${{ env.ARTIFACT }} -# release: -# name: Release -# runs-on: ubuntu-latest -# needs: [ build ] -# permissions: -# contents: write -# steps: -# # Step 1: Download all build artifacts -# - name: Download all artifacts -# uses: actions/download-artifact@v4 -# with: -# merge-multiple: true -# -# # Step 2: Create GitHub release with artifacts -# - name: Create GitHub release -# uses: ncipollo/release-action@v1 -# with: -# artifacts: "goose-*.tar.bz2" -# token: ${{ secrets.GITHUB_TOKEN }} + release: + name: Release + runs-on: ubuntu-latest + needs: [ build ] + permissions: + contents: write + steps: + # Step 1: Download all build artifacts + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + merge-multiple: true + + # Step 2: Create GitHub release with artifacts + - name: Create GitHub release + uses: ncipollo/release-action@v1 + with: + artifacts: "goose-*.tar.bz2" + token: ${{ secrets.GITHUB_TOKEN }} From aaefbe4755693394c8c3cb0de77b715ab67b1b42 Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Sat, 21 Dec 2024 07:37:04 +1100 Subject: [PATCH 34/43] include all arch since they are all working now --- .github/workflows/cli-release.yml | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 973a36869..d58cd7e22 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -2,8 +2,6 @@ on: push: tags: - "v_lifei.*" -# branches: -# - "lifei/aarch64-linux" workflow_dispatch: concurrency: @@ -19,34 +17,15 @@ jobs: strategy: fail-fast: false matrix: -# os: [ ubuntu-latest ] - os: [ macos-latest ] + os: [ ubuntu-latest, macos-latest ] architecture: [ aarch64, x86_64 ] include: -# - os: ubuntu-latest -# target-suffix: unknown-linux-gnu + - os: ubuntu-latest + target-suffix: unknown-linux-gnu - os: macos-latest target-suffix: apple-darwin -# include: -# # Linux x86_64 build on Ubuntu -# - os: ubuntu-latest -# architecture: x86_64 -# suffix: unknown-linux-gnu -# -# # TODO: Linux aarch64 (ARM64) build on Ubuntu via cross-compilation - probably use `cross-rs` -# -# # macOS x86_64 build -# - os: macos-latest -# architecture: x86_64 -# suffix: apple-darwin -# -# # macOS ARM64 build -# - os: macos-latest -# architecture: aarch64 -# suffix: apple-darwin steps: - # Step 1: Checkout the code - name: Checkout code uses: actions/checkout@v4 @@ -54,7 +33,6 @@ jobs: uses: actions-rs/toolchain@v1 with: toolchain: stable -# override: true - name: build run: | From 05ccb598023acd61a232071608df5c99513d7678 Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Sat, 21 Dec 2024 08:13:48 +1100 Subject: [PATCH 35/43] clean up and add the notes for testing release on local machine --- Cross.toml | 63 +++------------------------- Cross.toml.bk | 80 ----------------------------------- docs/run_cross_local.md | 92 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 98 insertions(+), 137 deletions(-) delete mode 100644 Cross.toml.bk create mode 100644 docs/run_cross_local.md diff --git a/Cross.toml b/Cross.toml index b1fd798a1..3c37eeeb1 100644 --- a/Cross.toml +++ b/Cross.toml @@ -1,70 +1,19 @@ -# BUILD -# ----- -# Set build configurations for all targets. - -[build] -## Use xargo when cross-compiling for targets without a pre-built -## standard library. Prefer `build-std` for most targets. This -## requires nightly. -#xargo = true -## Use `-Zbuild-std` when cross-compiling for targets without a -## pre-built standard library. This overrides `xargo`: if enabled, -## `xargo` will not be used. -#build-std = true -## Default target to build if the target is not provided via -## `--target` or `CARGO_BUILD_TARGET`. -#default-target = "x86_64-unknown-linux-gnu" -## Additional commands to run prior to building the package. -## These are translated into RUN commands to add to the Docker -## image prior to running cross. -#pre-build = [ -# "dpkg --add-architecture $CROSS_DEB_ARCH", -# "apt-get update && apt-get install --assume-yes libssl-dev:$CROSS_DEB_ARCH" -#] -## A custom Dockerfile to use for all targets. This can be -## provided as a struct or string. See below for a target -## for the struct variant. Both pre-build hooks can a custom -## Dockerfile can be provided: the pre-build hooks will be added -## to the end of the Dockerfile. -#dockerfile = "Dockerfile" -# -## BUILD ENVIRONMENT -## ----------------- -## Set the build environment for all targets. -# -#[build.env] -## Volumes to be mounted, passed via the value of an environment -## variable. These will be passed to the container both as -## a mountpoint and an environment variable. For example, the -## path to `VOL2_ARG` will be available as `$VOL2_ARG`, and -## the path will be mounted at `/path/to/volume`. -## A value for the environment variable containing the -## path to the volume can provided. -#volumes = ["VOL1_ARG", "VOL2_ARG=/path/to/volume"] -## Environment variables to be passed through to the container. -## A value for the environment variable can provided. -#passthrough = ["VAR1_ARG", "VAR2_ARG=VALUE"] - -# TARGET -# ------ -# Set build configurations for a single target. These -# values override those present in `[build]`. - [target.aarch64-unknown-linux-gnu] xargo = false pre-build = [ "dpkg --add-architecture $CROSS_DEB_ARCH && apt-get update --fix-missing && apt-get install --assume-yes libxcb1-dev:$CROSS_DEB_ARCH libdbus-1-dev:$CROSS_DEB_ARCH", ] +# If you run the build on your local machine, +# This is a workaround for the missing pkg-config path on aarch64 +# You also need to add pkg-config:$CROSS_DEB_ARCH to the apt-get install command above #[target.aarch64-unknown-linux-gnu.env] -#passthrough = ["CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG=true","PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu", "PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig", "RUST_BACKTRACE=full", "PKG_CONFIG_ALLOW_SYSTEM_LIBS=0","PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=0","PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig"] +#passthrough = ["PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig"] +# If you run the build on your local machine, +# You need to add pkg-config:$CROSS_DEB_ARCH to the apt-get install command below [target.x86_64-unknown-linux-gnu] xargo = false pre-build = [ "dpkg --add-architecture $CROSS_DEB_ARCH && apt-get update --fix-missing && apt-get install --assume-yes libxcb1-dev:$CROSS_DEB_ARCH libdbus-1-dev:$CROSS_DEB_ARCH", ] - -[target.aarch64-apple-darwin.env] -passthrough = ["CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG=true","BACKTRACE=full"] - diff --git a/Cross.toml.bk b/Cross.toml.bk deleted file mode 100644 index c0eb13b06..000000000 --- a/Cross.toml.bk +++ /dev/null @@ -1,80 +0,0 @@ -# BUILD -# ----- -# Set build configurations for all targets. - -#[build] -## Use xargo when cross-compiling for targets without a pre-built -## standard library. Prefer `build-std` for most targets. This -## requires nightly. -#xargo = true -## Use `-Zbuild-std` when cross-compiling for targets without a -## pre-built standard library. This overrides `xargo`: if enabled, -## `xargo` will not be used. -#build-std = true -## Default target to build if the target is not provided via -## `--target` or `CARGO_BUILD_TARGET`. -#default-target = "x86_64-unknown-linux-gnu" -## Additional commands to run prior to building the package. -## These are translated into RUN commands to add to the Docker -## image prior to running cross. -#pre-build = [ -# "dpkg --add-architecture $CROSS_DEB_ARCH", -# "apt-get update && apt-get install --assume-yes libssl-dev:$CROSS_DEB_ARCH" -#] -## A custom Dockerfile to use for all targets. This can be -## provided as a struct or string. See below for a target -## for the struct variant. Both pre-build hooks can a custom -## Dockerfile can be provided: the pre-build hooks will be added -## to the end of the Dockerfile. -#dockerfile = "Dockerfile" -# -## BUILD ENVIRONMENT -## ----------------- -## Set the build environment for all targets. -# -#[build.env] -## Volumes to be mounted, passed via the value of an environment -## variable. These will be passed to the container both as -## a mountpoint and an environment variable. For example, the -## path to `VOL2_ARG` will be available as `$VOL2_ARG`, and -## the path will be mounted at `/path/to/volume`. -## A value for the environment variable containing the -## path to the volume can provided. -#volumes = ["VOL1_ARG", "VOL2_ARG=/path/to/volume"] -## Environment variables to be passed through to the container. -## A value for the environment variable can provided. -#passthrough = ["VAR1_ARG", "VAR2_ARG=VALUE"] - -# TARGET -# ------ -# Set build configurations for a single target. These -# values override those present in `[build]`. - -[target.aarch64-unknown-linux-gnu] -# Disable xargo for only `aarch64-unknown-linux-gnu`. -xargo = false -# Also disable `build-std` for `aarch64-unknown-linux-gnu`, -# since it already has a std library pre-built. -#build-std = true -# An optional runner to override the default runner, -# for example, allowing the use of Qemu or a native -# runner for binaries. Defaults to `qemu-user` for -# non-native binaries, or `native` for native binaries. -#runner = "qemu-user" -# A custom Docker image for `cross` to execute the build -# commands in. This image must be pre-built and will override -# the pre-build hooks. -#image = "repository:tag" -# Additional commands to run prior to building the package. -# These override the commands present in `[build]`: they -# will not merge. -#linker = "aarch64-linux-gnu-ld" -pre-build = [ - "dpkg --add-architecture $CROSS_DEB_ARCH && apt-get update --fix-missing && apt-get install --assume-yes libssl-dev:$CROSS_DEB_ARCH libxcb1-dev:$CROSS_DEB_ARCH libdbus-1-dev:$CROSS_DEB_ARCH pkg-config:$CROSS_DEB_ARCH && ln -s /usr/include/aarch64-linux-gnu/openssl/opensslconf.h /usr/include/openssl/opensslconf.h && ln -s /usr/include/aarch64-linux-gnu/openssl/configuration.h /usr/include/openssl/configuration.h && echo 'export LIBRARY_PATH=/usr/lib/aarch64-linux-gnu:$LIBRARY_PATH' >> /etc/profile && echo 'export LD_LIBRARY_PATH=/usr/lib/aarch64-linux-gnu:$LD_LIBRARY_PATH' >> /etc/profile && . /etc/profile", -# "dpkg --add-architecture $CROSS_DEB_ARCH", -# "apt-get update && apt-get install --assume-yes openssl:$CROSS_DEB_ARCH libssl-dev:$CROSS_DEB_ARCH libxcb1-dev:$CROSS_DEB_ARCH libdbus-1-dev:$CROSS_DEB_ARCH", -# "ln -s /usr/include/aarch64-linux-gnu/openssl/opensslconf.h /usr/include/openssl/opensslconf.h", -] - -[target.aarch64-unknown-linux-gnu.env] -passthrough = ["CROSS_DEBUG=true","PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig", "LIBRARY_PATH=/usr/lib/aarch64-linux-gnu", "LD_LIBRARY_PATH=/usr/lib/aarch64-linux-gnu"] diff --git a/docs/run_cross_local.md b/docs/run_cross_local.md new file mode 100644 index 000000000..a0ed1fdc3 --- /dev/null +++ b/docs/run_cross_local.md @@ -0,0 +1,92 @@ +# Instructions for running cross to test release builds locally + +## Prerequisites +Before start, check the comments in `Cross.toml` to turn on some commented configs for the target you want to build. + +## Targets +### aarch64-unknown-linux-gnu + +#### Build release +```sh +CROSS_BUILD_OPTS="--platform linux/amd64 --no-cache" CROSS_CONTAINER_OPTS="--platform linux/amd64" cross build --release --target aarch64-unknown-linux-gnu +``` + +#### Inspect container created by cross for debugging +```sh +docker run --platform linux/amd64 -it /bin/bash +``` + +#### Testing the build + +1. download docker image for testing environment +```sh +docker run --rm --privileged multiarch/qemu-user-static --reset -p yes +docker pull arm64v8/ubuntu +``` +2. run the container +pwd is the directory contains the binary built in the previous step on your host machine +```sh +docker run -v $(pwd):/app -it arm64v8/ubuntu /bin/bash +``` + +3. install dependencies in the container and set up api testing environment +```sh +apt update +apt install libxcb1 libxcb1-dev libdbus-1-3 nvi +mkdir -p ~/.config/goose +# create goose config file +# set api key env variable +``` + +### x86_64-unknown-linux-gnu + +#### build release +```sh +CROSS_BUILD_OPTS="--platform linux/amd64 --no-cache" CROSS_CONTAINER_OPTS="--platform linux/amd64" cross build --release --target x86_64-unknown-linux-gnu +``` +#### inspect container created by cross for debugging +```sh +docker run --platform linux/amd64 -it /bin/bash +``` + +#### testing the build + +1. Download docker image for testing environment +```sh +docker run --rm --privileged multiarch/qemu-user-static --reset -p yes +docker pull --platform linux/amd64 debian:latest +``` + +2. Run the container +pwd is the directory contains the binary built in the previous step on your host machine +```sh +docker run -it -v "$(pwd)":/app debian:latest /bin/bash +``` + +3. Install dependencies in the container and set up api testing environment +```sh +apt update +apt install libxcb1 libxcb1-dev libdbus-1-3 nvi +mkdir -p ~/.config/goose +# create goose config file +# set api key env variable +``` + +### aarch64-apple-darwin + +#### build release +```sh +cross build --release --target aarch64-apple-darwin +``` + +There is no docker image available for aarch64-apple-darwin. It will fall back to your host machine for building the binary if your host machine matches. + +### x86_64-apple-darwin + +#### build release +```sh +cross build --release --target x86_64-apple-darwin +``` + +There is no docker image available for x86_64-apple-darwin. It will fall back to your host machine for building the binary if your host machine matches. + From 13d28c7a48c05c172c0d3fddd7d2cb1d909cd4de Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Sat, 21 Dec 2024 08:16:41 +1100 Subject: [PATCH 36/43] reverted tag pattern change --- .github/workflows/cli-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index d58cd7e22..a3f51d36c 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -1,7 +1,7 @@ on: push: tags: - - "v_lifei.*" + - "v1.*" workflow_dispatch: concurrency: From b29ec3700d7c9fdb490dc634597fdcd7caa25209 Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Sat, 21 Dec 2024 08:23:45 +1100 Subject: [PATCH 37/43] changed toolchain in build --- .github/workflows/cli-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index a3f51d36c..1b04eeb77 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -30,7 +30,7 @@ jobs: uses: actions/checkout@v4 - name: Set up Rust toolchain - uses: actions-rs/toolchain@v1 + uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable From 66a3a726d0e8e9d41faf31e7effe4ed9388ef395 Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Sat, 21 Dec 2024 08:25:15 +1100 Subject: [PATCH 38/43] final testing --- .github/workflows/cli-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 1b04eeb77..77e611cc1 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -1,7 +1,7 @@ on: push: tags: - - "v1.*" + - "v_lifei.*" workflow_dispatch: concurrency: From 04f5212656b374da4a781c52dc8e428da9f0e875 Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Sat, 21 Dec 2024 08:36:52 +1100 Subject: [PATCH 39/43] revert the toolchain change --- .github/workflows/cli-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 77e611cc1..d58cd7e22 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -30,7 +30,7 @@ jobs: uses: actions/checkout@v4 - name: Set up Rust toolchain - uses: actions-rust-lang/setup-rust-toolchain@v1 + uses: actions-rs/toolchain@v1 with: toolchain: stable From efb6e1a3be37c997ca02ecf7e6aebd9cf3426ab7 Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Sat, 21 Dec 2024 08:45:27 +1100 Subject: [PATCH 40/43] update the doc --- docs/run_cross_local.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/run_cross_local.md b/docs/run_cross_local.md index a0ed1fdc3..baf48720b 100644 --- a/docs/run_cross_local.md +++ b/docs/run_cross_local.md @@ -60,7 +60,7 @@ docker pull --platform linux/amd64 debian:latest 2. Run the container pwd is the directory contains the binary built in the previous step on your host machine ```sh -docker run -it -v "$(pwd)":/app debian:latest /bin/bash +docker run --platform linux/amd64 -it -v "$(pwd)":/app debian:latest /bin/bash ``` 3. Install dependencies in the container and set up api testing environment From c258cc3c11e359bdfe04a7a9df819e6217c89fd8 Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Sat, 21 Dec 2024 08:47:04 +1100 Subject: [PATCH 41/43] reverted the trigger tag pattern --- .github/workflows/cli-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index d58cd7e22..a3f51d36c 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -1,7 +1,7 @@ on: push: tags: - - "v_lifei.*" + - "v1.*" workflow_dispatch: concurrency: From d4d0f827f1f50652523a8dea6ebf061028e9ce81 Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Sat, 21 Dec 2024 09:08:09 +1100 Subject: [PATCH 42/43] update the doc --- docs/run_cross_local.md | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/docs/run_cross_local.md b/docs/run_cross_local.md index baf48720b..6c22a101f 100644 --- a/docs/run_cross_local.md +++ b/docs/run_cross_local.md @@ -16,20 +16,20 @@ CROSS_BUILD_OPTS="--platform linux/amd64 --no-cache" CROSS_CONTAINER_OPTS="--pla docker run --platform linux/amd64 -it /bin/bash ``` -#### Testing the build +#### Testing the binary -1. download docker image for testing environment +1. Download docker image for testing environment ```sh docker run --rm --privileged multiarch/qemu-user-static --reset -p yes docker pull arm64v8/ubuntu ``` -2. run the container +2. Run the container pwd is the directory contains the binary built in the previous step on your host machine ```sh docker run -v $(pwd):/app -it arm64v8/ubuntu /bin/bash ``` -3. install dependencies in the container and set up api testing environment +3. Install dependencies in the container and set up api testing environment ```sh apt update apt install libxcb1 libxcb1-dev libdbus-1-3 nvi @@ -40,7 +40,7 @@ mkdir -p ~/.config/goose ### x86_64-unknown-linux-gnu -#### build release +#### Build release ```sh CROSS_BUILD_OPTS="--platform linux/amd64 --no-cache" CROSS_CONTAINER_OPTS="--platform linux/amd64" cross build --release --target x86_64-unknown-linux-gnu ``` @@ -49,7 +49,7 @@ CROSS_BUILD_OPTS="--platform linux/amd64 --no-cache" CROSS_CONTAINER_OPTS="--pla docker run --platform linux/amd64 -it /bin/bash ``` -#### testing the build +#### Testing the binary 1. Download docker image for testing environment ```sh @@ -78,9 +78,14 @@ mkdir -p ~/.config/goose ```sh cross build --release --target aarch64-apple-darwin ``` - There is no docker image available for aarch64-apple-darwin. It will fall back to your host machine for building the binary if your host machine matches. +#### testing the build +If the binary is signed with a certificate, run +```sh +xattr -d com.apple.quarantine goose +```` + ### x86_64-apple-darwin #### build release @@ -90,3 +95,16 @@ cross build --release --target x86_64-apple-darwin There is no docker image available for x86_64-apple-darwin. It will fall back to your host machine for building the binary if your host machine matches. +#### testing the build +1. If the binary is signed with a certificate, run +```sh +xattr -d com.apple.quarantine goose +```` +2. If you are on Apple Silicon (ARM), you can use Rosetta to test the binary +```sh +softwareupdate --install-rosetta # make sure Rosetta 2 is installed +``` + +```sh +arch -x86_64 ./goose help +``` \ No newline at end of file From 24cc7cba6b13e2d62a67bc8390c22c8b8bceb0b2 Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Sat, 21 Dec 2024 09:21:48 +1100 Subject: [PATCH 43/43] used correct build name --- .github/workflows/cli-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index a3f51d36c..4ae606433 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -12,7 +12,7 @@ name: Release CLI jobs: build: - name: Build ${{ matrix.architecture }}-${{ matrix.target-suffix }} + name: Build ${{ matrix.os }}-${{ matrix.architecture }} runs-on: ${{ matrix.os }} strategy: fail-fast: false