Skip to content

Conversation

rudo-thomas
Copy link
Contributor

This makes /dev/stdin work again in --tla-code-file, at least on the jvm target. See #448

My #432 broke it.

$ echo '{a:1}' | sjsonnet-0.5.2.jar --tla-code-file f=/dev/stdin -e 'function(f)f'
{
   "a": 1
}

$ echo '{a:1}' | sjsonnet-master-36ecd2a7448d77b729786dd6336029475aba0eae.jar \
  --debug-importer --tla-code-file f=/dev/stdin -e 'function(f)f'
[import /dev/stdin] candidate /dev/stdin
[import /dev/stdin] /dev/stdin is selected as it exists
[read OsPath(/dev/stdin)] file does not exist or is not a file
[read OsPath(/home/r/git/upstream/sjsonnet/<tla-var f>)] file does not exist or is not a file
Exception in thread "main" sjsonnet.Error: Couldn't import file: "/dev/stdin"
	at [Import].(<tla-var f> offset:0)
	at [ValidId f].(<exec>:1:12)

$ echo '{a:1}' | ./out/sjsonnet/jvm/3.3.6/assembly.dest/out.jar --tla-code-file f=/dev/stdin -e 'function(f)f'
{
   "a": 1
}

…rectory.

This makes `/dev/stdin` work again in `--tla-code-file`, at least on the
jvm target. See databricks#448

My databricks#432 broke it.

```
$ echo '{a:1}' | sjsonnet-0.5.2.jar --tla-code-file f=/dev/stdin -e 'function(f)f'
{
   "a": 1
}

$ echo '{a:1}' | sjsonnet-master-36ecd2a7448d77b729786dd6336029475aba0eae.jar \
  --debug-importer --tla-code-file f=/dev/stdin -e 'function(f)f'
[import /dev/stdin] candidate /dev/stdin
[import /dev/stdin] /dev/stdin is selected as it exists
[read OsPath(/dev/stdin)] file does not exist or is not a file
[read OsPath(/home/r/git/upstream/sjsonnet/<tla-var f>)] file does not exist or is not a file
Exception in thread "main" sjsonnet.Error: Couldn't import file: "/dev/stdin"
	at [Import].(<tla-var f> offset:0)
	at [ValidId f].(<exec>:1:12)

$ echo '{a:1}' | ./out/sjsonnet/jvm/3.3.6/assembly.dest/out.jar --tla-code-file f=/dev/stdin -e 'function(f)f'
{
   "a": 1
}
@stephenamar-db stephenamar-db merged commit 128eacc into databricks:master Jun 25, 2025
6 checks passed
@rudo-thomas rudo-thomas deleted the rudo-thomas/importer-read-non-dirs branch June 26, 2025 16:53
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 this pull request may close these issues.

2 participants