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

Move minimum supported rust version (MSRV) from 1.65 back to 1.64. #3231

Merged
merged 3 commits into from
Nov 23, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 0 additions & 1 deletion .clippy.toml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

env:
RUST_BACKTRACE: 1
RUST_VERSION: 1.65
RUST_VERSION: 1.64
PKG_CONFIG_ALLOW_CROSS: 1 # allow android to work
RUSTFLAGS: --cfg=web_sys_unstable_apis -D warnings
RUSTDOCFLAGS: -Dwarnings
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

env:
RUST_BACKTRACE: 1
RUST_VERSION: 1.65
RUST_VERSION: 1.64

jobs:
cts:
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ Bottom level categories:
- Avoid panicking in some interactions with invalid resources by @nical in (#3094)[https://github.com/gfx-rs/wgpu/pull/3094]
- Remove `wgpu_types::Features::DEPTH24PLUS_STENCIL8`, making `wgpu::TextureFormat::Depth24PlusStencil8` available on all backends. By @Healthire in (#3151)[https://github.com/gfx-rs/wgpu/pull/3151]
- Fix an integer overflow in `queue_write_texture` by @nical in (#3146)[https://github.com/gfx-rs/wgpu/pull/3146]
- Make `RenderPassCompatibilityError` and `CreateShaderModuleError` not so huge. By @jimblandy in (#3226)[https://github.com/gfx-rs/wgpu/pull/3226]

#### WebGPU

Expand All @@ -107,7 +108,7 @@ Bottom level categories:

### Testing/Internal

- Update the `minimum supported rust version` to 1.65
- Update the `minimum supported rust version` to 1.64
- Use cargo 1.64 workspace inheritance feature. By @jinleili in [#3107](https://github.com/gfx-rs/wgpu/pull/3107)

#### Vulkan
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ default-members = ["wgpu", "wgpu-hal", "wgpu-info"]

[workspace.package]
edition = "2021"
rust-version = "1.65"
rust-version = "1.64"
keywords = ["graphics"]
license = "MIT OR Apache-2.0"
homepage = "https://wgpu.rs/"
Expand Down
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,27 @@ For an overview of all the components in the gfx-rs ecosystem, see [the big pict

### MSRV policy

Minimum Supported Rust Version is **1.65**.
Minimum Supported Rust Version is **1.64**.
It is enforced on CI (in "/.github/workflows/ci.yml") with `RUST_VERSION` variable.
This version can only be upgraded in breaking releases.

The `wgpu-core`, `wgpu-hal`, and `wgpu-types` crates should never
require an MSRV ahead of Firefox's MSRV for nightly builds, as
determined by the value of `MINIMUM_RUST_VERSION` in
[`python/mozboot/mozboot/util.py`][util]. However, Firefox uses `cargo
vendor` to extract only those crates it actually uses, so the
workspace's other crates can have more recent MSRVs.

*Note for Rust 1.64*: The workspace itself can even use a newer MSRV
than Firefox, as long as the vendoring step's `Cargo.toml` rewriting
removes any features Firefox's MSRV couldn't handle. For example,
`wgpu` can use manifest key inheritance, added in Rust 1.64, even
before Firefox reaches that MSRV, because `cargo vendor` copies
inherited values directly into the individual crates' `Cargo.toml`
files, producing 1.63-compatible files.

[util]: https://searchfox.org/mozilla-central/source/python/mozboot/mozboot/util.py

## Getting Started

### Rust
Expand Down
13 changes: 5 additions & 8 deletions wgpu-core/src/device/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,7 @@ pub(crate) struct RenderPassContext {
#[derive(Clone, Debug, Error)]
pub enum RenderPassCompatibilityError {
#[error("Incompatible color attachment: the renderpass expected {0:?} but was given {1:?}")]
IncompatibleColorAttachment(
ArrayVec<Option<TextureFormat>, { hal::MAX_COLOR_ATTACHMENTS }>,
ArrayVec<Option<TextureFormat>, { hal::MAX_COLOR_ATTACHMENTS }>,
),
IncompatibleColorAttachment(Vec<Option<TextureFormat>>, Vec<Option<TextureFormat>>),
#[error(
"Incompatible depth-stencil attachment: the renderpass expected {0:?} but was given {1:?}"
)]
Expand All @@ -102,8 +99,8 @@ impl RenderPassContext {
) -> Result<(), RenderPassCompatibilityError> {
if self.attachments.colors != other.attachments.colors {
return Err(RenderPassCompatibilityError::IncompatibleColorAttachment(
self.attachments.colors.clone(),
other.attachments.colors.clone(),
self.attachments.colors.iter().cloned().collect(),
other.attachments.colors.iter().cloned().collect(),
));
}
if self.attachments.depth_stencil != other.attachments.depth_stencil {
Expand Down Expand Up @@ -1245,7 +1242,7 @@ impl<A: HalApi> Device<A> {
pipeline::CreateShaderModuleError::Parsing(pipeline::ShaderError {
source: code.to_string(),
label: desc.label.as_ref().map(|l| l.to_string()),
inner,
inner: Box::new(inner),
})
})?;
(Cow::Owned(module), code.into_owned())
Expand Down Expand Up @@ -1308,7 +1305,7 @@ impl<A: HalApi> Device<A> {
pipeline::CreateShaderModuleError::Validation(pipeline::ShaderError {
source,
label: desc.label.as_ref().map(|l| l.to_string()),
inner,
inner: Box::new(inner),
})
})?;
let interface =
Expand Down
2 changes: 1 addition & 1 deletion wgpu-core/src/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl<A: hal::Api> Resource for ShaderModule<A> {
pub struct ShaderError<E> {
pub source: String,
pub label: Option<String>,
pub inner: E,
pub inner: Box<E>,
}
#[cfg(feature = "wgsl")]
impl fmt::Display for ShaderError<naga::front::wgsl::ParseError> {
Expand Down
7 changes: 6 additions & 1 deletion wgpu-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ homepage.workspace = true
repository.workspace = true
keywords.workspace = true
license.workspace = true
rust-version.workspace = true

# Override the workspace's `rust-version` key. Firefox uses `cargo vendor` to
# copy the crates it actually uses out of the workspace, so it's meaningful for
# them to have less restrictive MSRVs individually than the workspace as a
# whole, if their code permits. See `../README.md` for details.
rust-version = "1.60"
jimblandy marked this conversation as resolved.
Show resolved Hide resolved

[package.metadata.docs.rs]
# Ideally we would enable all the features.
Expand Down