Code Monkey home page Code Monkey logo

mewz's People

Contributors

ainozaki avatar dierbei avatar naoki9911 avatar saza-ku avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

mewz's Issues

Support all of WASI preview1 functions

The support status for WASI functions is as follows:

  • args_get
  • args_sizes_get
  • environ_get (but no environment variables support)
  • environ_sizes_get
  • clock_res_get
  • clock_time_get
  • fd_advise
  • fd_allocate
  • fd_close
  • fd_datasync
  • fd_fdstat_get
  • fd_fdstat_set_flags
  • fd_fdstat_set_rights
  • fd_filestat_get
  • fd_filestat_set_size
  • fd_filestat_set_times
  • fd_pread
  • fd_prestat_get
  • fd_prestat_dir_name
  • fd_pwrite
  • fd_read
  • fd_readdir
  • fd_renumber
  • fd_seek
  • fd_sync
  • fd_tell
  • fd_write
  • path_create_directory
  • path_filestat_get
  • path_filestat_set_times
  • path_link
  • path_open
  • path_readlink
  • path_remove_directory
  • path_rename
  • path_symlink
  • path_unlink_file
  • poll_oneoff
  • proc_exit
  • proc_raise
  • sched_yield
  • random_get
  • sock_accept
  • sock_recv
  • sock_send
  • sock_shutdown

Add a test for reading a file

We need a test for reading a file.

  • path_open to open a file
  • fd_read to read the file content, and compare it with the expected content
  • fd_close to close the file

`ghcr.io/mewz-project/mewz` can't be pulled

$ docker pull ghcr.io/mewz-project/mewz
Using default tag: latest
latest: Pulling from mewz-project/mewz
af107e978371: Pulling fs layer 
4278792552db: Pulling fs layer 
9c01b7de78bf: Pulling fs layer 
3245434c345b: Waiting 
e438c664582f: Waiting 
1f89fd20aea9: Waiting 
3aff96a866aa: Waiting 
45bc183e102b: Waiting 
7a8408419b6b: Waiting 
7070c6497c75: Waiting 
error pulling image configuration: download failed after attempts=1: unknown blob

Some blobs such as sha256:96eb8313ddf564d2d66a262eaa10266ab06aa5933da279021aa3623ce5e740f3 (application/vnd.docker.container.image.v1+json) seems missing
https://explore.ggcr.dev/?image=ghcr.io%2Fmewz-project%2Fmewz%40sha256%3A8039c6107729564632b502735086f8d27357e4630e67d665068bb2663e2abab7

Handle file descriptors as `usize`

File descriptors are handled as i32 in WASI functions arguments, like this.

pub export fn fd_close(fd: i32) callconv(.C) WasiError

We pass them around as i32. But indices must be usize in Zig, so we must cast them every time we index the file descriptor table.

    pub fn get(self: *Self, fd: i32) ?*Stream {
        const streams = self.streams.acquire();
        defer self.streams.release();
        const s = &streams.*[@as(usize, @intCast(fd))];
        if (s.* == null) {
            return null;
        }

        return @as(*Stream, @ptrCast(s));
    }

To avoid it, we want to cast fd to usize in WASI functions, and handle it as usize in stream module.

devcontainer fails with `zig build`

I am a zig newbie and would like to try to learn.

I'm having problems compiling mewz, I run zig build with the following error. Can you help me with this? Thanks for the help.

root ➜ /workspaces/mewz (main) $ zig build
++ git rev-parse --show-toplevel
++ git rev-parse --show-toplevel
+ REPO_ROOT=/workspaces/mewz
+ cd /workspaces/mewz
+ REPO_ROOT=/workspaces/mewz
+ cd /workspaces/mewz
+ ls build/newlib/libc.a
+ mkdir -p build/lwip
ls: cannot access 'build/newlib/libc.a': No such file or directory
+ mkdir -p build/newlib
+ cd build/lwip
+ cmake ../../lwip-wrapper
+ cd build/newlib
+ ../../submodules/newlib/newlib/configure --target=x86_64-elf --disable-multilib --prefix=/usr/local/newlib-x86_64-elf
./scripts/build-newlib.sh: line 12: ../../submodules/newlib/newlib/configure: No such file or directory
run ./scripts/build-newlib.sh: error: the following command exited with error code 127:
./scripts/build-newlib.sh 
CMake Warning (dev) in CMakeLists.txt:
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

    project(ProjectName)

  near the top of the file, but after cmake_minimum_required().

  CMake is pretending there is a "project(Project)" command on the first
  line.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at CMakeLists.txt:15 (include):
  include could not find requested file:

    /workspaces/mewz/lwip-wrapper/../submodules/lwip/src/Filelists.cmake


CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.25)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!
See also "/workspaces/mewz/build/lwip/CMakeFiles/CMakeOutput.log".
run ./scripts/build-lwip.sh: error: the following command exited with error code 1:
./scripts/build-lwip.sh 
Build Summary: 1/6 steps succeeded; 2 failed (disable with --summary none)
install transitive failure
└─ install mewz.elf transitive failure
   └─ zig build-exe mewz.elf Debug x86_64-freestanding transitive failure
      ├─ run ./scripts/build-newlib.sh failure
      └─ run ./scripts/build-lwip.sh failure
error: the following build command failed with exit code 1:
/workspaces/mewz/zig-cache/o/7c36e40cbb2402eb80e289dd70bd7100/build /usr/bin/zig/zig /workspaces/mewz /workspaces/mewz/zig-cache /root/.cache/zig --seed 0xd3f16844

integration test fails on Codespaces

zig build -Dtest=true -Doptimize=ReleaseFast -Dlog-level=debug run

[LOG INFO]: available memory: 14495000 - 1ffe0000
[LOG INFO]: pci: found device at bus 0, slot 0, func 0
[LOG INFO]: pci: vendor id: 8086
[LOG INFO]: pci: device id: 1237
[LOG INFO]: pci: found device at bus 0, slot 1, func 0
[LOG INFO]: pci: vendor id: 8086
[LOG INFO]: pci: device id: 7000
[LOG INFO]: pci: found device at bus 0, slot 1, func 1
[LOG INFO]: pci: vendor id: 8086
[LOG INFO]: pci: device id: 7010
[LOG INFO]: pci: found device at bus 0, slot 1, func 3
[LOG INFO]: pci: vendor id: 8086
[LOG INFO]: pci: device id: 7113
[LOG INFO]: pci: found device at bus 0, slot 2, func 0
[LOG INFO]: pci: vendor id: 1234
[LOG INFO]: pci: device id: 1111
[LOG INFO]: pci: found device at bus 0, slot 3, func 0
[LOG INFO]: pci: vendor id: 1af4
[LOG INFO]: pci: device id: 1041
[LOG DEBUG]: offset: 0
[LOG DEBUG]: offset: 12288
[LOG DEBUG]: notify_off_multiplier: 4
[LOG DEBUG]: offset: 8192
[LOG DEBUG]: offset: 4096
[LOG DEBUG]: offset: 0
[LOG INFO]: mac: 52:54:0:12:34:56
[LOG DEBUG]: FILES_MAX: 200
[LOG DEBUG]: directory: ./
[LOG DEBUG]: regular file: ./output.txt
[LOG DEBUG]: regular file: ./test.txt
[LOG DEBUG]: root directory: fd=3, path=./

[LOG DEBUG]: WASI memory_grow: 1
[LOG INFO]: base: 0
[LOG DEBUG]: WASI sock_open: 1 2 0
[LOG INFO]: client socket test: sock_open succeeded
[LOG DEBUG]: WASI sock_connect: 4 4 80
[LOG DEBUG]: interrupt
[LOG DEBUG]: interrupt
[LOG INFO]: client socket test: sock_connect succeeded
[LOG DEBUG]: WASI fd_write: 4 12 2 52
[LOG INFO]: client socket t[LOG DEBUG]: interrupt
est: fd_write succeeded
[LOG DEBUG]: WASI sock_getlocaladdr: 4 4 40 44
[LOG DEBUG]: interrupt
[LOG DEBUG]: interrupt
[LOG DEBUG]: interrupt
[LOG INFO]: sock_getlocaladdr failed: 80.161.56.4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.