Skip to content

runtime: fix a bug where durations from @lute/fs would not work correctly without requiring @lute/time#958

Merged
aatxe merged 5 commits intoprimaryfrom
awe/fix-time-initialization
Apr 8, 2026
Merged

runtime: fix a bug where durations from @lute/fs would not work correctly without requiring @lute/time#958
aatxe merged 5 commits intoprimaryfrom
awe/fix-time-initialization

Conversation

@aatxe
Copy link
Copy Markdown
Member

@aatxe aatxe commented Apr 8, 2026

A strange bug got reported on Discord (and unfortunately they never made a ticket here) where durations that the user got from @lute/fs would ultimately behave incorrectly when @lute/time was not imported into that script. The underlying cause is that the metatable was not initialized when @lute/time was not imported, and therefore the code that constructs the durations in @lute/fs would look for a duration metatable that did not exist and just set the metatable to nil. We fix this by making initialization of the duration library idempotent and then invoking that initialization for @lute/fs as well.

@aatxe aatxe self-assigned this Apr 8, 2026
@aatxe aatxe added the runtime Work in the C++ runtime portion of the code label Apr 8, 2026
@aatxe aatxe added this to the Release A milestone Apr 8, 2026
@aatxe aatxe merged commit e381b55 into primary Apr 8, 2026
15 checks passed
@aatxe aatxe deleted the awe/fix-time-initialization branch April 8, 2026 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

runtime Work in the C++ runtime portion of the code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants