bazel-lib icon indicating copy to clipboard operation
bazel-lib copied to clipboard

Support jq on arm64 linux

Open keith opened this issue 3 years ago • 1 comments

The last official jq release, and the one these rules are currently using, was released in 2018, it sounds like the project is still alive https://github.com/stedolan/jq/issues/2305 but changes aren't happening quickly. There are some upstream issues around providing binaries for arm64 linux https://github.com/stedolan/jq/issues/1655, but so far there aren't any hosted binaries we can easily download for this.

One option to solving this would be to build jq with bazel instead of vendoring binaries. A quick google came up with these BUILD files https://github.com/attilaolah/bazel-tools/blob/master/jq.bazel which I have not tested. Another option would just be to build an arm64 binary from the last release tag and host it somewhere (like on the releases page of this repo), just to have a usable download.

keith avatar Oct 27 '22 16:10 keith

Note that our yq toolchain has an arm64 binary. Yq is supports json and is a superset of jq.

kormide avatar Oct 27 '22 17:10 kormide

Idea; https://wapm.io/syrusakbary/jq has jq as a wasm binary and can run anywhere wasmer can run which is basically every nix platform plus windows. wasmer can be introduced as a toolchain and jq ran with it.

thesayyn avatar Jan 17 '23 16:01 thesayyn

That sounds like a bit of overhead? i think the worst case alternative is we build jq manually, or host our own binary for that case?

keith avatar Jan 17 '23 16:01 keith

That sounds like a bit of overhead?

I strongly agree. If we delegate "building from the source part" to the users, then it's a viable choice. I am not a huge fan of taking another ruleset as a dependency, just to build from the source.

thesayyn avatar Jan 17 '23 16:01 thesayyn

Jq arm64 linux support will be in the 2.0.0 release.

kormide avatar Sep 21 '23 00:09 kormide

Jq arm64 linux support will be in the 2.0.0 release.

Is there an issue tracking this somewhere? I found https://github.com/jqlang/jq/issues/2386, which has a 1.7 milestone, and https://github.com/jqlang/jq/issues/2459, which doesn't have any milestone.

I'm trying to figure out what's necessary for https://github.com/bazel-contrib/rules_oci/issues/253 to be fixed.

rcorre avatar Sep 26 '23 16:09 rcorre

https://github.com/jqlang/jq/releases/tag/jq-1.7 is the available binaries as part of 1.7 release. i believe we are waiting for 2.0 release to make this breaking change.

thesayyn avatar Sep 26 '23 16:09 thesayyn

Ah, so 2.0 of bazel-lib? What makes this a breaking change?

rcorre avatar Sep 26 '23 21:09 rcorre

Ah, so 2.0 of bazel-lib? What makes this a breaking change?

Yup. We're planning to cut a bazel-lib 2.0 release in mid-late October. There were a couple of breaking changes:

  • A jq flag we were relying on for stamping support was removed, so we had to make a change that would break consumers who were stamping with jq.
  • The naming convention for the jq binaries changed, so rather than supporting pre-1.7 conventions we decided to drop them and only support 1.7+ going forward.

You can see the changes here: https://github.com/aspect-build/bazel-lib/pull/520

kormide avatar Sep 26 '23 21:09 kormide

Closing now that 2.0 is released: https://github.com/aspect-build/bazel-lib/releases/tag/v2.0.0

kormide avatar Nov 14 '23 23:11 kormide