Skip to content
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

Rust 1.69.0 + remove toolchain confusion #1935

Merged
merged 17 commits into from
May 2, 2023
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .github/workflows/reusable_build_web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,6 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.67.0
target: wasm32-unknown-unknown
override: true

- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
with:
Expand Down
13 changes: 0 additions & 13 deletions .github/workflows/reusable_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,6 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
with:
profile: default
toolchain: 1.67.1
target: wasm32-unknown-unknown
override: true

- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
with:
Expand Down Expand Up @@ -249,12 +242,6 @@ jobs:

- uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.67.1
override: true

- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
with:
Expand Down
4 changes: 2 additions & 2 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ This is a guide to how to build Rerun.
* Install the Rust toolchain: <https://rustup.rs/>
* `git clone git@github.com:rerun-io/rerun.git && cd rerun`
* Run `./scripts/setup_dev.sh`.
* Make sure `cargo --version` prints `1.67.1` once you are done
* Make sure `cargo --version` prints `1.69.0` once you are done


### Apple-silicon Macs

If you are using an Apple-silicon Mac (M1, M2), make sure `rustc -vV` outputs `host: aarch64-apple-darwin`. If not, this should fix it:

```sh
rustup set default-host aarch64-apple-darwin && rustup install 1.67.1
rustup set default-host aarch64-apple-darwin && rustup install 1.69.0
```

