Skip to content

Commit

Permalink
feat: update cpp-jsonnet and stdlib to latest (unreleased)
Browse files Browse the repository at this point in the history
This includes the stdlib additions in
google/jsonnet#1187

Also updates golden files for go-jsonnet tests; the changes
to the goldens are mostly changes to error locations from
the standard library.
  • Loading branch information
johnbartholomew committed Jan 18, 2025
1 parent b3fed3b commit 74c8d09
Show file tree
Hide file tree
Showing 14 changed files with 41,118 additions and 30,217 deletions.
71,247 changes: 41,075 additions & 30,172 deletions astgen/stdast.go

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ load(
)

# NB: update_cpp_jsonnet.sh looks for these.
CPP_JSONNET_SHA256 = "ac01553989006ba61a09dad5b016facaaa58186260eb28f79936e942cb1d1692"
CPP_JSONNET_GITHASH = "f45e01d632b29e4c0757ec7ba188ce759298e6d3"
CPP_JSONNET_SHA256 = "9e545f17b614c89d40d1f58d7f8fceded4cc93d1d29edfd8a93833b61201fd20"
CPP_JSONNET_GITHASH = "4487bfb8ba7ed7a3d91d79d4a1aa2205e7839558"

def jsonnet_go_repositories():
http_archive(
Expand Down
2 changes: 1 addition & 1 deletion cpp-jsonnet
Submodule cpp-jsonnet updated 367 files
4 changes: 2 additions & 2 deletions testdata/assert_equal4.golden
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
RUNTIME ERROR: Assertion failed. {"x": 1} != {"x": 2}
-------------------------------------------------
<std>:826:7-50 function <anonymous>
<std>:850:7-56 function <anonymous>

error 'Assertion failed. ' + a + ' != ' + b,
error 'Assertion failed. ' + astr + ' != ' + bstr,

-------------------------------------------------
testdata/assert_equal4:1:1-32 $
Expand Down
8 changes: 3 additions & 5 deletions testdata/assert_equal5.golden
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
RUNTIME ERROR: Assertion failed.
!=

RUNTIME ERROR: Assertion failed. "\n " != "\n"
-------------------------------------------------
<std>:826:7-50 function <anonymous>
<std>:850:7-56 function <anonymous>

error 'Assertion failed. ' + a + ' != ' + b,
error 'Assertion failed. ' + astr + ' != ' + bstr,

-------------------------------------------------
testdata/assert_equal5:1:1-29 $
Expand Down
6 changes: 3 additions & 3 deletions testdata/assert_equal6.golden
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
RUNTIME ERROR: Assertion failed.  !=
RUNTIME ERROR: Assertion failed. "\u001b[31m" != ""
-------------------------------------------------
<std>:826:7-50 function <anonymous>
<std>:850:7-56 function <anonymous>

error 'Assertion failed. ' + a + ' != ' + b,
error 'Assertion failed. ' + astr + ' != ' + bstr,

-------------------------------------------------
testdata/assert_equal6:1:1-34 $
Expand Down
2 changes: 1 addition & 1 deletion testdata/percent_bad.golden
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
RUNTIME ERROR: Operator % cannot be used on types number and string.
-------------------------------------------------
<std>:251:7-94 function <anonymous>
<std>:262:7-94 function <anonymous>

error 'Operator % cannot be used on types ' + std.type(a) + ' and ' + std.type(b) + '.',

Expand Down
8 changes: 4 additions & 4 deletions testdata/percent_bad2.golden
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
RUNTIME ERROR: Too many values to format: 1, expected 0
-------------------------------------------------
<std>:696:11-86 function <format_codes_arr>
<std>:716:11-86 function <format_codes_arr>

error ('Too many values to format: ' + std.length(arr) + ', expected ' + j)

-------------------------------------------------
<std>:702:11-59 function <format_codes_arr>
<std>:722:11-59 function <format_codes_arr>

format_codes_arr(codes, arr, i + 1, j, v + code) tailstrict

-------------------------------------------------
<std>:793:7-48 function <anonymous>
<std>:813:7-48 function <anonymous>

format_codes_arr(codes, [vals], 0, 0, ''),

-------------------------------------------------
<std>:249:7-23 function <anonymous>
<std>:260:7-23 function <anonymous>

std.format(a, b)

Expand Down
2 changes: 1 addition & 1 deletion testdata/percent_bad3.golden
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
RUNTIME ERROR: Operator % cannot be used on types function and number.
-------------------------------------------------
<std>:251:7-94 function <anonymous>
<std>:262:7-94 function <anonymous>

error 'Operator % cannot be used on types ' + std.type(a) + ' and ' + std.type(b) + '.',

Expand Down
8 changes: 4 additions & 4 deletions testdata/percent_format_str4.golden
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
RUNTIME ERROR: Too many values to format: 2, expected 1
-------------------------------------------------
<std>:696:11-86 function <format_codes_arr>
<std>:716:11-86 function <format_codes_arr>

error ('Too many values to format: ' + std.length(arr) + ', expected ' + j)

-------------------------------------------------
<std>:702:11-59 function <format_codes_arr>
<std>:722:11-59 function <format_codes_arr>

format_codes_arr(codes, arr, i + 1, j, v + code) tailstrict

-------------------------------------------------
<std>:789:7-46 function <anonymous>
<std>:809:7-46 function <anonymous>

format_codes_arr(codes, vals, 0, 0, '')

-------------------------------------------------
<std>:249:7-23 function <anonymous>
<std>:260:7-23 function <anonymous>

std.format(a, b)

Expand Down
14 changes: 7 additions & 7 deletions testdata/percent_format_str5.golden
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
RUNTIME ERROR: Not enough values to format: 1, expected more than 1
-------------------------------------------------
<std>:729:15-103 thunk <val> from <function <format_codes_arr>>
<std>:749:15-103 thunk <val> from <function <format_codes_arr>>

error ('Not enough values to format: ' + std.length(arr) + ', expected more than ' + j2);

-------------------------------------------------
<std>:734:27-30 thunk from <thunk <s> from <function <format_codes_arr>>>
<std>:754:27-30 thunk from <thunk <s> from <function <format_codes_arr>>>

format_code(val, code, tmp.fw, tmp2.prec, j2);

-------------------------------------------------
<std>:604:22-25 thunk from <function <format_code>>
<std>:624:22-25 thunk from <function <format_code>>

std.toString(val)

-------------------------------------------------
<std>:604:9-26 function <format_code>
<std>:624:9-26 function <format_code>

std.toString(val)

-------------------------------------------------
... (skipped 10 frames)
-------------------------------------------------
<std>:745:11-64 function <format_codes_arr>
<std>:765:11-64 function <format_codes_arr>

format_codes_arr(codes, arr, i + 1, j3, v + s_padded) tailstrict;

-------------------------------------------------
<std>:789:7-46 function <anonymous>
<std>:809:7-46 function <anonymous>

format_codes_arr(codes, vals, 0, 0, '')

-------------------------------------------------
<std>:249:7-23 function <anonymous>
<std>:260:7-23 function <anonymous>

std.format(a, b)

Expand Down
14 changes: 7 additions & 7 deletions testdata/percent_format_str6.golden
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
RUNTIME ERROR: Not enough values to format: 1, expected more than 1
-------------------------------------------------
<std>:729:15-103 thunk <val> from <function <format_codes_arr>>
<std>:749:15-103 thunk <val> from <function <format_codes_arr>>

error ('Not enough values to format: ' + std.length(arr) + ', expected more than ' + j2);

-------------------------------------------------
<std>:734:27-30 thunk from <thunk <s> from <function <format_codes_arr>>>
<std>:754:27-30 thunk from <thunk <s> from <function <format_codes_arr>>>

format_code(val, code, tmp.fw, tmp2.prec, j2);

-------------------------------------------------
<std>:604:22-25 thunk from <function <format_code>>
<std>:624:22-25 thunk from <function <format_code>>

std.toString(val)

-------------------------------------------------
<std>:604:9-26 function <format_code>
<std>:624:9-26 function <format_code>

std.toString(val)

-------------------------------------------------
... (skipped 10 frames)
-------------------------------------------------
<std>:745:11-64 function <format_codes_arr>
<std>:765:11-64 function <format_codes_arr>

format_codes_arr(codes, arr, i + 1, j3, v + s_padded) tailstrict;

-------------------------------------------------
<std>:793:7-48 function <anonymous>
<std>:813:7-48 function <anonymous>

format_codes_arr(codes, [vals], 0, 0, ''),

-------------------------------------------------
<std>:249:7-23 function <anonymous>
<std>:260:7-23 function <anonymous>

std.format(a, b)

Expand Down
14 changes: 7 additions & 7 deletions testdata/percent_format_str7.golden
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
RUNTIME ERROR: Format required number at 0, got string
-------------------------------------------------
<std>:(607:11)-(608:47) function <format_code>
<std>:(627:11)-(628:47) function <format_code>

error 'Format required number at '
+ i + ', got ' + std.type(val)

-------------------------------------------------
<std>:734:15-60 thunk <s> from <function <format_codes_arr>>
<std>:754:15-60 thunk <s> from <function <format_codes_arr>>

format_code(val, code, tmp.fw, tmp2.prec, j2);

-------------------------------------------------
<std>:739:24-25 thunk from <thunk <s_padded> from <function <format_codes_arr>>>
<std>:759:24-25 thunk from <thunk <s_padded> from <function <format_codes_arr>>>

pad_left(s, tmp.fw, ' ');

-------------------------------------------------
<std>:492:30-33 thunk from <thunk from <function <pad_left>>>
<std>:512:30-33 thunk from <thunk from <function <pad_left>>>

padding(w - std.length(str), s) + str;

-------------------------------------------------
... (skipped 7 frames)
-------------------------------------------------
<std>:745:11-64 function <format_codes_arr>
<std>:765:11-64 function <format_codes_arr>

format_codes_arr(codes, arr, i + 1, j3, v + s_padded) tailstrict;

-------------------------------------------------
<std>:789:7-46 function <anonymous>
<std>:809:7-46 function <anonymous>

format_codes_arr(codes, vals, 0, 0, '')

-------------------------------------------------
<std>:249:7-23 function <anonymous>
<std>:260:7-23 function <anonymous>

std.format(a, b)

Expand Down
2 changes: 1 addition & 1 deletion testdata/percent_mod_int5.golden
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
RUNTIME ERROR: Division by zero.
-------------------------------------------------
<std>:247:7-23 function <anonymous>
<std>:258:7-23 function <anonymous>

std.modulo(a, b)

Expand Down

0 comments on commit 74c8d09

Please sign in to comment.