Skip to content

local_zig still downloads from upstream #241

Closed
@dch

Description

@dch

I did a minimal zigler nif https://git.sr.ht/~dch/ziggle using hex published 0.7.2 & zig 0.7.1 & also tried latest master.

  • zig still downloads from upstream instead of using local version
  • then blows out spectacularly, I'm not yet clear whats happening but I think we're missing some includes/headers
  • BTW can you publish the tags you're using to publish to hex, also to the zigler github repo?

Any suggestions?

 mix compile
Compiling 1 file (.ex)

15:54:39.817 [debug] compiling nif for module Ziggle in path /tmp/.zigler_compiler/dev/Elixir.Ziggle

15:54:39.880 [debug] wrote build.zig to /tmp/.zigler_compiler/dev/Elixir.Ziggle/build.zig

== Compilation error in file lib/ziggle.ex ==
** (CompileError)  this zig compiler warning hasn't been incorporated into the parser.
Please file a report at:
https://github.com/ityonemo/zigler/issues
error(compilation): clang failed with stderr: In file included from /tmp/ziggle/deps/zigler/zig/zig-freebsd-x86_64-0.7.1/lib/zig/libunwind/src/libunwind.cpp:12:
In file included from /tmp/ziggle/deps/zigler/zig/zig-freebsd-x86_64-0.7.1/lib/zig/libunwind/include/libunwind.h:18:
In file included from /tmp/ziggle/deps/zigler/zig/zig-freebsd-x86_64-0.7.1/lib/zig/libcxx/include/stdint.h:106:
/tmp/ziggle/deps/zigler/zig/zig-freebsd-x86_64-0.7.1/lib/zig/libcxx/include/__config:247:12: fatal error: 'sys/endian.h' file not found

error(compilation): clang failed with stderr: In file included from /tmp/ziggle/deps/zigler/zig/zig-freebsd-x86_64-0.7.1/lib/zig/libunwind/src/Unwind-seh.cpp:13:
/tmp/ziggle/deps/zigler/zig/zig-freebsd-x86_64-0.7.1/lib/zig/libunwind/src/config.h:16:10: fatal error: 'assert.h' file not found

error(compilation): clang failed with stderr: In file included from /tmp/ziggle/deps/zigler/zig/zig-freebsd-x86_64-0.7.1/lib/zig/libunwind/src/UnwindLevel1.c:21:
/tmp/ziggle/deps/zigler/zig/zig-freebsd-x86_64-0.7.1/lib/zig/include/inttypes.h:21:15: fatal error: 'inttypes.h' file not found

error(compilation): clang failed with stderr: In file included from /tmp/ziggle/deps/zigler/zig/zig-freebsd-x86_64-0.7.1/lib/zig/libunwind/src/UnwindLevel1-gcc-ext.c:12:
/tmp/ziggle/deps/zigler/zig/zig-freebsd-x86_64-0.7.1/lib/zig/include/inttypes.h:21:15: fatal error: 'inttypes.h' file not found

error(compilation): clang failed with stderr: In file included from /tmp/ziggle/deps/zigler/zig/zig-freebsd-x86_64-0.7.1/lib/zig/libunwind/src/Unwind-sjlj.c:14:
/tmp/ziggle/deps/zigler/zig/zig-freebsd-x86_64-0.7.1/lib/zig/include/inttypes.h:21:15: fatal error: 'inttypes.h' file not found

error(compilation): /tmp/ziggle/deps/zigler/zig/zig-freebsd-x86_64-0.7.1/lib/zig/libunwind/src/libunwind.cpp:1:1: unable to build C object: clang exited with code 1

error(compilation): /tmp/ziggle/deps/zigler/zig/zig-freebsd-x86_64-0.7.1/lib/zig/libunwind/src/Unwind-seh.cpp:1:1: unable to build C object: clang exited with code 1

error(compilation): /tmp/ziggle/deps/zigler/zig/zig-freebsd-x86_64-0.7.1/lib/zig/libunwind/src/UnwindLevel1.c:1:1: unable to build C object: clang exited with code 1

