Skip to content

Commit

Permalink
Support aarch64-unknown-linux-musl
Browse files Browse the repository at this point in the history
  • Loading branch information
benhaney committed Nov 6, 2022
1 parent f700143 commit e104c3d
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 67 deletions.
34 changes: 11 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ env:

on:
push:
branches:
- main
tags:
- '*'

Expand All @@ -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 }}
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -154,4 +142,4 @@ jobs:
with:
files: |
${{ steps.rename.outputs.LIB_FINAL_PATH }}
if: startsWith(github.ref, 'refs/tags/')
if: startsWith(github.ref, 'refs/tags/')
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ jsonrs-*.tar
*.so

native/jsonrs/target/

checksum-*.exs
22 changes: 21 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
26 changes: 0 additions & 26 deletions checksum-Elixir.Jsonrs.exs

This file was deleted.

1 change: 1 addition & 0 deletions lib/jsonrs.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Jsonrs.MixProject do
use Mix.Project

@version "0.2.0"
@version "0.2.1"

def project do
[
Expand All @@ -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},
]
Expand Down
6 changes: 3 additions & 3 deletions mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
}
17 changes: 8 additions & 9 deletions native/jsonrs/.cargo/config
Original file line number Diff line number Diff line change
@@ -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
lto = true
4 changes: 3 additions & 1 deletion native/jsonrs/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion native/jsonrs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "jsonrs"
version = "0.2.0"
version = "0.2.1"
authors = []
edition = "2018"

Expand Down

0 comments on commit e104c3d

Please sign in to comment.