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 TOML is generated #67

Closed
asm0dey opened this issue May 1, 2024 · 6 comments · Fixed by #68
Closed

Broken TOML is generated #67

asm0dey opened this issue May 1, 2024 · 6 comments · Fixed by #68

Comments

@asm0dey
Copy link

asm0dey commented May 1, 2024

Consider the following TOML:

[a]
array = [ "a", 2, { x = "y", z = 3 } ]
key1 = "value1"
key2 = "value2"

It passes validation at https://www.toml-lint.com even tho it's slightly unconventional.

When I do the following

❯ ffs -i x.toml&
[1] 469278
❯ tree x
x
└── a
    ├── array
    │   ├── 0
    │   ├── 1
    │   └── 2
    │       ├── x
    │       └── z
    ├── key1
    └── key2

4 directories, 6 files

it seems valid.

All the data is valid too:

❯ cat x/a/array/0
a
❯ cat x/a/array/1
2
❯ cat x/a/array/2/x
y
❯ cat x/a/array/2/z
3
❯ cat x/a/key1
value1
❯ cat x/a/key2
value2

However when I unmount it, it's completely broken:

❯ umount x
[1]  + 469278 done       ffs -i x.toml
❯ cat x.toml
[a]
key1 = "value1"
key2 = "value2"
array = ["a", 2
[[a.array]]
x = "y"
z = 3
]
@mgree
Copy link
Owner

mgree commented May 1, 2024

When rendering toml, I'm just using the toml package (reference in our code), so this indicates a bug in their code... at v0.5. They're currently on v0.8.12, so I suspect that upgrading to a more recent version will fix things.

(If you're comfortable compiling the code yourself, you should be able to test this out by cloning and updating Cargo.toml with the new version for the toml package.)

@asm0dey
Copy link
Author

asm0dey commented May 1, 2024

Compiled version is the only one I tried, let me try to update the version :)

@asm0dey
Copy link
Author

asm0dey commented May 1, 2024

Yup, updating fixes it!

mgree added a commit that referenced this issue May 2, 2024
@mgree
Copy link
Owner

mgree commented May 2, 2024

#68 is set to merge when CI says it's good, which should generate a usable executable. Thanks for the report!

@mgree mgree closed this as completed May 2, 2024
mgree added a commit that referenced this issue May 2, 2024
Resolves #67, fixing broken TOML printing.
@asm0dey
Copy link
Author

asm0dey commented May 2, 2024

Will there be a new release published?

@mgree
Copy link
Owner

mgree commented May 2, 2024

There's always a "latest" build. I'm overdue for a new release, to incorporate @nad2040's work on pack/unpack binaries. Possibly today, more likely next week (it's the end of the semester, so I'm a bit overloaded).

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 a pull request may close this issue.

2 participants