Skip to content

Commit

Permalink
linux are completed
Browse files Browse the repository at this point in the history
  • Loading branch information
lifeizhou-ap committed Dec 20, 2024
1 parent a786e10 commit 16a4a7e
Show file tree
Hide file tree
Showing 4 changed files with 156 additions and 3 deletions.
67 changes: 67 additions & 0 deletions Cross.toml
Original file line number Diff line number Diff line change
@@ -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",
]

80 changes: 80 additions & 0 deletions Cross.toml.bk
Original file line number Diff line number Diff line change
@@ -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"]
5 changes: 4 additions & 1 deletion crates/goose-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"

7 changes: 5 additions & 2 deletions crates/goose/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand All @@ -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"
Expand Down Expand Up @@ -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"

0 comments on commit 16a4a7e

Please sign in to comment.