Skip to content

Commit 8909230

Browse files
authored
Explicitly specify versions on some dependent crates to make project buildable without Cargo.lock (#2082)
* explicit base64ct, jsonschema, pest, thiserror * fixed crate versions to make build work on 1.75 * add check without Cargo.loclk to ci * test without Cargo.lock on rust 1.75 only * fix for cargo machete check * pinned deps crate attempt * implicitly lock dependencies only when building in workspace * unnecessary changes removed * toml formatting fix * crate named zenoh-pinned-deps-1-75 * rustfmt
1 parent 07f5d89 commit 8909230

File tree

6 files changed

+151
-16
lines changed

6 files changed

+151
-16
lines changed

.github/workflows/ci.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,31 @@ jobs:
7474
- name: Check zenoh with rust 1.75.0
7575
run: cargo +1.75.0 check --release --bins --lib
7676

77+
# Test without Cargo.lock to ensure that all restrictions are correctly set in Cargo.toml for build with rust 1.75.0
78+
check_rust_without_cargo_lock:
79+
needs: determine-runner
80+
name: Check zenoh build without Cargo.lock on Rust 1.75
81+
runs-on: ubuntu-latest
82+
strategy:
83+
fail-fast: false
84+
85+
steps:
86+
- name: Clone this repository
87+
uses: actions/checkout@v4
88+
89+
- name: Update Rust 1.75.0 toolchain
90+
run: rustup update 1.75.0
91+
92+
- name: Setup rust-cache
93+
uses: Swatinem/rust-cache@v2
94+
with:
95+
cache-bin: false
96+
97+
- name: Check zenoh without Cargo.lock
98+
run: |
99+
rm Cargo.lock || true
100+
cargo +1.75.0 check --bins --lib
101+
77102
check:
78103
needs: determine-runner
79104
name: Lints and doc tests on ${{ matrix.os }}

Cargo.lock

Lines changed: 35 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ members = [
2222
"commons/zenoh-crypto",
2323
"commons/zenoh-keyexpr",
2424
"commons/zenoh-macros",
25+
"commons/zenoh-pinned-deps-1-75",
2526
"commons/zenoh-protocol",
2627
"commons/zenoh-result",
2728
"commons/zenoh-runtime",
@@ -227,6 +228,7 @@ zenoh-link-unixsock_stream = { version = "=1.5.0", path = "io/zenoh-links/zenoh-
227228
zenoh-link-vsock = { version = "=1.5.0", path = "io/zenoh-links/zenoh-link-vsock" }
228229
zenoh-link-ws = { version = "=1.5.0", path = "io/zenoh-links/zenoh-link-ws" }
229230
zenoh-macros = { version = "=1.5.0", path = "commons/zenoh-macros" }
231+
zenoh-pinned-deps = { version = "=1.5.0", path = "commons/zenoh-pinned-deps", default-features = false }
230232
zenoh-plugin-trait = { version = "=1.5.0", path = "plugins/zenoh-plugin-trait", default-features = false }
231233
zenoh-protocol = { version = "=1.5.0", path = "commons/zenoh-protocol", default-features = false }
232234
zenoh-result = { version = "=1.5.0", path = "commons/zenoh-result", default-features = false }
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#
2+
# Copyright (c) 2023 ZettaScale Technology
3+
#
4+
# This program and the accompanying materials are made available under the
5+
# terms of the Eclipse Public License 2.0 which is available at
6+
# http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
7+
# which is available at https://www.apache.org/licenses/LICENSE-2.0.
8+
#
9+
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
10+
#
11+
# Contributors:
12+
# ZettaScale Zenoh Team, <zenoh@zettascale.tech>
13+
#
14+
[package]
15+
authors = { workspace = true }
16+
categories = { workspace = true }
17+
description = "Internal crate for zenoh."
18+
edition = { workspace = true }
19+
homepage = { workspace = true }
20+
license = { workspace = true }
21+
name = "zenoh-pinned-deps-1-75"
22+
repository = { workspace = true }
23+
rust-version = { workspace = true }
24+
version = { workspace = true }
25+
26+
[badges]
27+
maintenance = { status = "actively-developed" }
28+
29+
[dependencies]
30+
base64ct = "=1.6.0"
31+
home = "=0.5.9"
32+
jsonschema = { version = "=0.20.0", default-features = false }
33+
lz4_flex = "=0.11.3"
34+
pest = "=2.7.12"
35+
pest_derive = "=2.7.12"
36+
pest_generator = "=2.7.12"
37+
pest_meta = "=2.7.12"
38+
static_init = "=1.0.3"
39+
thiserror = "=1.0.69"
40+
twox-hash = "=1.6.3"
41+
url = "=2.5.2"
42+
43+
[package.metadata.cargo-machete]
44+
ignored = [
45+
"base64ct",
46+
"home",
47+
"jsonschema",
48+
"lz4_flex",
49+
"pest",
50+
"pest_derive",
51+
"pest_generator",
52+
"pest_meta",
53+
"static_init",
54+
"thiserror",
55+
"twox-hash",
56+
"url",
57+
]
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# ⚠️ WARNING ⚠️
2+
3+
This crate is intended for Zenoh's internal use.
4+
It is not guaranteed that the API will remain unchanged in any version, including patch updates.
5+
It is highly recommended to depend solely on the zenoh and zenoh-ext crates and to utilize their public APIs.
6+
7+
This is empty crate which pins exact versions of dependent crates necessary to build zenoh with Rust 1.75.
8+
9+
- [Click here for Zenoh's main repository](https://github.com/eclipse-zenoh/zenoh)
10+
- [Click here for Zenoh's documentation](https://zenoh.io)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//
2+
// Copyright (c) 2023 ZettaScale Technology
3+
//
4+
// This program and the accompanying materials are made available under the
5+
// terms of the Eclipse Public License 2.0 which is available at
6+
// http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
7+
// which is available at https://www.apache.org/licenses/LICENSE-2.0.
8+
//
9+
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
10+
//
11+
// Contributors:
12+
// ZettaScale Zenoh Team, <zenoh@zettascale.tech>
13+
//
14+
15+
//! ⚠️ WARNING ⚠️
16+
//!
17+
//! This crate is intended for Zenoh's internal use.
18+
//!
19+
//! This is empty crate which pins exact versions of dependent crates
20+
//! necessary to build zenoh with Rust 1.75.
21+
//!
22+
//! [Click here for Zenoh's documentation](https://docs.rs/zenoh/latest/zenoh)

0 commit comments

Comments
 (0)