Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Proxy module can't be build with included build.sh #7368

Open
samuliHeikkinen opened this issue Sep 12, 2024 · 5 comments · May be fixed by #7390
Open

API Proxy module can't be build with included build.sh #7368

samuliHeikkinen opened this issue Sep 12, 2024 · 5 comments · May be fixed by #7390

Comments

@samuliHeikkinen
Copy link

Expected Behavior

Running ./edge-modules/api-proxy-module/build.sh should build the module.

Current Behavior

After running the script it fails to OS Error 13 when trying to create a tmp file to /opt/rust/rustup

Steps to Reproduce

Provide a detailed set of steps to reproduce the bug.

  1. Checkout iotedge repo
  2. Run ./edge-modules/api-proxy-module/build.sh from the repository root

Device Information

  • Host OS: WSL 2 Ubuntu 22.04:
  • Architecture: amd64:

Logs

Additional Information

This is due to build.sh using ekidd/rust-musl-builder without a version tag which defaults to latest which in turn has had massive changes (remove of ARM support).

@david-emakenemi
Copy link

Hey @samuliHeikkinen , can you share the logs for the Edge Hub and Edge Agent? Please make sure to redact any sensitive info. cc @nlcamp

@samuliHeikkinen
Copy link
Author

Hey @david-emakenemi , you mean info of the running containers or the builds? As per repo, the API Proxy module should be able to be compiled without compiling the whole project.

This build issue also blocks the use of custom nginx config as the desired properties way won't work because template is over 4096 bytes while encoded to BASE64 which is over the maximum for desired property tags.

@samuliHeikkinen
Copy link
Author

It is also worth mentioning that https://github.com/emk/rust-musl-builder which is used as the base for the module image for amd64 is effectively unmaintained.

@samuliHeikkinen
Copy link
Author

Workaround for this is to build the ApiProxyModule first with ./scripts/linux/buildAPIProxy.sh so even though the ./edge-modules/api-proxy-module/build.sh still fails with the rust container to permissions, the build succeeds as we build it before.

@nlcamp
Copy link
Contributor

nlcamp commented Oct 29, 2024

@samuliHeikkinen - The following diff should fix the issue:

$ git diff
diff --git a/edge-modules/api-proxy-module/build.sh b/edge-modules/api-proxy-module/build.sh
index 7d037501f..d18bb5042 100755
--- a/edge-modules/api-proxy-module/build.sh
+++ b/edge-modules/api-proxy-module/build.sh
@@ -88,7 +88,7 @@ echo ${PROJECT_ROOT}
 
 if [[ "$ARCH" == "amd64" ]]; then
 set +e
-docker run --rm -it -v "${PROJECT_ROOT}":/home/rust/src ekidd/rust-musl-builder cargo build --release --manifest-path /home/rust/src/edge-modules/api-proxy-module/Cargo.toml
+../../scripts/linux/cross-platform-rust-build.sh --os alpine --arch $ARCH --build-path edge-modules/api-proxy-module
 set -e
 
 cp -r ./templates/ ./docker/linux/amd64

I'll make the change in a PR shortly.

@nlcamp nlcamp linked a pull request Nov 5, 2024 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants