sin-ack / zigself

An implementation of the Self programming language in Zig
GNU General Public License v3.0
161 stars 5 forks source link

Build issue on Ubuntu #7

Closed russellallen closed 2 years ago

russellallen commented 2 years ago

Hi - tried to follow instructions but got error:

ubuntu@ubuntu-on-vultr:~/unsynced$ git clone --recurse-submodules https://github.com/sin-ack/zigself
Cloning into 'zigself'...
remote: Enumerating objects: 2893, done.
remote: Counting objects: 100% (177/177), done.
remote: Compressing objects: 100% (78/78), done.
remote: Total 2893 (delta 109), reused 145 (delta 99), pack-reused 2716
Receiving objects: 100% (2893/2893), 636.01 KiB | 11.78 MiB/s, done.
Resolving deltas: 100% (1976/1976), done.
Submodule 'vendor/zig-args' (https://github.com/MasterQ32/zig-args.git) registered for path 'vendor/zig-args'
Cloning into '/home/ubuntu/unsynced/zigself/vendor/zig-args'...
remote: Enumerating objects: 201, done.        
remote: Counting objects: 100% (26/26), done.        
remote: Compressing objects: 100% (16/16), done.        
remote: Total 201 (delta 11), reused 10 (delta 10), pack-reused 175        
Receiving objects: 100% (201/201), 40.23 KiB | 8.04 MiB/s, done.
Resolving deltas: 100% (113/113), done.
Submodule path 'vendor/zig-args': checked out 'abf9a9ec6acd227bcf75efa4350d748eb43f3ed7'

ubuntu@ubuntu-on-vultr:~/unsynced$ cd zigself/

ubuntu@ubuntu-on-vultr:~/unsynced/zigself$ zig build run -- examples/fibonacci.self
./vendor/zig-args/args.zig:14:38: error: expected 2 argument(s), found 1
    const executable_name = args.next() orelse {
                                     ^
./src/main.zig:48:54: note: called from here
    const arguments = zig_args.parseForCurrentProcess(ArgumentSpec, allocator, .print) catch {
                                                     ^
./src/main.zig:43:19: note: called from here
pub fn main() !u8 {
                  ^
/snap/zig/4722/lib/std/process.zig:477:9: note: declared here
    pub fn next(self: *ArgIterator, allocator: Allocator) ?(NextError![:0]u8) {
        ^
self...The following command exited with error code 1:
/snap/zig/4722/zig build-exe /home/ubuntu/unsynced/zigself/src/main.zig --cache-dir /home/ubuntu/unsynced/zigself/zig-cache --global-cache-dir /home/ubuntu/.cache/zig --name self --pkg-begin zig-args /home/ubuntu/unsynced/zigself/vendor/zig-args/args.zig --pkg-end --enable-cache 
error: the following build command failed with exit code 1:
/home/ubuntu/unsynced/zigself/zig-cache/o/2bfb7645044eaae068e2b658ab94521d/build /snap/zig/4722/zig /home/ubuntu/unsynced/zigself /home/ubuntu/unsynced/zigself/zig-cache /home/ubuntu/.cache/zig run -- examples/fibonacci.self

This is on Ubuntu 21.10, zig 0.9.1

Cheers!

sin-ack commented 2 years ago

Hi Russell! Unfortunately the Zig compiler is in constant flux and compiler version 0.9.1 does not build the latest version of this project. You can obtain the master tarball from https://ziglang.org/download or build Zig yourself in order to build the project.

russellallen commented 2 years ago

Cool, thanks, build worked with zig version "0.10.0-dev.2054+3ed9ef3e6"

Now to play with it...