While glob patterns such as allModules = import*("**.pkl") work as intended in normal usage, they cause issues when packaging the project on Windows. Windows is not fully compatible with this pattern for path parsing, which prevents the packaging process from completing successfully. This should probably have the same behavior, and it appears to be an unintended bug that needs fixing.
Error log:
$ pkl project package src
An unexpected error has occurred. Would you mind filing a bug report?
java.nio.file.InvalidPathException: Illegal char <*> at index 0: **.pkl
at java.base@25/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:191)
at java.base@25/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:142)
at java.base@25/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:46)
at java.base@25/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
at java.base@25/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:203)
at java.base@25/java.nio.file.Path.of(Path.java:148)
at org.pkl.core.project.ProjectPackager.validateImportsAndReads(ProjectPackager.java:423)
at org.pkl.core.project.ProjectPackager.validatePklImportsAndReads(ProjectPackager.java:337)
at org.pkl.core.project.ProjectPackager.doPackage(ProjectPackager.java:162)
at org.pkl.core.project.ProjectPackager.createPackages(ProjectPackager.java:135)
at org.pkl.cli.CliProjectPackager.doRun(CliProjectPackager.kt:90)
at org.pkl.commons.cli.CliCommand.run(CliCommand.kt:48)
at org.pkl.cli.commands.PackageCommand.run(ProjectCommand.kt:139)
at com.github.ajalt.clikt.core.CoreCliktCommandKt.parse(CoreCliktCommand.kt:107)
at com.github.ajalt.clikt.core.CoreCliktCommandKt.main(CoreCliktCommand.kt:78)
at com.github.ajalt.clikt.core.CoreCliktCommandKt.main(CoreCliktCommand.kt:90)
at org.pkl.cli.Main.main$lambda$0(Main.kt:26)
at org.pkl.commons.cli.CliMainKt.cliMain(CliMain.kt:33)
at org.pkl.cli.Main.main(Main.kt:26)
at java.base@25/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)
While glob patterns such as
allModules = import*("**.pkl")work as intended in normal usage, they cause issues when packaging the project on Windows. Windows is not fully compatible with this pattern for path parsing, which prevents the packaging process from completing successfully. This should probably have the same behavior, and it appears to be an unintended bug that needs fixing.Error log: