From 91d5f637ff3260b52a780ec7fb81a72c0159f9c7 Mon Sep 17 00:00:00 2001 From: devkelley <105753233+devkelley@users.noreply.github.com> Date: Thu, 14 Mar 2024 10:54:12 -0700 Subject: [PATCH] Fix multiplatform amd image (#85) * Add multi images and update Rust version to 1.74 * fixed links to files * Downgrade markdown link check version to fix regression causing failure * Add container specific config.toml to fix library error while leaving local build untouched * Add multi images and update Rust version to 1.74 * fixed links to files * Add container specific config.toml to fix library error while leaving local build untouched --- Dockerfile.multi | 2 ++ Dockerfile_integrated.multi | 2 ++ container/cargo/config.toml | 15 +++++++++++++++ pub-sub-service/Cargo.toml | 2 +- 4 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 container/cargo/config.toml diff --git a/Dockerfile.multi b/Dockerfile.multi index bd2ca5f..fc9bdfe 100644 --- a/Dockerfile.multi +++ b/Dockerfile.multi @@ -25,6 +25,8 @@ WORKDIR /sdv COPY ./ . +COPY ./container/cargo/config.toml ./.cargo/config.toml + # Check that APP_NAME argument is valid. RUN /sdv/container/scripts/argument_sanitizer.sh \ --arg-value "${APP_NAME}" \ diff --git a/Dockerfile_integrated.multi b/Dockerfile_integrated.multi index 25aa4dc..58b289d 100644 --- a/Dockerfile_integrated.multi +++ b/Dockerfile_integrated.multi @@ -25,6 +25,8 @@ WORKDIR /sdv COPY ./ . +COPY ./container/cargo/config.toml ./.cargo/config.toml + # Check that APP_NAME argument is valid. RUN /sdv/container/scripts/argument_sanitizer.sh \ --arg-value "${APP_NAME}" \ diff --git a/container/cargo/config.toml b/container/cargo/config.toml new file mode 100644 index 0000000..4628343 --- /dev/null +++ b/container/cargo/config.toml @@ -0,0 +1,15 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT license. +# SPDX-License-Identifier: MIT + +[env] +AGEMO_HOME = { value = ".agemo", relative = true } +AGEMO_SAMPLES_HOME = { value = ".agemo-samples", relative = true } + +[target.aarch64-unknown-linux-gnu] +linker = "aarch64-linux-gnu-gcc" +rustflags = [ "-C", "target-feature=+crt-static", "-C", "link-arg=-lgcc" ] + +[target.x86_64-unknown-linux-gnu] +linker = "x86_64-linux-gnu-gcc" +rustflags = [ "-C", "target-feature=+crt-static", "-C", "link-arg=-lgcc" ] diff --git a/pub-sub-service/Cargo.toml b/pub-sub-service/Cargo.toml index f2410fc..9484ca9 100644 --- a/pub-sub-service/Cargo.toml +++ b/pub-sub-service/Cargo.toml @@ -31,5 +31,5 @@ url = { workspace = true } uuid = { workspace = true, features = [ "v4", "fast-rng", "macro-diagnostics"] } yaml-rust = { workspace = true } -[target.'cfg(target_arch = "aarch64")'.dependencies] +[target.'cfg(any(target_arch = "aarch64", target_arch = "x86_64"))'.dependencies] paho-mqtt = { workspace = true, features = ["vendored-ssl"] }