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: "Dependabot can't parse your Cargo.toml" error triggered by Cargo [lints] table #10453

Open
1 task done
kpreid opened this issue Aug 16, 2024 · 2 comments
Open
1 task done
Labels
L: go:modules Golang modules L: rust:cargo Rust crates via cargo T: bug 🐞 Something isn't working

Comments

@kpreid
Copy link

kpreid commented Aug 16, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Package ecosystem

Cargo

Package manager version

cargo 1.80.1 (376290515 2024-07-16)

Language version

rustc 1.80.1 (3f5fd8dd4 2024-08-06)

Manifest location and content before the Dependabot update

Reduced Cargo.toml test case, tested at the root of a repo:

[package]
name = "problem"

[lints]
clippy.should_panic_without_expect = "deny"
clippy.pedantic = { level = "warn", priority = -1 }

I uploaded this to https://github.com/kpreid/dependabot-investigation.

dependabot.yml content

version: 2
updates:
  - package-ecosystem: "cargo"
    directory: "/"
    schedule:
      interval: "weekly"
      time: "17:00"
      timezone: "America/Los_Angeles"
    versioning-strategy: "auto"

Updated dependency

No response

What you expected to see, versus what you actually saw

The file is valid according to Cargo, but Dependabot fails to parse the file. It gives no line number or other detail in the log, only:

updater | 2024/08/16 04:52:09 ERROR <job_870136100> Error during file fetching; aborting: /Cargo.toml not parseable
  proxy | 2024/08/16 04:52:10 [008] POST /update_jobs/870136100/record_update_job_error
  proxy | 2024/08/16 04:52:10 [008] 204 /update_jobs/870136100/record_update_job_error
  proxy | 2024/08/16 04:52:10 [010] PATCH /update_jobs/870136100/mark_as_processed
  proxy | 2024/08/16 04:52:10 [010] 204 /update_jobs/870136100/mark_as_processed
updater | 2024/08/16 04:52:10 INFO <job_870136100> Finished job processing
updater | 2024/08/16 04:52:10 INFO Results:
Dependabot encountered '1' error(s) during execution, please check the logs for more details.
+-------------------------------+
|            Errors             |
+-------------------------------+
| dependency_file_not_parseable |
+-------------------------------+

Native package manager behavior

The problem is not with updating, but with reading the file at all. Cargo accepts this Cargo.toml file.

Images of the diff or a link to the PR, issue, or logs

No response

Smallest manifest that reproduces the issue

No response

@kpreid kpreid added the T: bug 🐞 Something isn't working label Aug 16, 2024
@github-actions github-actions bot added L: go:modules Golang modules L: rust:cargo Rust crates via cargo labels Aug 16, 2024
kpreid added a commit to kpreid/all-is-cubes that referenced this issue Aug 16, 2024
Dependabot’s parser currently doesn't like this for some reason
(<dependabot/dependabot-core#10453>),
and while that’s certainly a bug, I’d like to get dependency updates
working again, and this is in fact the second time I’ve found a bug
in tools’ handling of dotted keys (the first time was
<toml-rs/toml#673>), so it is pragmatic to
not do the thing that often doesn't work. For now, at least.

(The reasons I prefer the dotted keys are because one doesn’t have to
scan upward to the most recent table header to see whether the lint is
`rust` or `clippy`, and it’s more like `#[warn()]` syntax.)
@Jefffrey
Copy link
Contributor

Bug in upstream toml-rb parser: emancu/toml-rb#151

@4br3mm0rd
Copy link

Hey! From what I understand with the issue in toml-rb, and from what I tested, you can fix your toml file like the following (in the meantime, until they fix the issue):

[package]
name = "problem"

[lints]
clippy.pedantic = { level = "warn", priority = -1 }
clippy.should_panic_without_expect = "deny"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: go:modules Golang modules L: rust:cargo Rust crates via cargo T: bug 🐞 Something isn't working
Projects
Status: No status
Development

No branches or pull requests

3 participants