From e104c3db3682aa620d08980aa485ee37d685e143 Mon Sep 17 00:00:00 2001 From: Ben Haney Date: Sun, 6 Nov 2022 14:55:22 -0600 Subject: [PATCH] Support aarch64-unknown-linux-musl --- .github/workflows/release.yml | 34 +++++++++++----------------------- .gitignore | 2 ++ CHANGELOG.md | 22 +++++++++++++++++++++- README.md | 2 +- checksum-Elixir.Jsonrs.exs | 26 -------------------------- lib/jsonrs.ex | 1 + mix.exs | 4 ++-- mix.lock | 6 +++--- native/jsonrs/.cargo/config | 17 ++++++++--------- native/jsonrs/Cargo.lock | 4 +++- native/jsonrs/Cargo.toml | 2 +- 11 files changed, 53 insertions(+), 67 deletions(-) delete mode 100644 checksum-Elixir.Jsonrs.exs diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 275830f..a667544 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,8 +6,6 @@ env: on: push: - branches: - - main tags: - '*' @@ -24,25 +22,15 @@ jobs: matrix: nif: ["2.16", "2.15", "2.14"] job: - - target: arm-unknown-linux-gnueabihf - os: ubuntu-20.04 - use-cross: true - - target: aarch64-unknown-linux-gnu - os: ubuntu-20.04 - use-cross: true - - target: aarch64-apple-darwin - os: macos-11 - - target: x86_64-apple-darwin - os: macos-11 - - target: x86_64-unknown-linux-gnu - os: ubuntu-20.04 - - target: x86_64-unknown-linux-musl - os: ubuntu-20.04 - use-cross: true - - target: x86_64-pc-windows-gnu - os: windows-2019 - - target: x86_64-pc-windows-msvc - os: windows-2019 + - { target: arm-unknown-linux-gnueabihf , os: ubuntu-20.04 , use-cross: true } + - { target: aarch64-unknown-linux-gnu , os: ubuntu-20.04 , use-cross: true } + - { target: aarch64-unknown-linux-musl , os: ubuntu-20.04 , use-cross: true } + - { target: aarch64-apple-darwin , os: macos-11 } + - { target: x86_64-apple-darwin , os: macos-11 } + - { target: x86_64-unknown-linux-gnu , os: ubuntu-20.04 } + - { target: x86_64-unknown-linux-musl , os: ubuntu-20.04 , use-cross: true } + - { target: x86_64-pc-windows-gnu , os: windows-2019 } + - { target: x86_64-pc-windows-msvc , os: windows-2019 } env: RUSTLER_NIF_VERSION: ${{ matrix.nif }} @@ -89,7 +77,7 @@ jobs: if: ${{ matrix.job.use-cross }} with: binary: "cross" - version: "v0.2.2" + version: "v0.2.4" download_url: "https://github.com/cross-rs/cross/releases/download/${version}/cross-x86_64-unknown-linux-gnu.tar.gz" tarball_binary_path: "${binary}" smoke_test: "${binary} --version" @@ -154,4 +142,4 @@ jobs: with: files: | ${{ steps.rename.outputs.LIB_FINAL_PATH }} - if: startsWith(github.ref, 'refs/tags/') \ No newline at end of file + if: startsWith(github.ref, 'refs/tags/') diff --git a/.gitignore b/.gitignore index 7baffcb..17be874 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,5 @@ jsonrs-*.tar *.so native/jsonrs/target/ + +checksum-*.exs diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d01b3b..16df3a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +## [0.2.1] - 2022-11-06 +### Added +- Precompiled binary support for `aarch64-unknown-linux-musl` + +### Fixed +- Bump `rustler_precompiled` to 0.5.4 to avoid https://github.com/philss/rustler_precompiled/issues/38 + ## [0.2.0] - 2022-08-14 ### Added - Precompiled binaries via [rustler_precompiled](https://github.com/philss/rustler_precompiled) @@ -32,6 +41,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Support decoding strings with a nesting depth over 128 -## [0.1.0] - 2019-11-03 +## 0.1.0 - 2019-11-03 ### Added - Initial release + + +[Unreleased]: https://github.com/benhaney/Jsonrs/compare/v0.2.1...HEAD +[0.2.1]: https://github.com/benhaney/Jsonrs/compare/v0.2.0...v0.2.1 +[0.2.0]: https://github.com/benhaney/Jsonrs/compare/v0.1.6...v0.2.0 +[0.1.6]: https://github.com/benhaney/Jsonrs/compare/v0.1.5...v0.1.6 +[0.1.5]: https://github.com/benhaney/Jsonrs/compare/v0.1.4...v0.1.5 +[0.1.4]: https://github.com/benhaney/Jsonrs/compare/v0.1.3...v0.1.4 +[0.1.3]: https://github.com/benhaney/Jsonrs/compare/v0.1.2...v0.1.3 +[0.1.2]: https://github.com/benhaney/Jsonrs/compare/v0.1.1...v0.1.2 +[0.1.1]: https://github.com/benhaney/Jsonrs/compare/v0.1.0...v0.1.1 diff --git a/README.md b/README.md index 3ea516a..86f651c 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Add Jsonrs as a dependency in your `mix.exs` file. ```elixir def deps do - [{:jsonrs, "~> 0.2.0"}] + [{:jsonrs, "~> 0.2.1"}] end ``` diff --git a/checksum-Elixir.Jsonrs.exs b/checksum-Elixir.Jsonrs.exs deleted file mode 100644 index 18012ef..0000000 --- a/checksum-Elixir.Jsonrs.exs +++ /dev/null @@ -1,26 +0,0 @@ -%{ - "jsonrs-v0.2.0-nif-2.14-x86_64-pc-windows-gnu.dll.tar.gz" => "sha256:33c954bed8f61fb42c4a4779d525bc85541c2484b523cf8c59685cdfa493e83a", - "jsonrs-v0.2.0-nif-2.14-x86_64-pc-windows-msvc.dll.tar.gz" => "sha256:337f90ab1039261f2001927ca06f24eef852bdb628b8d782359cf8681c8dfaba", - "jsonrs-v0.2.0-nif-2.15-x86_64-pc-windows-gnu.dll.tar.gz" => "sha256:3151cc4ab4f97b445ff40120f2bc649ef089bec90dfe8b72a97039027257eced", - "jsonrs-v0.2.0-nif-2.15-x86_64-pc-windows-msvc.dll.tar.gz" => "sha256:5a8bee0d92314976347392c20c2555ea1050706b36d5ad1ae12481a3bc17abfa", - "jsonrs-v0.2.0-nif-2.16-x86_64-pc-windows-gnu.dll.tar.gz" => "sha256:0f06540ddafbd76a8f949e8ebf3a3ac5d0898baef256117df3dafebc37ea8ef4", - "jsonrs-v0.2.0-nif-2.16-x86_64-pc-windows-msvc.dll.tar.gz" => "sha256:b40ddf86ef0627bf9d8233480558c5b96d8d59cff24c820ffd64c252577f465d", - "libjsonrs-v0.2.0-nif-2.14-aarch64-apple-darwin.so.tar.gz" => "sha256:1a6fecc1ecf2870027561b8933bbde1b836d248bddf2127b837a06c985adaed1", - "libjsonrs-v0.2.0-nif-2.14-aarch64-unknown-linux-gnu.so.tar.gz" => "sha256:88a4fbdf8f44fe8b2acb18381e47c88d5648feb8408c090a75ffbdf8894eec3e", - "libjsonrs-v0.2.0-nif-2.14-arm-unknown-linux-gnueabihf.so.tar.gz" => "sha256:29a748eddbdcb7cb2e9b0234c553c33ca8d184c5a827abf26c6b33fe2219fe8a", - "libjsonrs-v0.2.0-nif-2.14-x86_64-apple-darwin.so.tar.gz" => "sha256:c7817606be90beb303714f0e9ea0d1e679f367b30e33d0eda0a070011bfc310a", - "libjsonrs-v0.2.0-nif-2.14-x86_64-unknown-linux-gnu.so.tar.gz" => "sha256:6a7042404be2b46a0370f0bc858189601a1cd7daff08fe580a4faba2b7a555a5", - "libjsonrs-v0.2.0-nif-2.14-x86_64-unknown-linux-musl.so.tar.gz" => "sha256:edb02c1fd1313aec29041f834c561972e49684ccf1269a70257b6bcfeb1b7c77", - "libjsonrs-v0.2.0-nif-2.15-aarch64-apple-darwin.so.tar.gz" => "sha256:f60e7502767ef1b46bc435033fa1b099198742b71f3ee4bdcfe69d0e6343dfe0", - "libjsonrs-v0.2.0-nif-2.15-aarch64-unknown-linux-gnu.so.tar.gz" => "sha256:610d38113621190a9b60d0ba91476e2b8f1b081a4690316fe9ed4a8935eb84fa", - "libjsonrs-v0.2.0-nif-2.15-arm-unknown-linux-gnueabihf.so.tar.gz" => "sha256:07053f794e5182b79e5a1c92afd52d9678d80a8676a8968d0afc33c9ea512018", - "libjsonrs-v0.2.0-nif-2.15-x86_64-apple-darwin.so.tar.gz" => "sha256:114ae45b4dceae64ee49ea4b03e5f25df2924fcffbfee9af971e547ede2beea0", - "libjsonrs-v0.2.0-nif-2.15-x86_64-unknown-linux-gnu.so.tar.gz" => "sha256:7770d3b4cc91179f9b94e05d7d4e872dfff2e09635fcf41b1a2b8c0d47dc0081", - "libjsonrs-v0.2.0-nif-2.15-x86_64-unknown-linux-musl.so.tar.gz" => "sha256:eea95d55b6c50ea70808724660c9aa62a7861ec8edfd067bdedbfaebf50fee4f", - "libjsonrs-v0.2.0-nif-2.16-aarch64-apple-darwin.so.tar.gz" => "sha256:200a404c00177e31be5a4398b535234d8c899409f15bd4d4d862c7631655df31", - "libjsonrs-v0.2.0-nif-2.16-aarch64-unknown-linux-gnu.so.tar.gz" => "sha256:a7342ed6a39490e97e09799146c98493cefd4a6f8f6487d6698c708b4e7e4880", - "libjsonrs-v0.2.0-nif-2.16-arm-unknown-linux-gnueabihf.so.tar.gz" => "sha256:f969dee4817da0b90519451232b6119687f84be371e4ad2d9d1eff4588cee45c", - "libjsonrs-v0.2.0-nif-2.16-x86_64-apple-darwin.so.tar.gz" => "sha256:acb2563cc8d49e5ca61ce71bbd38465b52951f6ed45ef5cbabe0da43a925fc89", - "libjsonrs-v0.2.0-nif-2.16-x86_64-unknown-linux-gnu.so.tar.gz" => "sha256:4d37f9c0b960ebde8664a68e5af2a77f2833d00deaa3ca22ca8ce70d12a944a4", - "libjsonrs-v0.2.0-nif-2.16-x86_64-unknown-linux-musl.so.tar.gz" => "sha256:c8937134d3ad4cf6fafc43b4b77253577886cd5744c3a883dfb47b28e9463204", -} diff --git a/lib/jsonrs.ex b/lib/jsonrs.ex index ce08c1e..0c07485 100644 --- a/lib/jsonrs.ex +++ b/lib/jsonrs.ex @@ -9,6 +9,7 @@ defmodule Jsonrs do use RustlerPrecompiled, otp_app: :jsonrs, base_url: "#{source_url}/releases/download/v#{version}", force_build: System.get_env("FORCE_JSONRS_BUILD") in ["1", "true"], + targets: RustlerPrecompiled.Config.default_targets() ++ ["aarch64-unknown-linux-musl"], version: version @spec nif_encode!(term) :: String.t() diff --git a/mix.exs b/mix.exs index 51f677a..a05e202 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule Jsonrs.MixProject do use Mix.Project - @version "0.2.0" + @version "0.2.1" def project do [ @@ -28,7 +28,7 @@ defmodule Jsonrs.MixProject do # Run "mix help deps" to learn about dependencies. defp deps do [ - {:rustler_precompiled, "~> 0.5"}, + {:rustler_precompiled, "~> 0.5.4"}, {:rustler, "~> 0.25.0", optional: true}, {:ex_doc, "~> 0.27", only: :dev, runtime: false}, ] diff --git a/mix.lock b/mix.lock index 05fd433..b00f9a0 100644 --- a/mix.lock +++ b/mix.lock @@ -3,12 +3,12 @@ "earmark": {:hex, :earmark, "1.4.2", "3aa0bd23bc4c61cf2f1e5d752d1bb470560a6f8539974f767a38923bb20e1d7f", [:mix], [], "hexpm"}, "earmark_parser": {:hex, :earmark_parser, "1.4.26", "f4291134583f373c7d8755566122908eb9662df4c4b63caa66a0eabe06569b0a", [:mix], [], "hexpm", "48d460899f8a0c52c5470676611c01f64f3337bad0b26ddab43648428d94aabc"}, "ex_doc": {:hex, :ex_doc, "0.28.4", "001a0ea6beac2f810f1abc3dbf4b123e9593eaa5f00dd13ded024eae7c523298", [:mix], [{:earmark_parser, "~> 1.4.19", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "bf85d003dd34911d89c8ddb8bda1a958af3471a274a4c2150a9c01c78ac3f8ed"}, - "jason": {:hex, :jason, "1.3.0", "fa6b82a934feb176263ad2df0dbd91bf633d4a46ebfdffea0c8ae82953714946", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "53fc1f51255390e0ec7e50f9cb41e751c260d065dcba2bf0d08dc51a4002c2ac"}, + "jason": {:hex, :jason, "1.4.0", "e855647bc964a44e2f67df589ccf49105ae039d4179db7f6271dfd3843dc27e6", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "79a3791085b2a0f743ca04cec0f7be26443738779d09302e01318f97bdb82121"}, "makeup": {:hex, :makeup, "1.1.0", "6b67c8bc2882a6b6a445859952a602afc1a41c2e08379ca057c0f525366fc3ca", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "0a45ed501f4a8897f580eabf99a2e5234ea3e75a4373c8a52824f6e873be57a6"}, "makeup_elixir": {:hex, :makeup_elixir, "0.16.0", "f8c570a0d33f8039513fbccaf7108c5d750f47d8defd44088371191b76492b0b", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "28b2cbdc13960a46ae9a8858c4bebdec3c9a6d7b4b9e7f4ed1502f8159f338e7"}, "makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"}, "nimble_parsec": {:hex, :nimble_parsec, "1.2.3", "244836e6e3f1200c7f30cb56733fd808744eca61fd182f731eac4af635cc6d0b", [:mix], [], "hexpm", "c8d789e39b9131acf7b99291e93dae60ab48ef14a7ee9d58c6964f59efb570b0"}, "rustler": {:hex, :rustler, "0.25.0", "32526b51af7e58a740f61941bf923486ce6415a91c3934cc16c281aa201a2240", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:toml, "~> 0.6", [hex: :toml, repo: "hexpm", optional: false]}], "hexpm", "6b43a11a37fe79c6234d88c4102ab5dfede7a6a764dc5c7b539956cfa02f3cf4"}, - "rustler_precompiled": {:hex, :rustler_precompiled, "0.5.1", "93df423bd7b14b67dcacf994443d132d300623f80756974cac4febeab40af74a", [:mix], [{:castore, "~> 0.1", [hex: :castore, repo: "hexpm", optional: false]}, {:rustler, "~> 0.23", [hex: :rustler, repo: "hexpm", optional: true]}], "hexpm", "3f8cbc8e92eef4e1a71bf441b568b868b16a3730f63f5b803c68073017e30b13"}, - "toml": {:hex, :toml, "0.6.2", "38f445df384a17e5d382befe30e3489112a48d3ba4c459e543f748c2f25dd4d1", [:mix], [], "hexpm", "d013e45126d74c0c26a38d31f5e8e9b83ea19fc752470feb9a86071ca5a672fa"}, + "rustler_precompiled": {:hex, :rustler_precompiled, "0.5.4", "34f79a8bdeeb094590b6d88a03469c90d2192c45ac10afcae2acf4f1b925b2dc", [:mix], [{:castore, "~> 0.1", [hex: :castore, repo: "hexpm", optional: false]}, {:rustler, "~> 0.23", [hex: :rustler, repo: "hexpm", optional: true]}], "hexpm", "c5a078315c5f450281f75c0953b14535fbaaad737b85a97a2b72983f45cc30d2"}, + "toml": {:hex, :toml, "0.7.0", "fbcd773caa937d0c7a02c301a1feea25612720ac3fa1ccb8bfd9d30d822911de", [:mix], [], "hexpm", "0690246a2478c1defd100b0c9b89b4ea280a22be9a7b313a8a058a2408a2fa70"}, } diff --git a/native/jsonrs/.cargo/config b/native/jsonrs/.cargo/config index a9dde60..47a041e 100644 --- a/native/jsonrs/.cargo/config +++ b/native/jsonrs/.cargo/config @@ -1,20 +1,19 @@ -[target.x86_64-apple-darwin] +[target.'cfg(target_os = "macos")'] rustflags = [ - "-C", "link-arg=-undefined", - "-C", "link-arg=dynamic_lookup", + "-C", "link-arg=-undefined", + "-C", "link-arg=dynamic_lookup", ] -[target.aarch64-apple-darwin] +# See https://github.com/rust-lang/rust/issues/59302 +[target.x86_64-unknown-linux-musl] rustflags = [ - "-C", "link-arg=-undefined", - "-C", "link-arg=dynamic_lookup", + "-C", "target-feature=-crt-static" ] -# See https://github.com/rust-lang/rust/issues/59302 -[target.x86_64-unknown-linux-musl] +[target.aarch64-unknown-linux-musl] rustflags = [ "-C", "target-feature=-crt-static" ] [profile.release] -lto = true \ No newline at end of file +lto = true diff --git a/native/jsonrs/Cargo.lock b/native/jsonrs/Cargo.lock index a6a81bf..5f43a13 100644 --- a/native/jsonrs/Cargo.lock +++ b/native/jsonrs/Cargo.lock @@ -1,5 +1,7 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + [[package]] name = "aho-corasick" version = "0.7.18" @@ -23,7 +25,7 @@ checksum = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" [[package]] name = "jsonrs" -version = "0.2.0" +version = "0.2.1" dependencies = [ "lazy_static", "rustler", diff --git a/native/jsonrs/Cargo.toml b/native/jsonrs/Cargo.toml index bc8c5b5..7f520b7 100644 --- a/native/jsonrs/Cargo.toml +++ b/native/jsonrs/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jsonrs" -version = "0.2.0" +version = "0.2.1" authors = [] edition = "2018"