Skip to content

Add a Rust toolchain for v1.28.0 - #29

Merged
sjoelund merged 1 commit into
mainfrom
rust-toolchain
Sep 25, 2026
Merged

sjoelund merged 1 commit into
mainfrom
rust-toolchain

Conversation

@sjoelund

Copy link
Copy Markdown
Member

The FMUs of OpenModelica 1.28.0 link a Rust simulation runtime, which a source-code FMU builds with cargo. The v1.27.0 image has no cargo, so cross-compiling such an FMU stops at configure time.

The image now installs rustup 1.29.1 (checksum verified) with a pinned Rust 1.98.1 and a target for every toolchain file:

Toolchain file Rust target
i686-linux-gnu i686-unknown-linux-gnu
x86_64-linux-gnu x86_64-unknown-linux-gnu
aarch64-linux-gnu aarch64-unknown-linux-gnu
arm-linux-gnueabi armv5te-unknown-linux-gnueabi
arm-linux-gnueabihf armv7-unknown-linux-gnueabihf
i686-w64-mingw32 i686-pc-windows-gnu
x86_64-w64-mingw32 x86_64-pc-windows-gnu

Each toolchain file sets OM_RUST_TARGET_TRIPLE (a cache variable, so -D overrides it), which the FMU's CMake hands to cargo --target, and the image sets CARGO_TARGET_<triple>_LINKER to the matching gcc. RUSTUP_HOME/CARGO_HOME are world-writable, as in the official rust image, because OpenModelica runs the image with --user.

The toolchain files are copied last, so editing one no longer reinstalls every package.

Assisted-by: Claude Opus 5.5

The FMUs of OpenModelica 1.28.0 link a Rust simulation runtime, which a
source-code FMU builds with cargo. The v1.27.0 image has no cargo, so
cross-compiling such an FMU stops at configure time.

The image now installs rustup 1.29.1 (checksum verified) with a pinned
Rust 1.98.1 and a target for every toolchain file:

| Toolchain file      | Rust target                   |
| ------------------- | ----------------------------- |
| i686-linux-gnu      | i686-unknown-linux-gnu        |
| x86_64-linux-gnu    | x86_64-unknown-linux-gnu      |
| aarch64-linux-gnu   | aarch64-unknown-linux-gnu     |
| arm-linux-gnueabi   | armv5te-unknown-linux-gnueabi |
| arm-linux-gnueabihf | armv7-unknown-linux-gnueabihf |
| i686-w64-mingw32    | i686-pc-windows-gnu           |
| x86_64-w64-mingw32  | x86_64-pc-windows-gnu         |

Each toolchain file sets `OM_RUST_TARGET_TRIPLE` (a cache variable, so
`-D` overrides it), which the FMU's CMake hands to `cargo --target`, and
the image sets `CARGO_TARGET_<triple>_LINKER` to the matching gcc.
`RUSTUP_HOME`/`CARGO_HOME` are world-writable, as in the official rust
image, because OpenModelica runs the image with `--user`.

The toolchain files are copied last, so editing one no longer reinstalls
every package.

Assisted-by: Claude Opus 5.5
@sjoelund
sjoelund merged commit be7afd9 into main Sep 25, 2026
11 checks passed
@sjoelund
sjoelund deleted the rust-toolchain branch September 25, 2026 06:34
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 this pull request may close these issues.

1 participant