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

Serde msrv got bumped to 1.78 in 1.0.204 #2770

Closed
MolotovCherry opened this issue Jul 7, 2024 · 7 comments
Closed

Serde msrv got bumped to 1.78 in 1.0.204 #2770

MolotovCherry opened this issue Jul 7, 2024 · 7 comments

Comments

@MolotovCherry
Copy link

MolotovCherry commented Jul 7, 2024

The cargo.toml promises 1.31, but this is no longer true. At least, not with the compiler version I'm using anyways.
rust-version = "1.31"

Perhaps this is expected behavior and serde will just, from now on, be incompatible with all nightly less than 78?

error[E0658]: `#[diagnostic]` attribute name space is experimental
   --> C:\Users\user\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.204\src\de\mod.rs:537:5
    |
537 |     diagnostic::on_unimplemented(
    |     ^^^^^^^^^^
    |
    = note: see issue #111996 <https://github.com/rust-lang/rust/issues/111996> for more information
    = help: add `#![feature(diagnostic_namespace)]` to the crate attributes to enable
    = note: this compiler was built on 2024-02-25; consider upgrading it if it is out of date
@dtolnay
Copy link
Member

dtolnay commented Jul 7, 2024

Most likely, you are building with an old nightly compiler. Old nightlies are not supported in general. You would need to use a more recent nightly compiler, or any stable compiler 1.31 or newer.

@MolotovCherry
Copy link
Author

MolotovCherry commented Jul 7, 2024

I figured as much. It's quite nice to now have diagnostic on serde. Thanks again for all the hard work you put into your projects! 😄

@dhedey
Copy link

dhedey commented Jul 23, 2024

@dtolnay / @oli-obk - would we consider updating build.rs so that it recognises the version of nightly builds, and so can avoid new features being enabled when building with older nightly versions?

Just to explain our use case - for one of our builds (a coverage build) we have to use a nightly compiler version, and are blocked on upgrading it because the coverage toolchain is lagging behind most recent rust versions.

Currently a version string such as rustc 1.79.0-nightly (7f2fc33da 2024-04-22) bails out on the u32 conversion and therefore None is returned which gets interpreted as "latest" / "all features enabled":

u32::from_str(next).ok()

@oli-obk
Copy link
Member

oli-obk commented Jul 23, 2024

We'd have to detect exact nightly versions, which is very annoying. You can just pin your serde version to an older one until you update your nightly. Unless you're adding a new crate that depends on a newer serde, you won't run into issues that way

@dhedey
Copy link

dhedey commented Jul 23, 2024

Ahh sorry, I'm just wrong - the logic in build.rs does work when given a nightly version string such as rustc 1.79.0-nightly (7f2fc33da 2024-04-22).

I'm at a bit of a loss why nightly versions don't get the cargo:rustc-cfg=no_diagnostic_namespace option / feature applied then.

But yes, in our case, we can pin serde in our test lock file and use --locked. We have upstream consumers so we can't pin serde in our workspace without creating possibly compatibility problems.

@dtolnay
Copy link
Member

dtolnay commented Jul 23, 2024

I'm at a bit of a loss why nightly versions don't get the cargo:rustc-cfg=no_diagnostic_namespace option / feature applied then.

This would happen if you pick a 1.79 nightly that does not contain the same stable features as 1.79 stable. A request for your coverage toolchains dependency should come out of this (the thing handing you arbitrary old nightly versions they need you to use). You should encourage them to only use nightlies that line up with a beta branch point, i.e. for which the next calendar day's nightly has a higher rustc minor version number, as those contain all the same stable features as the corresponding stable release.

@ArhanChaudhary
Copy link

To future lurkers, if you're running into this issue with wasm-pack, you will need to pass --install to use the older versions of serde in the distributed lock file (i.e cargo install --locked wasm-pack@0.13.0)

github-merge-queue bot pushed a commit to smithy-lang/smithy-rs that referenced this issue Sep 6, 2024
## Description
This PR updates lockfiles by running:
```
./gradlew aws:sdk:generateAllLockfiles -Paws-sdk-rust-path=/Users/awsaito/src/aws-sdk-rust
```
However, due to [the minicbor
issue](#3818), we still pin
it to 0.24.2 by running the following on `rust-runtime/Cargo.lock` and
`aws/sdk/Cargo.lock`:
```
RUSTFLAGS="--cfg aws_sdk_unstable" cargo update -p minicbor --precise 0.24.2
```

The rest of the changes handle miscellaneous scenarios:
- **Updated nightly version**: Upgraded to `nightly-2024-03-15` to
address a [compatibility
issue](serde-rs/serde#2770) introduced by the
updated serde library.
- **Cleaned up use statements**: Removed redundant use statements, which
were flagged as warnings by the new nightly version.

## Testing
Tests in CI

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
github-merge-queue bot pushed a commit to smithy-lang/smithy-rs that referenced this issue Sep 6, 2024
## Description
This PR updates lockfiles by running:
```
./gradlew aws:sdk:generateAllLockfiles -Paws-sdk-rust-path=/Users/awsaito/src/aws-sdk-rust
```
However, due to [the minicbor
issue](#3818), we still pin
it to 0.24.2 by running the following on `rust-runtime/Cargo.lock` and
`aws/sdk/Cargo.lock`:
```
RUSTFLAGS="--cfg aws_sdk_unstable" cargo update -p minicbor --precise 0.24.2
```

The rest of the changes handle miscellaneous scenarios:
- **Updated nightly version**: Upgraded to `nightly-2024-03-15` to
address a [compatibility
issue](serde-rs/serde#2770) introduced by the
updated serde library.
- **Cleaned up use statements**: Removed redundant use statements, which
were flagged as warnings by the new nightly version.

## Testing
Tests in CI

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
aws-sdk-rust-ci pushed a commit to awslabs/aws-sdk-rust that referenced this issue Sep 10, 2024
## Description
This PR updates lockfiles by running:
```
./gradlew aws:sdk:generateAllLockfiles -Paws-sdk-rust-path=/Users/awsaito/src/aws-sdk-rust
```
However, due to [the minicbor
issue](smithy-lang/smithy-rs#3818), we still pin
it to 0.24.2 by running the following on `rust-runtime/Cargo.lock` and
`aws/sdk/Cargo.lock`:
```
RUSTFLAGS="--cfg aws_sdk_unstable" cargo update -p minicbor --precise 0.24.2
```

The rest of the changes handle miscellaneous scenarios:
- **Updated nightly version**: Upgraded to `nightly-2024-03-15` to
address a [compatibility
issue](serde-rs/serde#2770) introduced by the
updated serde library.
- **Cleaned up use statements**: Removed redundant use statements, which
were flagged as warnings by the new nightly version.

## Testing
Tests in CI

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
EliahKagan added a commit to EliahKagan/oss-fuzz that referenced this issue Sep 18, 2024
Since around GitoxideLabs/gitoxide#1536, fuzzing
is broken for `gitoxide` due to an error related to `serde`. As
shown there and in GitoxideLabs/gitoxide#1596, the
error is:

    error[E0658]: `#[diagnostic]` attribute name space is experimental
       --> /rust/registry/src/index.crates.io-6f17d22bba15001f/serde-1.0.210/src/de/mod.rs:536:5
        |
    536 |     diagnostic::on_unimplemented(
        |     ^^^^^^^^^^
        |
        = note: see issue #111996 <rust-lang/rust#111996> for more information
        = help: add `#![feature(diagnostic_namespace)]` to the crate attributes to enable
        = note: this compiler was built on 2024-02-11; consider upgrading it if it is out of date

Since rust-lang/rust#111996 is closed as
completed, and similar errors appear to have been fixed in oss-fuzz
for other projects by using the latest nightly toolchain, this
makes the same change for `gitoxide` as was made in:

- google#12404 for `starlark-rust`
- google#12409 for `rhai`

See also :

- google#12410
- serde-rs/serde#2770
DavidKorczynski pushed a commit to google/oss-fuzz that referenced this issue Sep 18, 2024
Since around GitoxideLabs/gitoxide#1536, fuzzing is
broken for `gitoxide` due to an error related to `serde`. As shown there
and in GitoxideLabs/gitoxide#1596, the error is:

    error[E0658]: `#[diagnostic]` attribute name space is experimental
-->
/rust/registry/src/index.crates.io-6f17d22bba15001f/serde-1.0.210/src/de/mod.rs:536:5
        |
    536 |     diagnostic::on_unimplemented(
        |     ^^^^^^^^^^
        |
= note: see issue #111996
<rust-lang/rust#111996> for more information
= help: add `#![feature(diagnostic_namespace)]` to the crate attributes
to enable
= note: this compiler was built on 2024-02-11; consider upgrading it if
it is out of date

Since rust-lang/rust#111996 is closed as
completed, and similar errors appear to have been fixed in oss-fuzz for
other projects by using the latest nightly toolchain, this makes the
same change for `gitoxide` as was made in:

- #12404 for `starlark-rust`
- #12409 for `rhai`

See also:

- #12410
- serde-rs/serde#2770

cc @Byron
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants