Skip to content

Commit 642217f

Browse files
ityonemorbino
andauthored
0.13.0 (E-xyza#481)
* Update to Zig 0.13 (E-xyza#480) * Fix Elixir 1.17 compilation warnings * Update to Zig 0.13 * sets documentation correct and correct dependency --------- Co-authored-by: Riccardo Binetti <[email protected]>
1 parent 781b45a commit 642217f

File tree

11 files changed

+31
-22
lines changed

11 files changed

+31
-22
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ by adding `zigler` to your list of dependencies in `mix.exs`:
1919
```elixir
2020
def deps do
2121
[
22-
{:zigler, "~> 0.12.1", runtime: false}
22+
{:zigler, "~> 0.13.0", runtime: false}
2323
]
2424
end
2525
```
@@ -43,7 +43,7 @@ have difficulty.
4343
```erlang
4444
{plugins, [rebar_mix]}.
4545

46-
{deps, [{zigler, "0.12"}]}.
46+
{deps, [{zigler, "0.13"}]}.
4747

4848
```
4949

VERSIONS.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ Thanks to Dave Cottlehuber @dch for testing.
135135
- smarter `beam.send`
136136
- attributes imported as compile-time values
137137

138+
## 0.13.0
139+
- updated to zig 0.13.0
140+
138141
## Upcoming
139142
- `precompiled` mode that will let you obtain packages with precompiled assets.
140143
- Breaking changes:
@@ -143,4 +146,4 @@ Thanks to Dave Cottlehuber @dch for testing.
143146

144147
## Possible
145148
- `beam.call` which lets you call back a beam function.
146-
- `struct` which lets you declare a struct inside your zig code as the module's struct
149+
- `struct` which lets you declare a struct inside your zig code as the module's struct

installer/mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ end
66
defmodule Zig.Get.MixProject do
77
use Mix.Project
88

9-
@version "0.12.2"
9+
@version "0.13.0"
1010
@scm_url "https://github.com/e-xyza/zigler"
1111

1212
@elixir_requirement "~> 1.14"

installer/mix.tasks/zig.get.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ defmodule Mix.Tasks.Zig.Get do
9393
end
9494
end
9595

96-
@default_version "0.12.1"
96+
@default_version "0.13.0"
9797

9898
defp defaults do
9999
{os, arch} = Zig.Get.os_info()

lib/zig.ex

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,16 @@ defmodule Zig do
3030
3131
Please consult the following guides for detailed topics:
3232
33-
- [Using Nifs](1-nifs.html)
34-
- [Collection datatypes](2-collections.html)
35-
- [Allocator strategies](3-allocators.html)
36-
- [Nif options](4-nif_options.html)
37-
- [Resources](5-nif_options.html)
38-
- [C integration](6-c_integration.html)
39-
- [Concurrency strategies](7-concurrency.html)
40-
- [Global module options](8-module_options.html)
41-
- [Raw calling](9-raw_nifs.html)
33+
- [Using Nifs](01-nifs.html)
34+
- [Collection datatypes](02-collections.html)
35+
- [Allocator strategies](03-allocators.html)
36+
- [Nif options](04-nif_options.html)
37+
- [Resources](05-resources.html)
38+
- [C integration](06-c_integration.html)
39+
- [Concurrency strategies](07-concurrency.html)
40+
- [Global module options](08-module_options.html)
41+
- [Raw calling](09-raw_nifs.html)
42+
- [Module callbacks](10-callbacks.html)
4243
4344
> ### Zig version support {: .warning }
4445
>

lib/zig/templates/build.zig.eex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ pub fn build(b: *std.Build) void {
9090

9191
const lib = b.addSharedLibrary(.{
9292
.name = "<%= @module %>",
93-
.root_source_file = .{.path = "module.zig"},
93+
.root_source_file = .{ .src_path = .{ .owner = b, .sub_path = "module.zig"} },
9494
.version = .{.major = <%= @version.major %>,
9595
.minor = <%= @version.minor %>,
9696
.patch = <%= @version.patch %>},

lib/zig/type/enum.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ defmodule Zig.Type.Enum do
8282

8383
defp accumulate(number, []), do: [number]
8484
defp accumulate(number, [succ | rest]) when succ == number + 1, do: [number..succ | rest]
85-
defp accumulate(number, [succ..last | rest]) when succ == number + 1, do: [number..last | rest]
85+
defp accumulate(number, [succ..last//1 | rest]) when succ == number + 1, do: [number..last | rest]
8686
defp accumulate(number, noncontiguous), do: [number | noncontiguous]
8787

8888
defp unionize(content) do
@@ -95,7 +95,7 @@ defmodule Zig.Type.Enum do
9595
end)
9696
end
9797

98-
defp rerender(a..b) do
98+
defp rerender(a..b//1) do
9999
quote do
100100
unquote(a)..unquote(b)
101101
end

mix.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule Zigler.MixProject do
22
use Mix.Project
33

4-
def zig_version, do: "0.12.1"
4+
def zig_version, do: "0.13.0"
55

66
def project do
77
env = Mix.env()
@@ -72,7 +72,7 @@ defmodule Zigler.MixProject do
7272
{:zig_parser, "~> 0.4.0"},
7373
# utility to help manage type protocols
7474
{:protoss, "~> 0.2"},
75-
{:zig_get, "~> 0.12.1"},
75+
{:zig_get, "== 0.13.0"},
7676
# documentation
7777
{:markdown_formatter, "~> 0.6", only: :dev, runtime: false},
7878
{:zig_doc, "~> 0.4.0", only: :dev, runtime: false}

mix.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
"pegasus": {:hex, :pegasus, "0.2.5", "38123461fe41add54f715ce41f89137a31cd217d353005b057f88b9b67c39b6f", [:mix], [{:nimble_parsec, "~> 1.2", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "ee80708608807f4447f1da1e6e0ebd9604f5bda4fbe2d4bdd9aa6dd67afde020"},
1515
"protoss": {:hex, :protoss, "0.2.1", "fcf437ed65178d6cbf9a600886e3da9f7173697223972f062ee593941c2588b1", [:mix], [], "hexpm", "2261dbdc4d5913ce1e88d1410108d97f21140a118f45f6acc3edc4ecdb952052"},
1616
"zig_doc": {:hex, :zig_doc, "0.4.0", "fdaee133165fa3c3a17e8ff7d62ab60be4ad011ff128d567151dbca2026f44d0", [:mix], [{:ex_doc, "~> 0.34.2", [hex: :ex_doc, repo: "hexpm", optional: false]}, {:zig_parser, "~> 0.4.0", [hex: :zig_parser, repo: "hexpm", optional: false]}], "hexpm", "d07c69a210d7ae3732493bf7e55628e30c4a68fec47c244e3f40f6c7323b819d"},
17-
"zig_get": {:hex, :zig_get, "0.12.2", "713de7f73c508386e7ac93c8479b1e196a24834c95fd03f1dd3dc8133857c063", [:mix], [{:jason, "~> 1.4", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "81a5c562fdef8b4affd28a94a41a725c355b26021f5a8ddb550f19d319aa3010"},
17+
"zig_get": {:hex, :zig_get, "0.13.0", "527df0ca1c6a745c9173ce76f4ac7451d5cf251673bbcfda67bdffdb355def16", [:mix], [{:jason, "~> 1.4", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "adbba1bef93d8a5103ca2c51da9086e50cd0c95c6b2283fb5b57b1a102dea0c4"},
1818
"zig_parser": {:hex, :zig_parser, "0.4.0", "5230576fcea30c061f08f6053448ad3dc5194a45485065564a7f8047bb351ce9", [:mix], [{:pegasus, "~> 0.2.4", [hex: :pegasus, repo: "hexpm", optional: false]}], "hexpm", "ec54cf14e80a1485e29a80b42756d0421426db81eb9e2630721fd46ab5c21bcb"},
1919
}

test/_support/compiler.ex

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ defmodule ZiglerTest.Compiler do
2727
end
2828

2929
def compile_erlang(file) do
30-
{:ok, mod} = :compile.file(file, [:return_errors, outdir: :code.lib_dir(:zigler, :ebin)])
30+
{:ok, mod} =
31+
:compile.file(file, [
32+
:return_errors,
33+
outdir: :filename.join(:code.lib_dir(:zigler), ~c"ebin")
34+
])
35+
3136
Code.ensure_loaded(mod)
3237
end
3338
end

0 commit comments

Comments
 (0)