Skip to content

Do not store file extensions in module chunknames [Luau CLI]#1772

Merged
aatxe merged 1 commit intomasterfrom
vrn-sn/fix-require-chunknames-in-repl
Apr 13, 2025
Merged

Do not store file extensions in module chunknames [Luau CLI]#1772
aatxe merged 1 commit intomasterfrom
vrn-sn/fix-require-chunknames-in-repl

Conversation

@vrn-sn
Copy link
Member

@vrn-sn vrn-sn commented Apr 13, 2025

The Luau CLI's require implementation was moved to the new Luau.Require library in release 0.669.

In this implementation, chunknames correspond to abstract module paths (not exact filesystems paths), and this is enforced throughout the require-by-string algorithm whenever a newly required module's chunkname is created. The only place this is not being enforced is at the entry point of the Luau CLI: the chunkname of the given file still includes its file extension, which breaks the invariant expected by the require-by-string implementation.

This PR removes that file extension from the entry point's chunkname.

Fixes #1771.

@aatxe aatxe merged commit 50f32a1 into master Apr 13, 2025
6 of 8 checks passed
@aatxe aatxe deleted the vrn-sn/fix-require-chunknames-in-repl branch April 13, 2025 17:31
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.

Regression in string requires

2 participants