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

🐛 Broken build when pulling some Biome dependencies from crates.io #5151

Open
1 task done
kylewlacy opened this issue Feb 18, 2025 · 1 comment
Open
1 task done
Labels
good first issue Good for newcomers S-Help-wanted Status: you're familiar with the code base and want to help the project

Comments

@kylewlacy
Copy link

Environment information

N/A (not using Biome as a CLI tool)

What happened?

For context, I'm using some of the crates from Biome as part of a Rust project (Brioche) to handle parsing TypeScript files.

Some subset of the Biome crates in crates.io seem to have incorrect version constraints on their dependencies, meaning that pulling their latest version will also pull incompatible versions of their dependencies. Here's a minimal set of steps to reproduce:

  1. Create a new Cargo project by running cargo new biome-build-error
  2. Within the new project, run cargo add biome_json_syntax
  3. Run cargo check

Here's a repository with the project from (2): https://github.com/kylewlacy/biome-build-error

Today, this fails with the following error:

cargo check output
    Checking biome_json_syntax v0.5.7
error[E0046]: not all trait items implemented, missing: `is_trivia`
  --> /home/kyle/.cargo/registry/src/index.crates.io-6f17d22bba15001f/biome_json_syntax-0.5.7/src/lib.rs:46:1
   |
46 | impl biome_rowan::SyntaxKind for JsonSyntaxKind {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `is_trivia` in implementation
   |
   = help: implement the missing item: `fn is_trivia(self) -> bool { todo!() }`

error[E0618]: expected function, found FileSourceError
--> /home/kyle/.cargo/registry/src/index.crates.io-6f17d22bba15001f/biome_json_syntax-0.5.7/src/file_source.rs:62:28
|
62 | .ok_or_else(|| FileSourceError::MissingFileName(path.into()))?
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------------
| |
| call expression requires function

error[E0618]: expected function, found FileSourceError
--> /home/kyle/.cargo/registry/src/index.crates.io-6f17d22bba15001f/biome_json_syntax-0.5.7/src/file_source.rs:64:28
|
64 | ..._else(|| FileSourceError::MissingFileName(path.into()))?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------------
| |
| call expression requires function

error[E0618]: expected function, found FileSourceError
--> /home/kyle/.cargo/registry/src/index.crates.io-6f17d22bba15001f/biome_json_syntax-0.5.7/src/file_source.rs:68:28
|
68 | ...lse(|| FileSourceError::MissingFileExtension(path.into()))?
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------------
| |
| call expression requires function

error[E0618]: expected function, found FileSourceError
--> /home/kyle/.cargo/registry/src/index.crates.io-6f17d22bba15001f/biome_json_syntax-0.5.7/src/file_source.rs:70:28
|
70 | ...lse(|| FileSourceError::MissingFileExtension(path.into()))?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------------
| |
| call expression requires function

error[E0618]: expected function, found FileSourceError
--> /home/kyle/.cargo/registry/src/index.crates.io-6f17d22bba15001f/biome_json_syntax-0.5.7/src/file_source.rs:88:28
|
88 | return Err(FileSourceError::UnknownExtension(
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- help: consider using a semicolon here to finish the statement: ;
| ____________________________|
| |
89 | | file_name.into(),
90 | | extension.into(),
91 | | ));
| |_________________- call expression requires function

Some errors have detailed explanations: E0046, E0618.
For more information about an error, try rustc --explain E0046.
error: could not compile biome_json_syntax (lib) due to 6 previous errors

In this particular case, this happens because biome_json_syntax v0.5.7 is incompatible with biome_rowan v0.5.8, which is the version Cargo selects by default today.

Expected result

The build should succeed

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@kylewlacy kylewlacy added the S-Needs triage Status: this issue needs to be triaged label Feb 18, 2025
@ematipico
Copy link
Member

We don't guarantee the usage of our crates around these cases, but if this happens, you're free to send a PR to fix those cases.

@ematipico ematipico added good first issue Good for newcomers S-Help-wanted Status: you're familiar with the code base and want to help the project and removed S-Needs triage Status: this issue needs to be triaged labels Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers S-Help-wanted Status: you're familiar with the code base and want to help the project
Projects
None yet
Development

No branches or pull requests

2 participants