difftreelog
Revert "Merge pull request #44 from bruno-delfino1995/use-clap-prerelease"
in: master
This reverts commit b21f06a79c9b5f758e8d2926f2dd5b2f38af715f, reversing changes made to 7a7e4e4e737dc8d1bf43a689e079fe882bfb2aeb.
7 files changed
.github/workflows/release.ymldiffbeforeafterboth--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -54,15 +54,43 @@
strategy:
matrix:
target:
+ # Tier 1
+ - aarch64-unknown-linux-gnu
+ - i686-pc-windows-gnu
+ - i686-pc-windows-msvc
+ - i686-unknown-linux-gnu
- x86_64-apple-darwin
+ - x86_64-pc-windows-gnu
- x86_64-pc-windows-msvc
- x86_64-unknown-linux-gnu
+
+ # Other
- x86_64-unknown-linux-musl
include:
+ - target: aarch64-unknown-linux-gnu
+ os: ubuntu-latest
+ bin: jrsonnet
+ name: jrsonnet-linux-gnu-aarch64
+ - target: i686-pc-windows-gnu
+ os: windows-latest
+ bin: jrsonnet.exe
+ name: jrsonnet-windows-gnu-i686.exe
+ - target: i686-pc-windows-msvc
+ os: windows-latest
+ bin: jrsonnet.exe
+ name: jrsonnet-windows-msvc-i686.exe
+ - target: i686-unknown-linux-gnu
+ os: ubuntu-latest
+ bin: jrsonnet
+ name: jrsonnet-linux-gnu-i686
- target: x86_64-apple-darwin
os: macOS-latest
bin: jrsonnet
name: jrsonnet-darwin-amd64
+ - target: x86_64-pc-windows-gnu
+ os: windows-latest
+ bin: jrsonnet.exe
+ name: jrsonnet-windows-gnu-amd64.exe
- target: x86_64-pc-windows-msvc
os: windows-latest
bin: jrsonnet.exe
@@ -71,6 +99,7 @@
os: ubuntu-latest
bin: jrsonnet
name: jrsonnet-linux-gnu-amd64
+
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
bin: jrsonnet
@@ -87,16 +116,52 @@
- name: Checkout
uses: actions/checkout@v2
+ - name: Linux x86 cross compiler
+ if: ${{ matrix.target == 'i686-unknown-linux-gnu' }}
+ run: sudo apt install gcc-multilib
+
+ - name: Windows x86 cross compiler
+ if: ${{ matrix.target == 'i686-pc-windows-gnu' }}
+ uses: egor-tensin/setup-mingw@v2
+ with:
+ platform: x86
+
+ - name: ARM cross compiler
+ if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' }}
+ uses: actions-rs/cargo@v1
+ with:
+ command: install
+ args: cross
+
+ - name: ARM gcc
+ if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' }}
+ run: sudo apt install gcc-aarch64-linux-gnu
+
+ - name: Run ARM build
+ if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' }}
+ shell: bash
+ run: cross build --bin=jrsonnet --release --target ${{ matrix.target }}
+
+ - name: Run ARM strip
+ if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' }}
+ shell: bash
+ run: aarch64-linux-gnu-strip target/${{ matrix.target }}/release/${{ matrix.bin }}
+
- name: Run build
+ if: ${{ matrix.target != 'aarch64-unknown-linux-gnu' }}
uses: actions-rs/cargo@v1
with:
command: build
args: --bin=jrsonnet --release --target ${{ matrix.target }}
+ - name: Run strip
+ if: ${{ matrix.target != 'aarch64-unknown-linux-gnu' }}
+ shell: bash
+ run: strip target/${{ matrix.target }}/release/${{ matrix.bin }}
+
- name: Package
shell: bash
run: |
- strip target/${{ matrix.target }}/release/${{ matrix.bin }}
cd target/${{ matrix.target }}/release
cp ${{ matrix.bin }} ../../../${{ matrix.name }}
Cargo.lockdiffbeforeafterboth--- a/Cargo.lock
+++ b/Cargo.lock
@@ -65,8 +65,7 @@
[[package]]
name = "clap"
version = "3.0.0-beta.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4bd1061998a501ee7d4b6d449020df3266ca3124b941ec56cf2005c3779ca142"
+source = "git+https://github.com/clap-rs/clap?rev=92f744cc49d12d32261010d355dc215a6d2487b9#92f744cc49d12d32261010d355dc215a6d2487b9"
dependencies = [
"atty",
"bitflags",
@@ -77,15 +76,13 @@
"strsim",
"termcolor",
"textwrap",
- "unicode-width",
"vec_map",
]
[[package]]
name = "clap_derive"
version = "3.0.0-beta.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "370f715b81112975b1b69db93e0b56ea4cd4e5002ac43b2da8474106a54096a1"
+source = "git+https://github.com/clap-rs/clap?rev=92f744cc49d12d32261010d355dc215a6d2487b9#92f744cc49d12d32261010d355dc215a6d2487b9"
dependencies = [
"heck",
"proc-macro-error",
@@ -97,8 +94,7 @@
[[package]]
name = "clap_generate"
version = "3.0.0-beta.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "adf420f8b687b628d2915ccfd43a660c437a170432e3fbcb66944e8717a0d68f"
+source = "git+https://github.com/clap-rs/clap?rev=92f744cc49d12d32261010d355dc215a6d2487b9#92f744cc49d12d32261010d355dc215a6d2487b9"
dependencies = [
"clap",
]
@@ -270,9 +266,9 @@
[[package]]
name = "os_str_bytes"
-version = "2.4.0"
+version = "3.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "afb2e1c3ee07430c2cf76151675e583e0f19985fa6efae47d6848a3e2c824f85"
+checksum = "e293568965aea261bdf010db17df7030e3c9a275c415d51d6112f7cf9b7af012"
[[package]]
name = "pathdiff"
@@ -420,9 +416,9 @@
[[package]]
name = "textwrap"
-version = "0.12.1"
+version = "0.13.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "203008d98caf094106cfaba70acfed15e18ed3ddb7d94e49baec153a2b462789"
+checksum = "cd05616119e612a8041ef58f2b578906cc2531a6069047ae092cfb86a325d835"
dependencies = [
"unicode-width",
]
README.mddiffbeforeafterboth1# jrsonnet2345## What is it67[Jsonnet](https://jsonnet.org/) is a data templating language89This Rust crate implements both jsonnet library and an alternative `jsonnet` executable based on it. For more information see [bindings](#Bindings).1011## Why?1213There already are multiple implementations of this standard implemented in different languages: [C++](https://github.com/google/jsonnet), [Go](https://github.com/google/go-jsonnet/), [Scala](https://github.com/databricks/sjsonnet).1415This implementation shows performance better than all existing implementations. For more information see [benchmarks](#Benchmarks).1617In the end, it's always fun to implement something in Rust.1819## How to install?2021We build x64 binaries for Apple, Windows MSVC, and Linux GNU during the release process. If your system is one of those, you can check out the [latest release](https://github.com/CertainLach/jrsonnet/releases/latest) to get your pre-built binary. Otherwise, you'll need to have a rust toolchain and install the package through cargo with `cargo install jrsonnet`.2223## Compliance with the [specification](https://jsonnet.org/ref/spec.html)2425- Passes all the original `examples` tests2627- Passes all the original `test_suite` tests except for those which require stacktraces identical to the default implementation (while also being available, vanilla-like stacktraces are not 100% identical):2829 ```jsonnet30 ## Explaining format31 ```32 RuntimeError("3")33 --> /home/lach/jsonnet-rs/a.jsonnet:1:2534 |35 1 | local a = "%0 10.20d" % error "3";36 | ^^^^^^^^^ error statement37 |38 --> /home/lach/jsonnet-rs/a.jsonnet:1:1139 |40 1 | local a = "%0 10.20d" % error "3";41 | ^^^^^^^^^^^^^^^^^^^^^^^ function <mod> call42 |43 --> /home/lach/jsonnet-rs/a.jsonnet:6:644 |45 6 | a: a,46 | ^ variable <a>47 |48 --> /home/lach/jsonnet-rs/a.jsonnet:3:649 |50 3 | b: self.a,51 | ^^^^^^ field access52 |53 --> /home/lach/jsonnet-rs/a.jsonnet:9:154 |55 9 | e.b56 | ^^^ field access57 |58 ```5960 ## Compact format (default)61 ```62 RuntimeError("3")63 /home/lach/jsonnet-rs/a.jsonnet:1:25-35: error statement64 /home/lach/jsonnet-rs/a.jsonnet:6:6-8 : variable <a>65 /home/lach/jsonnet-rs/a.jsonnet:3:6-13 : field access66 /home/lach/jsonnet-rs/a.jsonnet:9:1-5 : field access67 ```6869 ## Vanilla format70 ```71 RUNTIME ERROR: 372 a.jsonnet:1:25-34 thunk <a> from <$>73 <std>:237:21-22 thunk from <function <anonymous>>74 <std>:754:20-24 thunk from <function <anonymous>>75 <std>:32:25-26 thunk from <function <anonymous>>76 <std>:32:16-27 function <anonymous>77 <std>:754:8-25 function <anonymous>78 <std>:237:7-23 function <anonymous>7980 a.jsonnet:6:6-7 object <d>81 a.jsonnet:3:6-12 object <c>82 a.jsonnet:9:1-4 $83 During evaluation84 ```85 ```8687## Bindings8889Jrsonnet provides a standard `libjsonnet.so` shared library and should work as drop-in replacement for it9091WASM bingings are also available, Java bindings (Both JNI and WASM compiled to .class) are in progress9293See [bindings](./bindings/) for more information.9495## Benchmarks9697This is the fastest implementation of jsonnet both according to official benchmarks and real-life cluster configuration templating speed.9899Official benchmark results are available [in this gist](https://gist.github.com/CertainLach/5770d7ad4836066f8e0bd91e823e451b) which may get updated sometimes. It shows tests against Golang, C++ and Scala implementations showing the best performance in all cases.100101You can generate this report via provided nix flake102103## TO-DO list104105- [ ] Create docker container for easier benchmarking and/or benchmark in CI106- [ ] Implement and utilize mutable strings, arrays and objects instead of COWing when possible1# jrsonnet2345## What is it67[Jsonnet](https://jsonnet.org/) is a data templating language89This Rust crate implements both jsonnet library and an alternative `jsonnet` executable based on it. For more information see [bindings](#Bindings).1011## Why?1213There already are multiple implementations of this standard implemented in different languages: [C++](https://github.com/google/jsonnet), [Go](https://github.com/google/go-jsonnet/), [Scala](https://github.com/databricks/sjsonnet).1415This implementation shows performance better than all existing implementations. For more information see [benchmarks](#Benchmarks).1617In the end, it's always fun to implement something in Rust.1819## Compliance with the [specification](https://jsonnet.org/ref/spec.html)2021- Passes all the original `examples` tests2223- Passes all the original `test_suite` tests except for those which require stacktraces identical to the default implementation (while also being available, vanilla-like stacktraces are not 100% identical):2425 ```jsonnet26 ## Explaining format27 ```28 RuntimeError("3")29 --> /home/lach/jsonnet-rs/a.jsonnet:1:2530 |31 1 | local a = "%0 10.20d" % error "3";32 | ^^^^^^^^^ error statement33 |34 --> /home/lach/jsonnet-rs/a.jsonnet:1:1135 |36 1 | local a = "%0 10.20d" % error "3";37 | ^^^^^^^^^^^^^^^^^^^^^^^ function <mod> call38 |39 --> /home/lach/jsonnet-rs/a.jsonnet:6:640 |41 6 | a: a,42 | ^ variable <a>43 |44 --> /home/lach/jsonnet-rs/a.jsonnet:3:645 |46 3 | b: self.a,47 | ^^^^^^ field access48 |49 --> /home/lach/jsonnet-rs/a.jsonnet:9:150 |51 9 | e.b52 | ^^^ field access53 |54 ```5556 ## Compact format (default)57 ```58 RuntimeError("3")59 /home/lach/jsonnet-rs/a.jsonnet:1:25-35: error statement60 /home/lach/jsonnet-rs/a.jsonnet:6:6-8 : variable <a>61 /home/lach/jsonnet-rs/a.jsonnet:3:6-13 : field access62 /home/lach/jsonnet-rs/a.jsonnet:9:1-5 : field access63 ```6465 ## Vanilla format66 ```67 RUNTIME ERROR: 368 a.jsonnet:1:25-34 thunk <a> from <$>69 <std>:237:21-22 thunk from <function <anonymous>>70 <std>:754:20-24 thunk from <function <anonymous>>71 <std>:32:25-26 thunk from <function <anonymous>>72 <std>:32:16-27 function <anonymous>73 <std>:754:8-25 function <anonymous>74 <std>:237:7-23 function <anonymous>7576 a.jsonnet:6:6-7 object <d>77 a.jsonnet:3:6-12 object <c>78 a.jsonnet:9:1-4 $79 During evaluation80 ```81 ```8283## Bindings8485Jrsonnet provides a standard `libjsonnet.so` shared library and should work as drop-in replacement for it8687WASM bingings are also available, Java bindings (Both JNI and WASM compiled to .class) are in progress8889See [bindings](./bindings/) for more information.9091## Benchmarks9293This is the fastest implementation of jsonnet both according to official benchmarks and real-life cluster configuration templating speed.9495Official benchmark results are available [in this gist](https://gist.github.com/CertainLach/5770d7ad4836066f8e0bd91e823e451b) which may get updated sometimes. It shows tests against Golang, C++ and Scala implementations showing the best performance in all cases.9697You can generate this report via provided nix flake9899## TO-DO list100101- [ ] Create docker container for easier benchmarking and/or benchmark in CI102- [ ] Implement and utilize mutable strings, arrays and objects instead of COWing when possiblecmds/jrsonnet/Cargo.tomldiffbeforeafterboth--- a/cmds/jrsonnet/Cargo.toml
+++ b/cmds/jrsonnet/Cargo.toml
@@ -5,6 +5,7 @@
authors = ["Yaroslav Bolyukin <iam@lach.pw>"]
license = "MIT"
edition = "2018"
+publish = false
[features]
default = []
@@ -18,5 +19,11 @@
# TODO: Fix mimalloc compile errors, and use them
mimallocator = { version = "0.1.3", optional = true }
thiserror = "1.0"
-clap = "3.0.0-beta.2"
-clap_generate = "3.0.0-beta.2"
+
+[dependencies.clap]
+git = "https://github.com/clap-rs/clap"
+rev = "92f744cc49d12d32261010d355dc215a6d2487b9"
+
+[dependencies.clap_generate]
+git = "https://github.com/clap-rs/clap"
+rev = "92f744cc49d12d32261010d355dc215a6d2487b9"
crates/jrsonnet-cli/Cargo.tomldiffbeforeafterboth--- a/crates/jrsonnet-cli/Cargo.toml
+++ b/crates/jrsonnet-cli/Cargo.toml
@@ -5,8 +5,12 @@
authors = ["Yaroslav Bolyukin <iam@lach.pw>"]
license = "MIT"
edition = "2018"
+publish = false
[dependencies]
-jrsonnet-evaluator = { path = "../../crates/jrsonnet-evaluator", version = "0.3.7", features = ["explaining-traces"] }
-jrsonnet-parser = { path = "../../crates/jrsonnet-parser", version = "0.3.7" }
-clap = "3.0.0-beta.2"
+jrsonnet-evaluator = { path = "../../crates/jrsonnet-evaluator", version = "0.3.6", features = ["explaining-traces"] }
+jrsonnet-parser = { path = "../../crates/jrsonnet-parser", version = "0.3.6" }
+
+[dependencies.clap]
+git = "https://github.com/clap-rs/clap"
+rev = "92f744cc49d12d32261010d355dc215a6d2487b9"
crates/jrsonnet-interner/.gitignorediffbeforeafterboth--- /dev/null
+++ b/crates/jrsonnet-interner/.gitignore
@@ -0,0 +1,2 @@
+/target
+Cargo.lock
crates/jrsonnet-stdlib/Cargo.tomldiffbeforeafterboth--- a/crates/jrsonnet-stdlib/Cargo.toml
+++ b/crates/jrsonnet-stdlib/Cargo.toml
@@ -5,3 +5,7 @@
authors = ["Yaroslav Bolyukin <iam@lach.pw>"]
license = "MIT"
edition = "2018"
+
+[features]
+
+[dependencies]