## Building the docs
Expand Down
43 changes: 24 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ homepage = "https://rerun.io"
include = ["../../LICENSE-APACHE", "../../LICENSE-MIT", "**/*.rs", "Cargo.toml"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/rerun-io/rerun"
rust-version = "1.67"
rust-version = "1.69"
version = "0.6.0-alpha.0"

[workspace.dependencies]
Expand Down Expand Up @@ -83,9 +83,11 @@ polars-ops = "0.27.1"
puffin = "0.14"
smallvec = { version = "1.0", features = ["const_generics", "union"] }
thiserror = "1.0"
time = { version = "0.3", features = ["wasm-bindgen"] }
time = { version = "0.3", default-features = false, features = [
"wasm-bindgen",
] }
tinyvec = { version = "1.6", features = ["alloc", "rustc_1_55"] }
tokio = "1.24"
tokio = { version = "1.24", default-features = false }
wgpu = { version = "0.16" }
wgpu-core = { version = "0.16" }

Expand Down
2 changes: 1 addition & 1 deletion ci_docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ RUN curl -L https://github.com/NixOS/patchelf/releases/download/0.17.2/patchelf-
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH \
RUST_VERSION=1.67.1 \
RUST_VERSION=1.69.0 \
RUSTUP_VERSION=1.25.2

# Install Rust
Expand Down
2 changes: 1 addition & 1 deletion clippy.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# There is also a scripts/clippy_wasm/clippy.toml which forbids some methods that are not available in wasm.

msrv = "1.67"
msrv = "1.69"

allow-unwrap-in-tests = true

Expand Down
5 changes: 1 addition & 4 deletions crates/re_log_types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,7 @@ num-derive = "0.3"
num-traits = "0.2"
smallvec.workspace = true
thiserror.workspace = true
time = { workspace = true, default-features = false, features = [
"formatting",
"macros",
] }
time = { workspace = true, features = ["formatting", "macros"] }
typenum = "1.15"
uuid = { version = "1.1", features = ["serde", "v4", "js"] }

Expand Down
2 changes: 1 addition & 1 deletion crates/re_log_types/src/component_types/mesh3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub struct MeshId(pub uuid::Uuid);
impl nohash_hasher::IsEnabled for MeshId {}

// required for [`nohash_hasher`].
#[allow(clippy::derive_hash_xor_eq)]
#[allow(clippy::derived_hash_with_manual_eq)]
impl std::hash::Hash for MeshId {
#[inline]
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
Expand Down
2 changes: 1 addition & 1 deletion crates/re_log_types/src/component_types/tensor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub struct TensorId(pub uuid::Uuid);
impl nohash_hasher::IsEnabled for TensorId {}

// required for [`nohash_hasher`].
#[allow(clippy::derive_hash_xor_eq)]
#[allow(clippy::derived_hash_with_manual_eq)]
impl std::hash::Hash for TensorId {
#[inline]
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
Expand Down
2 changes: 1 addition & 1 deletion crates/re_log_types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pub struct RecordingId(uuid::Uuid);
impl nohash_hasher::IsEnabled for RecordingId {}

// required for [`nohash_hasher`].
#[allow(clippy::derive_hash_xor_eq)]
#[allow(clippy::derived_hash_with_manual_eq)]
impl std::hash::Hash for RecordingId {
#[inline]
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
Expand Down
2 changes: 1 addition & 1 deletion crates/re_log_types/src/time_point/timeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ impl SizeBytes for Timeline {
}

// required for [`nohash_hasher`].
#[allow(clippy::derive_hash_xor_eq)]
#[allow(clippy::derived_hash_with_manual_eq)]
impl std::hash::Hash for Timeline {
#[inline]
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
Expand Down
3 changes: 2 additions & 1 deletion crates/re_string_interner/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ impl StringInterner {
// and that is wat `ier()` gives us, so this is all correct.
self.map
.iter()
.map(|(k, v)| std::mem::size_of_val(k) + std::mem::size_of_val(v) + v.len())
// NOTE: v is a `&&str`!
.map(|(k, v)| std::mem::size_of_val(k) + std::mem::size_of_val(*v) + v.len())
teh-cmc marked this conversation as resolved.
Show resolved Hide resolved
.sum()
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/re_viewer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ serde = { version = "1", features = ["derive"] }
slotmap = { version = "1.0.6", features = ["serde"] }
smallvec = { workspace = true, features = ["serde"] }
thiserror.workspace = true
time = { workspace = true, default-features = false, features = ["formatting"] }
Copy link
Member

Choose a reason for hiding this comment

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

Is it an error to set fault-features = false both here and in the root Cargo.toml?

Copy link
Member Author

Choose a reason for hiding this comment

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

It depends on the context...

If you're within the workspace, then the root Cargo.toml "wins" and this effectively does nothing since time is considered to not have any default features.

But what happens when you import re_viewer directly in an external project: surely the root manifest doesn't take precedence then...? or does it??! I'll test this for #2024...

Copy link
Member Author

Choose a reason for hiding this comment

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

time = { workspace = true, features = ["formatting"] }
uuid = { version = "1.1", features = ["serde", "v4", "js"] }
vec1 = "1.8"
wgpu.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/re_ws_comms/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ futures-util = { version = "0.3", optional = true, default-features = false, fea
] }
parking_lot = { workspace = true, optional = true }
tokio-tungstenite = { version = "0.17.1", optional = true }
tokio = { workspace = true, optional = true, default-features = false, features = [
tokio = { workspace = true, optional = true, features = [
"io-std",
"macros",
"net",
Expand Down
3 changes: 1 addition & 2 deletions crates/re_ws_comms/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ impl RerunServerHandle {
let rt = tokio::runtime::Handle::current();

let ws_server = rt.block_on(tokio::spawn(async move {
let ws_server = RerunServer::new(requested_port).await;
ws_server
RerunServer::new(requested_port).await
}))??;

let port = ws_server.port;
Expand Down
2 changes: 1 addition & 1 deletion examples/rust/raw_mesh/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ fn node_primitives<'data>(
let reader = primitive.reader(|buffer| Some(&buffers[buffer.index()]));

let indices = reader.read_indices();
let indices = indices.map(|indices| indices.into_u32().into_iter().collect());
let indices = indices.map(|indices| indices.into_u32().collect());

let vertex_positions = reader.read_positions().unwrap();
let vertex_positions = vertex_positions.collect();
Expand Down
6 changes: 1 addition & 5 deletions rerun_py/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@ re_error.workspace = true
re_log.workspace = true
re_log_types.workspace = true
re_memory.workspace = true
rerun = { workspace = true, default-features = false, features = [
"analytics",
"server",
"sdk",
] }
rerun = { workspace = true, features = ["analytics", "server", "sdk"] }
re_web_viewer_server = { workspace = true, optional = true }
re_ws_comms = { workspace = true, optional = true }

Expand Down
6 changes: 3 additions & 3 deletions rerun_py/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Setup:
* Install the Rust toolchain: <https://rustup.rs/>
* `git clone git@github.com:rerun-io/rerun.git && cd rerun`
* Run `./scripts/setup_dev.sh`.
* Make sure `cargo --version` prints `1.67.1` once you are done
* Make sure `cargo --version` prints `1.69.0` once you are done

## Building
To build from source and install Rerun into your *current* Python environment run:
Expand Down Expand Up @@ -152,10 +152,10 @@ You can run with `RUST_LOG=debug` to get more output out of the rerun SDK.
If you are using an Apple-silicon Mac, make sure `rustc -vV` outputs `host: aarch64-apple-darwin`. If not, this should fix it:

``` sh
rustup set default-host aarch64-apple-darwin && rustup install 1.67
rustup set default-host aarch64-apple-darwin && rustup install 1.69
```

If you want to switch back, this is how:
``` sh
rustup set default-host x86_64-apple-darwin && rustup install 1.67
rustup set default-host x86_64-apple-darwin && rustup install 1.69
```
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
# to the user in the error, instead of "error: invalid channel name '[toolchain]'".

[toolchain]
channel = "1.67.1"
channel = "1.69.0"
components = ["rustfmt", "clippy"]
targets = ["wasm32-unknown-unknown"]
2 changes: 1 addition & 1 deletion scripts/clippy_wasm/clippy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# We cannot forbid all these methods in the main `clippy.toml` because of
# https://github.com/rust-lang/rust-clippy/issues/10406

msrv = "1.67"
msrv = "1.69"

# https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_methods
disallowed-methods = [
Expand Down
2 changes: 1 addition & 1 deletion scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ elif [ -x "$(command -v dnf)" ]; then
fi

# Needed to compile and check the code:
rustup install 1.67.1
rustup install 1.69.0
./scripts/setup_web.sh

echo "setup.sh completed!"