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

[minor] pkl crashes when using a -o when you mean a -m for multiple output { files } #989

Open
mobileskyfi opened this issue Feb 27, 2025 · 0 comments

Comments

@mobileskyfi
Copy link

Reporting as instructed... Happens with a simple .pkl file:

name = "test"
output {
    files {
        ["\(name).txt"] {
            text = "test"
        }
      } 
}

I came here to report & saw 0.28 release. Tried it, but same crash. Here is the stack trace from with --version of Pkl 0.28.0 (macOS 14.3.1, native):

pkl eval ./Specs/test.pkl -o './Machines'
An unexpected error has occurred. Would you mind filing a bug report?

java.nio.file.FileSystemException: /Users/amm0/PklPlist/Machines: Is a directory
        at java.base@21.0.5/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:261)
        at java.base@21.0.5/java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:482)
        at java.base@21.0.5/java.nio.file.Files.newOutputStream(Files.java:227)
        at java.base@21.0.5/java.nio.file.Files.write(Files.java:3492)
        at java.base@21.0.5/java.nio.file.Files.writeString(Files.java:3714)
        at org.pkl.commons.PathsKt.writeString(Paths.kt:51)
        at org.pkl.commons.PathsKt.writeString$default(Paths.kt:46)
        at org.pkl.cli.CliEvaluator.writeOutput(CliEvaluator.kt:158)
        at org.pkl.cli.CliEvaluator.doRun(CliEvaluator.kt:100)
        at org.pkl.commons.cli.CliCommand.run(CliCommand.kt:45)
        at org.pkl.cli.commands.EvalCommand.run(EvalCommand.kt:84)
        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)

While I did read this in docs:

It is sometimes desirable for a single module to produce multiple output files. This is possible by configuring a module’s output.files property and specifying the --multiple-file-output-path (or -m for short) CLI option.

I forgot that part... I suppose it should CLI could suggest you need a -m instead, especially if given a a directory.

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

No branches or pull requests

1 participant