Skip to content

Commit

Permalink
zig: update to zig/0.8.1
Browse files Browse the repository at this point in the history
Adapt *.zig to changes in the zig library, and Makefile/run to the new
output path for executables.

Build system:
* avoid symbolic links to executables.  They increase complexity, are
  not useful, their timestamps or existence confuse make.
* Acknowledge that Makefile is unable to build each step separately.

Step files:
* Add commented instructions printing `ast` at the start of the EVAL
  loop.

The state in this commit now crashes with:
/lib/std/hash_map.zig:863:33: 0x20ea58 in std.hash_map.HashMap([]const
u8,*types.MalType,std.hash_map.StringContext,80).get (step6_file)
Build with release-safe until this segmentation fault is fixed

The original author has been contacted and intends to investigate.
  • Loading branch information
asarhaddon committed Sep 28, 2021
1 parent 7eaac96 commit 1e63471
Show file tree
Hide file tree
Showing 22 changed files with 413 additions and 422 deletions.
15 changes: 4 additions & 11 deletions impls/zig/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:bionic
FROM ubuntu:20.04
MAINTAINER Joel Martin <[email protected]>

##########################################################
Expand All @@ -11,23 +11,16 @@ RUN apt-get -y update
# Required for running tests
RUN apt-get -y install make python

# Some typical implementation and test requirements
RUN apt-get -y install curl libreadline-dev libedit-dev libpcre3-dev

RUN mkdir -p /mal
WORKDIR /mal

##########################################################
# Specific implementation requirements
##########################################################

RUN apt-get -y install gcc gdc ldc gpg wget
RUN apt-get -y install ca-certificates curl gcc libc-dev libpcre3-dev libreadline-dev xz-utils

RUN wget https://ziglang.org/download/0.5.0/zig-linux-x86_64-0.5.0.tar.xz && \
echo `pwd` && \
tar -xf zig-linux-x86_64-0.5.0.tar.xz && \
cp -r zig-linux-x86_64-0.5.0 /usr/local/bin && \
ln -sf /usr/local/bin/zig-linux-x86_64-0.5.0/zig /usr/local/bin/zig && \
chmod +x /usr/local/bin/zig
RUN curl https://ziglang.org/download/0.8.1/zig-linux-x86_64-0.8.1.tar.xz | tar -xJC/mal
RUN ln -fst/usr/local/bin /mal/zig-linux-x86_64-0.8.1/zig

ENV HOME /mal
14 changes: 7 additions & 7 deletions impls/zig/Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@

STEPS = step0_repl step1_read_print step2_eval step3_env step4_if_fn_do step5_tco step6_file step7_quote step8_macros step9_try stepA_mal

all: $(STEPS)
# TODO: it would be nice to be able to rebuild only one step.

dist: mal
# safe until the segfault is fixed.
# make HARD=1 REGRESS=1 test^zig
# was absent from 1c76e857f8f40c46a9b08274a26a0cca7fb20c77 with zig/0.5.0


%: %.zig
zig build -Drelease-fast=true
ln -sf zig-cache/bin/$* .
all $(STEPS):
zig build -Drelease-safe=true

.PHONY: clean

clean:
rm -f $(STEPS)
rm -fr zig-cache zig-out
Loading

0 comments on commit 1e63471

Please sign in to comment.