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

Unexpected error when resolving project in the current directory #531

Closed
pauloborges opened this issue Jun 14, 2024 · 1 comment · Fixed by #544
Closed

Unexpected error when resolving project in the current directory #531

pauloborges opened this issue Jun 14, 2024 · 1 comment · Fixed by #544

Comments

@pauloborges
Copy link

$ cat PklProject
amends "pkl:Project"
$ cat main.pkl
foo {
  bar = 1
}
$ tree .
.
├── PklProject
└── main.pkl

1 directory, 2 files
$ pkl project resolve .
An unexpected error has occurred. Would you mind filing a bug report?

java.lang.NullPointerException
	at org.pkl.cli.CliProjectResolver.doRun(CliProjectResolver.kt:47)
	at org.pkl.commons.cli.CliCommand.run(CliCommand.kt:45)
	at org.pkl.cli.commands.ProjectCommand$Companion$ResolveCommand.run(ProjectCommand.kt:71)
	at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:198)
	at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:211)
	at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:211)
	at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:18)
	at com.github.ajalt.clikt.core.CliktCommand.parse(CliktCommand.kt:400)
	at com.github.ajalt.clikt.core.CliktCommand.parse$default(CliktCommand.kt:397)
	at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:415)
	at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:440)
	at org.pkl.cli.Main$main$1.invoke(Main.kt:52)
	at org.pkl.cli.Main$main$1.invoke(Main.kt:40)
	at org.pkl.commons.cli.CliMainKt.cliMain(CliMain.kt:31)
	at org.pkl.cli.Main.main(Main.kt:40)
$ cd ..
$ pkl project resolve pkl-bug-report
pkl-bug-report/PklProject.deps.json
$ tree pkl-bug-report
pkl-bug-report
├── PklProject
├── PklProject.deps.json
└── main.pkl

1 directory, 3 files
@holzensp
Copy link
Contributor

I've (trivially) reproduced this with 0.26.0. The problem is the .; pkl project resolve (inside pkl-bug-report) runs without issue, as does pkl project resolve pkl-bug-report from the parent dir (as reported). Thanks for the bug report, @pauloborges!

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 a pull request may close this issue.

2 participants