Skip to content

Add rust toolchain to fix rustfmt crosscompilation error#38

Open
schreibwsag wants to merge 5 commits into
eclipse-score:mainfrom
schreibwsag:fb_rustfmt
Open

Add rust toolchain to fix rustfmt crosscompilation error#38
schreibwsag wants to merge 5 commits into
eclipse-score:mainfrom
schreibwsag:fb_rustfmt

Conversation

@schreibwsag
Copy link
Copy Markdown
Contributor

bazel build //... --config=target_config_3 leads to the following error:

ERROR: Analysis of target '//:format.fix_Rust_with_rustfmt' failed; build aborted: Analysis failed

bazel fails to find a suitable rust toolchain when crosscompiling.

Fix: register rust toolchains in MODULE.bazel (taken over from inc_security_crypto_valeo_pitch)

Signed-off-by: Werner Schreiber <werner.schreiber@mail.schaeffler.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 27, 2026

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run --lockfile_mode=error //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
2026/05/28 21:39:58 Downloading https://releases.bazel.build/8.3.0/release/bazel-8.3.0-linux-x86_64...
Extracting Bazel installation...
Starting local Bazel server (8.3.0) and connecting to it...
INFO: Invocation ID: 95702fd9-c9a9-47fe-a683-70f481354bb8
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
DEBUG: Rule 'abseil-cpp+' indicated that a canonical reproducible form can be obtained by modifying arguments integrity = "sha256-m3oGQwXp/ZTRJP+mzDWFkutCtdpYj7TgfQklSqQAhts="
DEBUG: Repository abseil-cpp+ instantiated at:
  <builtin>: in <toplevel>
Repository rule http_archive defined at:
  /home/runner/.bazel/external/bazel_tools/tools/build_defs/repo/http.bzl:394:31: in <toplevel>
Computing main repo mapping: 
DEBUG: Rule 'protobuf+' indicated that a canonical reproducible form can be obtained by modifying arguments integrity = "sha256-w6Cp7OiTLjHDtzbi2xixxC5wcM2biBOIsm0BqnHiTKI="
DEBUG: Repository protobuf+ instantiated at:
  <builtin>: in <toplevel>
Repository rule http_archive defined at:
  /home/runner/.bazel/external/bazel_tools/tools/build_defs/repo/http.bzl:394:31: in <toplevel>
Computing main repo mapping: 
DEBUG: Rule 'grpc+' indicated that a canonical reproducible form can be obtained by modifying arguments integrity = "sha256-CvN7gAlTEwtHwHW1ZoPuYL3D7aPDf8YAQZP1tWl1ggQ="
DEBUG: Repository grpc+ instantiated at:
  <builtin>: in <toplevel>
Repository rule http_archive defined at:
  /home/runner/.bazel/external/bazel_tools/tools/build_defs/repo/http.bzl:394:31: in <toplevel>
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
WARNING: For repository 'score_bazel_platforms', the root module requires module version score_bazel_platforms@0.1.1, but got score_bazel_platforms@0.1.2 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'rules_cc', the root module requires module version rules_cc@0.2.16, but got rules_cc@0.2.17 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'flatbuffers', the root module requires module version flatbuffers@25.2.10, but got flatbuffers@25.12.19 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 1 packages loaded
Loading: 1 packages loaded
    currently loading: 
Loading: 1 packages loaded
    currently loading: 
WARNING: Target pattern parsing failed.
ERROR: Skipping '//:license-check': no such target '//:license-check': target 'license-check' not declared in package '' defined by /home/runner/work/inc_security_crypto/inc_security_crypto/BUILD
ERROR: no such target '//:license-check': target 'license-check' not declared in package '' defined by /home/runner/work/inc_security_crypto/inc_security_crypto/BUILD
INFO: Elapsed time: 16.559s
INFO: 0 processes.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target

@github-actions
Copy link
Copy Markdown

The created documentation from the pull request is available at: docu-html

@sunildevda sunildevda requested review from ChansAlive and OliverHeilwagen and removed request for ChansAlive May 28, 2026 13:03
@pahmann pahmann self-requested a review May 28, 2026 15:15
Comment thread MODULE.bazel Outdated
)

# *******************************************************************************
# Rust toolchains (partial takeover from inc_security_crypto_valeo_pitch
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Within other S-CORE modules rust toolchain is added in a different way.

Examples are:
https://github.com/eclipse-score/feo/blob/main/MODULE.bazel#L125
https://github.com/eclipse-score/persistency/blob/main/MODULE.bazel#L47
https://github.com/eclipse-score/baselibs_rust/blob/main/MODULE.bazel#L36

It makes sense to keep it aligned with the style of other repos unless there is a specific reason not to follow.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, it makes sense to keep it aligned with the style used in other repos. My intention
is to follow the baselib rust example. There is one reason why I did not do it yet: There
is a pitch by Valeo (https://github.com/Valeo-S-CORE-Organization/inc_security_crypto_valeo_pitch)
which will be pulled into this repo. I thought to make this easier, I take the rust toolchain
definition from the valeo repo. When this is pulled, we can change to the baselib_rust
style. Hope this is acceptable.

@schreibwsag
Copy link
Copy Markdown
Contributor Author

I updated the PR. Hope it is OK. Thank you for giving me the examples.

@schreibwsag
Copy link
Copy Markdown
Contributor Author

tidy + buildifier formatting applied, and all checks pass.

@schreibwsag schreibwsag requested a review from pahmann June 1, 2026 13:04
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.

4 participants