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

Global pkl-gen-go fails to properly use relative project dir #48

Open
eli-l opened this issue Apr 16, 2024 · 0 comments
Open

Global pkl-gen-go fails to properly use relative project dir #48

eli-l opened this issue Apr 16, 2024 · 0 comments

Comments

@eli-l
Copy link

eli-l commented Apr 16, 2024

Simple project structure that is evaluated well with pkl eval

Screenshot 2024-04-16 at 13 22 24

Screenshot 2024-04-16 at 13 22 30

But is failing to evaluate when global pkl-gen-go is used. (go install github.com/apple/pkl-go/cmd/pkl-gen-go@latest)
Screenshot 2024-04-16 at 13 22 50

The problem could not be replicated in the cloned pkl-go repo, because generator-settings.pkl is present in the root, and project dir is built correctly (https://github.com/apple/pkl-go/blob/main/cmd/pkl-gen-go/pkl-gen-go.go#L107)

If the file in the repo is not present, settings.Uri is falling back to codegen/src/GeneratorSettings.pkl and relative settings.ProjectDir (which can be set with the flag) is not joined correctly.

Expected behaviour:
Project dir should rely on current working dir, rather than on settings file, that might be falling back to global pkg set that makes --project-dir relative paths obsolete.

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