Angus Lees
aa9d35a814
Fix bazel builds on recent macOS
...
Update `golang.org/x/sys` package to address golang/go#51706
Update bazel `rules_go` to address bazelbuild/rules_go#3199
2022-10-26 13:02:42 +01:00
Angus Lees
eaf78af502
Update cpp-jsonnet reference to match git submodule version
...
Unlike naive `go build`, bazel builds generate `astgen/stdast.go` on
the fly from cpp_jsonnet's stdlib. Cool.
Previously however, the cpp_jsonnet versions in git submodule (used by
naive `go build`) and bazel `http_archive` declarations were not in
sync. Not so cool.
This meant `bazel test //:go_default_test` failed on
`TestEval/testdata/stdlib_smoke_test`, since the stale bazel
cpp_jsonnet version lacked `std.get`.
This PR updates cpp-jsonnet to match git submodule version.
2022-10-26 11:26:50 +01:00
Angus Lees
69137c91b6
Update bazel cpp_jsonnet reference from update_cpp_jsonnet.sh
...
Teach `update_cpp_jsonnet.sh` to update the cpp_jsonnet reference in
`bazel/repositories.bzl` too.
2022-10-26 11:26:50 +01:00
Jayme Bird
3aab052ecc
fix: use rune for length over string
2022-10-25 19:30:01 +01:00
Dave Cunningham
03df4dc6e9
Revert "Don't pass version to go_register_toolchains()
by default"
...
This reverts commit c17729a921
.
2022-10-25 19:29:45 +01:00
Jayme Bird
62dbb64d72
feat: add builtin implementation test coverage
2022-10-25 16:22:34 +01:00
Jayme Bird
c7dc1bac16
feat: add benchmark data for builtin implementations
2022-10-25 16:22:34 +01:00
Jayme Bird
59e5a7be3f
feat: add builtin stripChars go impl
2022-10-25 16:22:34 +01:00
Jayme Bird
dbe6fa55d8
feat: add builtin rStripChars go impl
2022-10-25 16:22:34 +01:00
Jayme Bird
bb0d8a9d2a
feat: add builtin lStripChars go impl
2022-10-25 16:22:34 +01:00
Jayme Bird
c8492297df
feat: add builtin member go impl
2022-10-25 16:22:34 +01:00
zuiwuchang
b835910677
fix FileImporter not work on windows
2022-10-25 16:21:22 +01:00
Gustaf Lindstedt
c17729a921
Don't pass version to go_register_toolchains()
by default
...
It is disallowed to pass the version parameter if a toolchain has
already been registered.
2022-10-25 14:16:05 +01:00
mikehoyle
eac7db4471
c-bindings: Add jsonnet_realloc export
...
This adds the realloc function as an export in c-bindings.go so
that it is included in the generated header and can be used by
dependent libraries.
2022-10-21 17:55:35 +01:00
jaymebrd
635d04f264
feat: add support linter std get ( #627 )
...
* feat: add missing linter metadata for std.get
* feat: add tests cases for std.get linter with default and optional parameters
2022-10-19 06:19:49 +01:00
Jesse
2655afd2bd
memory align structs ( #635 )
...
feat: align most structs and add lint rule to enforce struct alignment
2022-10-19 06:19:15 +01:00
Jayme Bird
8abb4aa639
feat: implementation of manifestTomlEx in Go
...
Co-authored-by: Wojciech Kocjan <wojciech@kocjan.org>
2022-10-19 04:50:41 +01:00
Josh Santos
6033db5d6a
Bump golang.org/x/sys again
2022-10-19 04:22:51 +01:00
Jesse-Cameron
f346241c98
fix: remove go 1.13 → 1.16 as it's incompatible with sys
...
according to maintainers, they only support the two latest versions:
https://github.com/golang/go/issues/55078#issuecomment-1247321657
2022-10-19 04:22:05 +01:00
Jesse-Cameron
b82fd4c7f5
fix: calculate the number of elements after we convert to a slice
2022-09-27 21:46:37 +01:00
Jesse-Cameron
02194a7f8c
chore: update golden tests for fold
2022-09-27 21:46:37 +01:00
Jesse-Cameron
e9a59202cf
perf: use native builtin for foldl
and foldr
...
benchmark old ns/op new ns/op delta
Benchmark_Builtin_substr-8 17914126 16328579 -8.85%
Benchmark_Builtin_reverse-8 360776847 346691957 -3.90%
Benchmark_Builtin_parseInt-8 8686867 8314151 -4.29%
Benchmark_Builtin_base64Decode-8 22157223 21749268 -1.84%
Benchmark_Builtin_base64DecodeBytes-8 281975629 281841745 -0.05%
Benchmark_Builtin_base64-8 23824149 23716470 -0.45%
Benchmark_Builtin_base64_byte_array-8 141846327 141377054 -0.33%
Benchmark_Builtin_manifestJsonEx-8 9317781 9279067 -0.42%
Benchmark_Builtin_comparison-8 128783954 128362069 -0.33%
Benchmark_Builtin_comparison2-8 2082396660 2029123362 -2.56%
Benchmark_Builtin_foldl-8 159908963 31278937 -80.44%
2022-09-27 21:46:37 +01:00
Jesse-Cameron
953327b03c
feat(test): add foldl benchmark test
2022-09-27 21:46:37 +01:00
Jesse-Cameron
c450a168d4
perf: add size hint to map creation
...
in order to avoid unnecessary hashmap resizing, add size parameters when
creating maps
2022-09-16 18:26:18 +01:00
Jayme Bird
cb3a759621
feat: add linter testdata
2022-09-04 15:59:03 +01:00
Jayme Bird
5440cc833f
feat: add test data
2022-09-04 15:59:03 +01:00
Jayme Bird
6e180a9368
feat: add go implementation of std.parseInt
2022-09-04 15:59:03 +01:00
Moulick Aggarwal
4906958414
Bump golang.org/x/sys
2022-08-18 22:32:51 +01:00
Jayme Bird
a5ddc1c5a4
feat: add support to the jsonnet linter for std.manifestJsonMinified
2022-08-18 22:23:43 +01:00
Rudo Thomas
b42132a7a3
feat: Report native function panics as runtime errors.
...
Previously, you'd get an "INTERNAL ERROR: (CRASH)" with a full backtrace
and a link to file a bug against go-jsonnet.
2022-07-03 21:39:29 +01:00
Erik Godding Boye
32b292c9cb
Bump dependency to fatih/color
2022-05-25 11:43:43 +01:00
Tsuyoshi Hombashi
944900af83
Add maintainer info to a deb package of jsonnetfmt
2022-05-24 20:08:28 +01:00
Dave Cunningham
57d2b0517e
Remove Go 1.12 as it seems incompatible with new x/sys
2022-05-24 20:02:38 +01:00
Dave Cunningham
7032dd729f
Upgrade x/sys
2022-05-24 20:02:38 +01:00
Dave Cunningham
44ec256189
Fix wasm
2022-05-24 19:53:19 +01:00
Jack Dockerty
9e9321f69a
add non-negative check in second parameter for subStr
2022-03-18 02:06:06 +00:00
Jayme Bird
f0a060e259
feat: Add missing linter metadata for std.manifestTomlEx function
2022-03-18 02:05:38 +00:00
Greg Roodt
0d78479d37
Add go_sdk_version parameter
2022-03-18 01:51:10 +00:00
Lucendio
361f0838d9
Bump Go build version to 1.17
...
Motivation: make darwin_arm64 artifact available as part of the release
The *Installation instructions* already refers to Go v1.17 and above, and
the README.md states:
*We recommend always using the newest stable release of Go.*
Please note, that is not yet a working change set. It appears that a
go mod tidy
is needed to make the build step work.
2022-03-05 23:26:50 +00:00
Angus Lees
f699b0ea42
Add numberArrayType
linter type
...
Add `numberArrayType` specialised type for cases where we know we have
an array of numbers. Use in some stdlib functions and `importbin`.
2022-03-03 22:49:02 +00:00
Angus Lees
856bd58872
Add 'importbin' statement
...
Add `importbin` statement. Similar to `importstr` but the result is
an array of numbers (all integers 0-255).
2022-03-03 22:49:02 +00:00
Angus Lees
880ac99e75
Fix incorrect file case
2022-03-03 22:49:02 +00:00
Dave Cunningham
fb6c700f29
Prepare for v0.18.0
2021-12-21 18:34:50 +00:00
Dave Cunningham
6186bb7667
Release
2021-12-21 16:48:56 +00:00
Dave Cunningham
5c4247b3f4
Equivalent change to https://github.com/google/jsonnet/pull/898
2021-12-21 14:01:05 +00:00
Dave Cunningham
bd9f76165f
default to python3
2021-12-21 13:06:57 +00:00
Dave Cunningham
6fdbe3d728
Rest of corresponding change to formatter, see https://github.com/google/jsonnet/pull/937
2021-12-21 12:22:28 +00:00
Dave Cunningham
f60b015405
Corresponding change to formatter, see https://github.com/google/jsonnet/pull/937
2021-12-21 12:17:41 +00:00
Nicklas Frahm
68af6e05bb
Document installation for go >= 1.17
2021-12-12 17:12:52 +00:00
Tsuyoshi Hombashi
b10eae7c68
Fix gorelaser configs to properly build darwin packages ( #550 )
2021-11-01 23:01:00 +00:00