error(compilation): /tmp/ziggle/deps/zigler/zig/zig-freebsd-x86_64-0.7.1/lib/zig/libunwind/src/UnwindLevel1-gcc-ext.c:1:1: unable to build C object: clang exited with code 1

error(compilation): /tmp/ziggle/deps/zigler/zig/zig-freebsd-x86_64-0.7.1/lib/zig/libunwind/src/Unwind-sjlj.c:1:1: unable to build C object: clang exited with code 1

error: unable to build libunwind: BuildingLibCObjectFailed
Elixir.Ziggle...The following command exited with error code 1:
/tmp/ziggle/deps/zigler/zig/zig-freebsd-x86_64-0.7.1/zig build-lib /tmp/.zigler_compiler/dev/Elixir.Ziggle/Elixir.Ziggle.zig --single-threaded --cache-dir /tmp/.zigler_compiler/dev/Elixir.Ziggle/zig-cache --global-cache-dir /home/dch/.cache/zig --name Elixir.Ziggle --version 0.1 -dynamic -target x86_64-freebsd-gnu -isystem /usr/local/lib/erlang23/erts-11.1.7/include -isystem /tmp/ziggle/deps/zigler/zig/zig-freebsd-x86_64-0.7.1/lib/libc/musl/include -isystem /tmp/ziggle/deps/zigler/zig/zig-freebsd-x86_64-0.7.1/lib/libc/include/x86_64-freebsd-musl --enable-cache 
error: the following build command failed with exit code 1:
/tmp/.zigler_compiler/dev/Elixir.Ziggle/zig-cache/o/4c955e129d544a6d30f2b514bffab757/build /tmp/ziggle/deps/zigler/zig/zig-freebsd-x86_64-0.7.1/zig /tmp/.zigler_compiler/dev/Elixir.Ziggle /tmp/.zigler_compiler/dev/Elixir.Ziggle/zig-cache /home/dch/.cache/zig

    (zigler 0.7.2) lib/zig/parser/error.ex:54: Zig.Parser.Error.parse/2
    (zigler 0.7.2) lib/zig/command.ex:36: Zig.Command.compile/2
    (zigler 0.7.2) lib/zig/compiler.ex:102: Zig.Compiler.compilation/2
    (zigler 0.7.2) expanding macro: Zig.Compiler.__before_compile__/1
    lib/ziggle.ex:1: Ziggle (module)

Using a full local zig with the same hack as last time:

$ mkdir -p deps/zigler/zig/zig-freebsd-x86_64-0.7.1 \
  && ln -s /usr/local/bin/zig deps/zigler/zig/zig-freebsd-x86_64-0.7.1/zig \
  && ln -s /usr/local/lib deps/zigler/zig/zig-freebsd-x86_64-0.7.1/lib
dch@z01 /u/h/d/s/z/ziggle (main)> tree -Fap deps/zigler/zig
deps/zigler/zig
├── [drwxr-xr-x]  zig-freebsd-x86_64-0.7.1/
│   ├── [lrwxr-xr-x]  lib -> /usr/local/lib/
│   └── [lrwxr-xr-x]  zig -> /usr/local/bin/zig
└── [-rw-r--r--]  zig-freebsd-x86_64-0.7.1.tar.xz

2 directories, 2 files
$  mix do compile, test
Compiling 1 file (.ex)

16:39:49.757 [debug] compiling nif for module Ziggle in path /tmp/.zigler_compiler/dev/Elixir.Ziggle

16:39:49.821 [debug] wrote build.zig to /tmp/.zigler_compiler/dev/Elixir.Ziggle/build.zig
Compiling lib/ziggle.ex (it's taking more than 10s)

== Compilation error in file lib/ziggle.ex ==
** (CompileError)  this zig compiler warning hasn't been incorporated into the parser.
Please file a report at:
https://github.com/ityonemo/zigler/issues
error(compilation): clang failed with stderr: In file included from /usr/local/lib/zig/libunwind/src/Unwind-sjlj.c:14:
/usr/local/lib/zig/include/inttypes.h:21:15: fatal error: 'inttypes.h' file not found

error(compilation): clang failed with stderr: In file included from /usr/local/lib/zig/libunwind/src/Unwind-seh.cpp:13:
/usr/local/lib/zig/libunwind/src/config.h:16:10: fatal error: 'assert.h' file not found

error(compilation): clang failed with stderr: In file included from /usr/local/lib/zig/libunwind/src/UnwindLevel1.c:21:
/usr/local/lib/zig/include/inttypes.h:21:15: fatal error: 'inttypes.h' file not found

error(compilation): clang failed with stderr: In file included from /usr/local/lib/zig/libunwind/src/UnwindLevel1-gcc-ext.c:12:
/usr/local/lib/zig/include/inttypes.h:21:15: fatal error: 'inttypes.h' file not found

error(compilation): clang failed with stderr: In file included from /usr/local/lib/zig/libunwind/src/libunwind.cpp:12:
In file included from /usr/local/lib/zig/libunwind/include/libunwind.h:18:
In file included from /usr/local/lib/zig/libcxx/include/stdint.h:106:
/usr/local/lib/zig/libcxx/include/__config:247:12: fatal error: 'sys/endian.h' file not found

error(compilation): /usr/local/lib/zig/libunwind/src/Unwind-sjlj.c:1:1: unable to build C object: clang exited with code 1

error(compilation): /usr/local/lib/zig/libunwind/src/Unwind-seh.cpp:1:1: unable to build C object: clang exited with code 1

error(compilation): /usr/local/lib/zig/libunwind/src/UnwindLevel1.c:1:1: unable to build C object: clang exited with code 1

error(compilation): /usr/local/lib/zig/libunwind/src/UnwindLevel1-gcc-ext.c:1:1: unable to build C object: clang exited with code 1

error(compilation): /usr/local/lib/zig/libunwind/src/libunwind.cpp:1:1: unable to build C object: clang exited with code 1

error: unable to build libunwind: BuildingLibCObjectFailed
Elixir.Ziggle...The following command exited with error code 1:
/usr/local/bin/zig build-lib /tmp/.zigler_compiler/dev/Elixir.Ziggle/Elixir.Ziggle.zig --single-threaded --cache-dir /tmp/.zigler_compiler/dev/Elixir.Ziggle/zig-cache --global-cache-dir /home/dch/.cache/zig --name Elixir.Ziggle --version 0.1 -dynamic -target x86_64-freebsd-gnu -isystem /usr/local/lib/erlang23/erts-11.1.7/include -isystem /usr/home/dch/src/zig/ziggle/deps/zigler/zig/zig-freebsd-x86_64-0.7.1/lib/libc/musl/include -isystem /usr/home/dch/src/zig/ziggle/deps/zigler/zig/zig-freebsd-x86_64-0.7.1/lib/libc/include/x86_64-freebsd-musl --enable-cache 
error: the following build command failed with exit code 1:
/tmp/.zigler_compiler/dev/Elixir.Ziggle/zig-cache/o/200da5397a70b244375bad7e52bbfd99/build /usr/local/bin/zig /tmp/.zigler_compiler/dev/Elixir.Ziggle /tmp/.zigler_compiler/dev/Elixir.Ziggle/zig-cache /home/dch/.cache/zig

    (zigler 0.7.2) lib/zig/parser/error.ex:54: Zig.Parser.Error.parse/2
    (zigler 0.7.2) lib/zig/command.ex:36: Zig.Command.compile/2
    (zigler 0.7.2) lib/zig/compiler.ex:102: Zig.Compiler.compilation/2
    (zigler 0.7.2) expanding macro: Zig.Compiler.__before_compile__/1
    lib/ziggle.ex:1: Ziggle (module)

which is ... equally bad

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions