Skip to content

Switch from unmaintained yaml-rust to yaml-rust2#422

Merged
NSoiffer merged 1 commit intodaisy:mainfrom
rocallahan:yaml-rust2
Dec 19, 2025
Merged

Switch from unmaintained yaml-rust to yaml-rust2#422
NSoiffer merged 1 commit intodaisy:mainfrom
rocallahan:yaml-rust2

Conversation

@rocallahan
Copy link
Contributor

Resolves #421

Copy link
Collaborator

@NSoiffer NSoiffer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for spotting that and the changes.

@NSoiffer NSoiffer merged commit 4da0124 into daisy:main Dec 19, 2025
2 of 4 checks passed
@NSoiffer
Copy link
Collaborator

@rocallahan: Hmm... this causes a failure in Rules\Languages\en\definitions.yaml, which is one of the first YAML files that is read. Did you run the tests? If so, were there no failures? The "yaml-rust2" documentation says it is a drop in replacement for "yaml-rust", but that doesn't seem to be true.

The error "Parse error!!: invalid indentation at byte 3359 line 52 column 3" happens at the end of first definition in definitions.yaml. It didn't cause a problem in "yaml-rust" and the Red Hat YAML vscode extension thinks the file is syntactically OK. It does not appear to be a space vs tab issue as there are only spaces present in that mapping.

Do you have any suggestions. If not, I'm going to back out the change.

@rocallahan
Copy link
Contributor Author

Sorry, I didn't run the tests. You should probably back this out for now. But someone will have to fix this sooner or later I guess; RustSec has an advisory marking yaml-rust as unmaintained, which triggers alarms in various CI setups.

@NSoiffer
Copy link
Collaborator

I don't suppose you noticed anything in the documentation saying to set a certain value for compatibility with the old version? It seems strange that the new version complains when the old version didn't and the yaml syntax Checker in Visual Studio code think it's fine also.

@NSoiffer
Copy link
Collaborator

NSoiffer commented Dec 19, 2025

[Updated]
I did some more investigation and found someone also complained about this and the author says that the syntax is in fact invalid. I tried several online YAML validators and most accept it; one says it is invalid. From what I can see reading the spec, flow sequence/mappings do not follow indentation rules and this causes confusion, hence the different interpretations by parsers, with several places many parsers accepting the closing bracket/brace matching the name being accepted by many (most?) parsers despite being technically illegal.

The vscode Red Hat accepts the "bad" syntax also. I've put in a feature request asking for an option to accept this format.

NSoiffer added a commit that referenced this pull request Dec 19, 2025
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

Successfully merging this pull request may close these issues.

yaml-rust is unmaintained

2 participants