error: caught non-lix exception for bad inline toml machine specs #1083

Open
opened 2025-12-22 15:34:55 +00:00 by pennae · 5 comments
Owner

Describe the bug

nix build -j0 -f test.nix --builders "version = 1\nmachines.foo.uri = snafu"

fails with

error: caught non-lix exception: (unknown):-1: failed: std::exception: error: bad machine specification: failed to convert column #3 in a row: 'version = 1\nmachines.foo.uri = snafu' to 'unsigned int'
       stack: 555555816720

Expected behavior

a better error message. ignoring the builders entirely may be an option too, but a better message is mandatory

nix --version output

nix (Lix, like Nix) 2.95.0-pre20251215-dev_5376bbe

## Describe the bug ``` nix build -j0 -f test.nix --builders "version = 1\nmachines.foo.uri = snafu" ``` fails with ``` error: caught non-lix exception: (unknown):-1: failed: std::exception: error: bad machine specification: failed to convert column #3 in a row: 'version = 1\nmachines.foo.uri = snafu' to 'unsigned int' stack: 555555816720 ``` ## Expected behavior a better error message. ignoring the builders entirely may be an option too, but a better message is mandatory ## `nix --version` output `nix (Lix, like Nix) 2.95.0-pre20251215-dev_5376bbe`

isn't this an issue of the legacy format? toml11 throws a syntax error, we can't be sure that this must be a toml, so we try to parse it as legacy and that crashes. "In column three" is definitely a legacy error message

isn't this an issue of the legacy format? toml11 throws a syntax error, we can't be sure that this must be a toml, so we try to parse it as legacy and that crashes. "In column three" is definitely a legacy error message
Author
Owner

yes, it's a legacy error. it's a lot more likely to happen now though if people forget that toml needs its strings quoted, or have any syntax error in their toml files, and that makes for a really bad user experience

yes, it's a legacy error. it's a lot more likely to happen now though if people forget that toml needs its strings quoted, or have any syntax error in their toml files, and that makes for a really bad user experience

yes but you were opposed to using any other character as a toml indicator which would have resulted in a decent error message.

yes but you were opposed to using any other character as a toml indicator which would have resulted in a decent error message.

though we could potentially append the toml syntax error as context to the legacy error?

though we could potentially append the toml syntax error as context to the legacy error?
Author
Owner

that would be a good option. against our initial thoughts ignoring the builders probably isn't a good idea since older versions wouldn't do that either

that would be a good option. against our initial thoughts ignoring the builders probably isn't a good idea since older versions wouldn't do that either
Sign in to join this conversation.
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lix-project/lix#1083
No description provided.