-
Notifications
You must be signed in to change notification settings - Fork 98
Enable bzlmod upstream #1179
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
base: main
Are you sure you want to change the base?
Enable bzlmod upstream #1179
Conversation
add --noincompatible_disallow_empty_glob so empty globs dont error in bzlmod export CARGO_HOME=/tmp/cargo so bindgen download succeed in sandbox ensure the bindgen/cbindgen repos are imported configure crate_universe using the crate module extension with the same manifest as before so rust dependencies keep working under bzlmod add bazel/extensions.bzl for bindgen and cbindgen. This lets MODULE.bazel instantiate those components via use_extension. update memory_mapping_tests.rs so that it works with sandboxed filesystem. Signed-off-by: Nicolae Dicu <[email protected]>
Signed-off-by: Nicolae Dicu <[email protected]>
0b50860 to
a62e595
Compare
dkroenke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution! There are only minor remarks to do.
I will next review eclipse-iceoryx/iceoryx#2505 which needs to be merged first.
| # ******************************************************************************* | ||
| # Copyright (c) 2025 Contributors to the Eclipse Foundation | ||
| # | ||
| # See the NOTICE file(s) distributed with this work for additional | ||
| # information regarding copyright ownership. | ||
| # | ||
| # This program and the accompanying materials are made available under the | ||
| # terms of the Apache License Version 2.0 which is available at | ||
| # https://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # ******************************************************************************* No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make the preflight-check pass:
| # ******************************************************************************* | |
| # Copyright (c) 2025 Contributors to the Eclipse Foundation | |
| # | |
| # See the NOTICE file(s) distributed with this work for additional | |
| # information regarding copyright ownership. | |
| # | |
| # This program and the accompanying materials are made available under the | |
| # terms of the Apache License Version 2.0 which is available at | |
| # https://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # SPDX-License-Identifier: Apache-2.0 | |
| # ******************************************************************************* | |
| # Copyright (c) 2025 Contributors to the Eclipse Foundation | |
| # | |
| # See the NOTICE file(s) distributed with this work for additional | |
| # information regarding copyright ownership. | |
| # | |
| # This program and the accompanying materials are made available under the | |
| # terms of the Apache Software License 2.0 which is available at | |
| # https://www.apache.org/licenses/LICENSE-2.0, or the MIT license | |
| # which is available at https://opensource.org/licenses/MIT. | |
| # | |
| # SPDX-License-Identifier: Apache-2.0 OR MIT |
| # ******************************************************************************* | ||
| # Copyright (c) 2025 Contributors to the Eclipse Foundation | ||
| # | ||
| # See the NOTICE file(s) distributed with this work for additional | ||
| # information regarding copyright ownership. | ||
| # | ||
| # This program and the accompanying materials are made available under the | ||
| # terms of the Apache License Version 2.0 which is available at | ||
| # https://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # ******************************************************************************* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make the preflight-check pass:
| # ******************************************************************************* | |
| # Copyright (c) 2025 Contributors to the Eclipse Foundation | |
| # | |
| # See the NOTICE file(s) distributed with this work for additional | |
| # information regarding copyright ownership. | |
| # | |
| # This program and the accompanying materials are made available under the | |
| # terms of the Apache License Version 2.0 which is available at | |
| # https://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # SPDX-License-Identifier: Apache-2.0 | |
| # ******************************************************************************* | |
| # Copyright (c) 2025 Contributors to the Eclipse Foundation | |
| # | |
| # See the NOTICE file(s) distributed with this work for additional | |
| # information regarding copyright ownership. | |
| # | |
| # This program and the accompanying materials are made available under the | |
| # terms of the Apache Software License 2.0 which is available at | |
| # https://www.apache.org/licenses/LICENSE-2.0, or the MIT license | |
| # which is available at https://opensource.org/licenses/MIT. | |
| # | |
| # SPDX-License-Identifier: Apache-2.0 OR MIT |
| build --noincompatible_disallow_empty_glob | ||
|
|
||
| build --action_env=CARGO_BAZEL_REPIN=true | ||
| build --action_env=CARGO_HOME=/tmp/cargo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is normally not needed.
| build --action_env=CARGO_HOME=/tmp/cargo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this file should more express what is inside (definitions of dependencies for building iceoryx2).
What about naming it iceoryx2_deps.bzl?
| ############################################################################### | ||
| module( | ||
| name = "iceoryx2", | ||
| version = "0.1.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| version = "0.1.0", | |
| version = "0.7.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script to update the iceoryx2 version also needs to be adjusted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add something like this to internal/scripts/update_versions.sh line 152:
sed -i -z 's/name = "iceoryx2",\n version = "'"${OLD_VERSION}"'"/name = "iceoryx2",\n version = "'"${NEW_VERSION}"'"/g' \
MODULE.bazel
| git_override( | ||
| module_name = "iceoryx", | ||
| commit = "6760c0088c61e8bf68070e2d163a37caab7515b1", | ||
| remote = "https://github.com/qorix-group/iceoryx.git", | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to change this to upstream once eclipse-iceoryx/iceoryx#2505 got merged
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once #301 is completed, likely in the next two weeks, this is superfluous and can be removed.
| def _iceoryx2_extra_deps(): | ||
| maybe( | ||
| repo_rule = http_archive, | ||
| name = "bindgen", | ||
| sha256 = "b7e2321ee8c617f14ccc5b9f39b3a804db173ee217e924ad93ed16af6bc62b1d", | ||
| strip_prefix = "bindgen-cli-x86_64-unknown-linux-gnu", | ||
| urls = ["https://github.com/rust-lang/rust-bindgen/releases/download/v0.69.5/bindgen-cli-x86_64-unknown-linux-gnu.tar.xz"], | ||
| build_file_content = """ | ||
| filegroup( | ||
| name = "bindgen-cli", | ||
| srcs = ["bindgen"], | ||
| visibility = ["//visibility:public"], | ||
| ) | ||
| """, | ||
| ) | ||
| maybe( | ||
| repo_rule = http_file, | ||
| name = "cbindgen", | ||
| sha256 = "521836d00863cb129283054e5090eb17563614e6328b7a1610e30949a05feaea", | ||
| urls = ["https://github.com/mozilla/cbindgen/releases/download/0.26.0/cbindgen"], | ||
| executable = True, | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional: We could make the version numbers better configurable.
| def _iceoryx2_extra_deps(): | |
| maybe( | |
| repo_rule = http_archive, | |
| name = "bindgen", | |
| sha256 = "b7e2321ee8c617f14ccc5b9f39b3a804db173ee217e924ad93ed16af6bc62b1d", | |
| strip_prefix = "bindgen-cli-x86_64-unknown-linux-gnu", | |
| urls = ["https://github.com/rust-lang/rust-bindgen/releases/download/v0.69.5/bindgen-cli-x86_64-unknown-linux-gnu.tar.xz"], | |
| build_file_content = """ | |
| filegroup( | |
| name = "bindgen-cli", | |
| srcs = ["bindgen"], | |
| visibility = ["//visibility:public"], | |
| ) | |
| """, | |
| ) | |
| maybe( | |
| repo_rule = http_file, | |
| name = "cbindgen", | |
| sha256 = "521836d00863cb129283054e5090eb17563614e6328b7a1610e30949a05feaea", | |
| urls = ["https://github.com/mozilla/cbindgen/releases/download/0.26.0/cbindgen"], | |
| executable = True, | |
| ) | |
| BINDGEN_VERSION = "v0.69.5" | |
| CBINDGEN_VERSION = "0.26.0" | |
| def _iceoryx2_extra_deps(): | |
| maybe( | |
| repo_rule = http_archive, | |
| name = "bindgen", | |
| sha256 = "b7e2321ee8c617f14ccc5b9f39b3a804db173ee217e924ad93ed16af6bc62b1d", | |
| strip_prefix = "bindgen-cli-x86_64-unknown-linux-gnu", | |
| urls = ["https://github.com/rust-lang/rust-bindgen/releases/download/{version}/bindgen-cli-x86_64-unknown-linux-gnu.tar.xz".format(version = BINDGEN_VERSION)], | |
| build_file_content = """ | |
| filegroup( | |
| name = "bindgen-cli", | |
| srcs = ["bindgen"], | |
| visibility = ["//visibility:public"], | |
| ) | |
| """, | |
| ) | |
| maybe( | |
| repo_rule = http_file, | |
| name = "cbindgen", | |
| sha256 = "521836d00863cb129283054e5090eb17563614e6328b7a1610e30949a05feaea", | |
| urls = ["https://github.com/mozilla/cbindgen/releases/download/{version}/cbindgen".format(version = CBINDGEN_VERSION)], | |
| executable = True, | |
| ) |
|
Would you add an entry in |
@dkroenke, thank you for all the points, they are helpful. I will start addressing them. |
| bazel_dep(name = "platforms", version = "0.0.11") | ||
| bazel_dep(name = "rules_cc", version = "0.1.1") | ||
| bazel_dep(name = "rules_rust", version = "0.58.0") | ||
| bazel_dep(name = "iceoryx", version = "2.95.7") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nicu1989 We are currently in the process of copying the needed parts from iceoryx_hoofs to iceoryx2 so that this dependency can be omitted.
I would propose that we wait with this PR until it is done so that we do not need to merge eclipse-iceoryx/iceoryx#2505. Would this be feasible?
CC @elBoberido
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See also #1179 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dkroenke @elBoberido I think we can wait if it is only few weeks . But will reduce a lot of integration effort(with different os and versions) for us once we have it as early as possible.
Notes for Reviewer
Pre-Review Checklist for the PR Author
Convert to draft)SPDX-License-Identifier: Apache-2.0 OR MITiox2-123-introduce-posix-ipc-example)[#123] Add posix ipc example)task-list-completed)Checklist for the PR Reviewer
Post-review Checklist for the PR Author
References
Closes #