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

import pathing doesn't match go-jsonnet #111

Open
jregehr opened this issue May 10, 2023 · 4 comments
Open

import pathing doesn't match go-jsonnet #111

jregehr opened this issue May 10, 2023 · 4 comments
Assignees

Comments

@jregehr
Copy link

jregehr commented May 10, 2023

Within a jsonnet or libsonnet file, the import command seems to operate from the directory where jrsonnet was invoked. The LIbrary search dirs (either -J or JSONNET_PATH) weren't respected either.

In general, the import functionality doesn't match the go-jsonnet implementation.

@CertainLach
Copy link
Owner

CertainLach commented May 10, 2023

Is it?

out
├── a.jsonnet
├── b.jsonnet
└── library
    └── c.jsonnet

a.jsonnet:

import 'b.jsonnet'

b.jsonnet:

import 'c.jsonnet'

c.jsonnet:

1 + 2

Running jrsonnet out/a.jsonnet -J out/library yields 3.
So import operates on paths relative to calling file, and library paths are respected.

Do you have concrete examples where it behaves wrong? Is this problem in jrsonnet itself, or in the project, which is using jrsonnet as a library? Which version of jrsonnet do you use?

@jregehr
Copy link
Author

jregehr commented May 11, 2023

I'll try to work up a concrete example. I have a pretty extensive jSonnet project and my jsonnet invocations also have two library paths. When I run my generate script with go-jsonnet it works; with jrsonnet it fails.

I like the idea of faster runtimes for jrsonnet vs. jsonnet.

@CertainLach
Copy link
Owner

Don't you have symlinks lying around, by any chance?

@jregehr
Copy link
Author

jregehr commented Oct 6, 2023

@CertainLach could you clarify your question? Are you asking if I have symlinks in use in my jsonnet libraries? I didn't up until this week. I do have them now but I did not have them when I opened the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants