Skip to content

Conversation

@Xerner
Copy link
Contributor

@Xerner Xerner commented Aug 1, 2025

The previous installation of the rust toolchain was done inside the Dockerfile. Docker has no knowledge of the host architecture and OS while it is building containers. Therefore, I moved the installation outside of the Dockerfile and into the a bash function that is called in the post-create.sh script.

If using the Dev Containers extension in VS Code, the post-create.sh script is ran immediately after the container is created by VS Code, and installs the rust toolchain for your current hosts architecture and OS. It also adds the architecture and OS as a rust build target

For example, I am running WSL with an x86-64 architecture so it performed the following actions immediately after the Docker container built

  • ran rustup target add x86_64-unknown-linux-gnu
  • ran rustup toolchain install stable-x86_64-unknown-linux-gnu

I believe this is further proof the install succeeded as I was able to run all unit tests for this repo
image

@Xerner Xerner force-pushed the added-dynamic-rust-toolchain-installation branch from dfd0efd to dd27240 Compare August 1, 2025 04:12
Copy link
Contributor

@AnotherDaniel AnotherDaniel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff, thank you!

I've added one thought wrt the MacOS workaround that I've originally added...


#region sudo stuff

# This is a workaround which is againt necessary on MacOS 14.0, it looks like this bug is back:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't looked into details at all, and didn't test-run this myself, yet, but: if we now know our $ARCH_AND_OS, might it make sense to only run this workaround section when on MacOS? Could that be done? ...
I'll be able to actually test maybe later today, latest early next week.

Copy link
Contributor Author

@Xerner Xerner Aug 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the script and wrapped the Mac workaround stuff with what I think is a Mac OS check (based on google searching)

@AnotherDaniel AnotherDaniel added the enhancement New feature or request label Aug 1, 2025
Copy link
Contributor

@AnotherDaniel AnotherDaniel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on my Machine (Mac), looking good!

@AnotherDaniel AnotherDaniel merged commit b277336 into eclipse-uprotocol:main Aug 4, 2025
1 check passed
AnotherDaniel added a commit to eclipse-uprotocol/up-subscription-rust that referenced this pull request Aug 15, 2025
…ty (#30)

Dynamic install of rust toolchain based on host arch and OS (as has been done in eclipse-uprotocol/up-rust#275)

* dynamic install of rust toolchain based on host arch and OS
* wrap mac workaround script in OS check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants