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

This Cargo.toml code is crashing the Even Better Toml extension. #755

Open
hq-zyrosk opened this issue Mar 1, 2025 · 12 comments
Open

This Cargo.toml code is crashing the Even Better Toml extension. #755

hq-zyrosk opened this issue Mar 1, 2025 · 12 comments

Comments

@hq-zyrosk
Copy link

[profile.release]
strip = true            # Strip symbols from binary (doesn't affect runtime speed)
panic = "abort"         # Terminate on panic (faster than unwinding)
overflow-checks = false # Disable integer overflow checks for speed
opt-level = 3           # Maximum optimization for speed
lto = true              # Link-time optimization (beneficial for speed)
incremental = false     # Disable incremental compilation for better optimization
debug = false           # No debug info for maximum performance
codegen-units = 1     # Fewer codegen units allow more aggressive inter-procedural optimizations

[profile.dev]
opt-level = 0 # No optimization for faster compilation
debug = true  # Full debug info

[workspace]
resolver = "3"
members = ["cl", "en", "hq", "xx", "zz"]

Crashes at line which begins with codegen-units.

@arpadav
Copy link

arpadav commented Mar 10, 2025

+1

Have never had this issue for the past 2 years.

Even reverting to old versions of the extension doesn't fix this. According to Cargo Book: Profiles the format below is correct, yet it yields the following error:

[profile.release]
lto = true
strip = true
opt-level = 3
panic = "abort"
codegen-units = 1
Additional properties are not allowed ('lto', 'strip', 'opt-level', 'panic', 'codegen-units' were unexpected)Even Better TOML

@genusistimelord
Copy link

I am getting this error as well

Image

@panekj
Copy link
Collaborator

panekj commented Mar 10, 2025

@arpadav @genusistimelord this is not the same issue, issue mentioned by OP is crashing due to comment.

Your issue is most likely due to recent changes that were made to Cargo schema.

@arpadav
Copy link

arpadav commented Mar 10, 2025

@panekj According to https://doc.rust-lang.org/cargo/reference/profiles.html this schema has not changed. I am still using Rust 2021 edition with 0 changes to my project. Even for Rust 2024 edition this seems to be the same. Or am I missing something? If so I would like to update to the most recent schema, I just can't find anything on this

@arpadav
Copy link

arpadav commented Mar 10, 2025

@panekj Or I think I understand what you mean. Cargo.toml schema has not changed, but there are changes within SchemaStore/schemastore repo. If so, then yea that must be reverted / fixed.

@genusistimelord
Copy link

@arpadav @genusistimelord this is not the same issue, issue mentioned by OP is crashing due to comment.

Your issue is most likely due to recent changes that were made to Cargo schema.

oh sorry, I did not fully look at the first one and saw the second post made. thank you for the fix.

@starwing
Copy link

So Is there any work around for the unexpected errors for profile.release?

@panekj
Copy link
Collaborator

panekj commented Mar 10, 2025

At the top of the file add

#:schema https://raw.githubusercontent.com/SchemaStore/schemastore/d8d4ddd2dfa7aee57c15dad08fb95ab038007a20/src/schemas/json/cargo.json

@arpadav
Copy link

arpadav commented Mar 10, 2025

For me, 39460faa601f33e114271ad513ad5162c2e57bbf works too, the commit right before SchemaStore/schemastore@e0ac0b8

@hq-zyrosk
Copy link
Author

@panekj thanks for the excellent work.

Can you add semantic highlights for "support.type.property-name.toml" and "support.type.property-name.table.toml" (like there is one for tomlArrayKey)?

Were you able to solve the comment glitch originally posted?

Your work is helping us tremendously dealing with toml files, especially the ability to be able to sort the keys, I wish we could also sort the "support.type.property-name.table.toml" (keys inside [], example [workspace], [workspace.dev] etc.).

@yassun7010
Copy link
Contributor

Reverted changes that caused 🙏

#755 (comment)

@panekj
Copy link
Collaborator

panekj commented Mar 11, 2025

Were you able to solve the comment glitch originally posted?

Please follow #741 for updates (as current issue has been slightly hijacked)

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

No branches or pull requests

6 participants