facebook / starlark-rust

A Rust implementation of the Starlark language
Apache License 2.0
695 stars 56 forks source link

Not working in oss-fuzz #128

Closed ndmitchell closed 3 weeks ago

ndmitchell commented 3 weeks ago

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=70230 shows that Starlark no longer works in oss-fuzz. The error is:

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

So the compiler defaults to coming from February which no longer works with the latest version of serde. The right solution would be to use the most recent version of Rust. I don't know why oss-fuzz doesn't do that by default? CC @silvergasp who set this up originally and might have some ideas.

silvergasp commented 3 weeks ago

I'll take a squiz

silvergasp commented 3 weeks ago

I don't know why the nightly rustc (which oss-fuzz uses) isn't updated regularly in the base rust images. But it's an easy enough fix to just update it in the starlark-rust Docker image. Attempting fix with https://github.com/google/oss-fuzz/pull/12404 I tested this locally so I expect the CI to pass as well.

silvergasp commented 3 weeks ago

That's all merged now, so I expect it'll be fixed on the next round of nightly builds (so in the next 24hrs or so).

silvergasp commented 3 weeks ago

This is fixed now! https://oss-fuzz-build-logs.storage.googleapis.com/index.html#starlark-rust

ndmitchell commented 3 weeks ago

Thanks!