logo

deblob

remove binary executables from a directory git clone https://hacktivis.me/git/deblob.git
commit: 7951340c25d642d6220008b84f6dc21b3544c078
parent 892cea67c587c4058761eea74e0587638ed213fe
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Thu,  3 Nov 2022 00:15:18 +0100

Add support for NekoVM bytecode

Diffstat:

Mdeblob.12++
Mmain.ha7+++++--
Mtest/fixtures/Makefile5++++-
Atest/fixtures/hello.n0
Atest/fixtures/hello.neko4++++
5 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/deblob.1 b/deblob.1 @@ -73,6 +73,8 @@ Device Tree Blob, typically .Sq *.dtb .It Chez Scheme bytecode +.It +NekoVM bytecode .El .Sh EXAMPLES The following code block shows how it can be used in Gentoo's diff --git a/main.ha b/main.ha @@ -45,6 +45,7 @@ const magic: [_][]u8 = [ ['p', 'e', 'r', 'l', '-', 's', 't', 'o', 'r', 'e'], // Perl Storable(v0.6) ['p', 's', 't', '0'], // Perl Storable(v0.7) [0x00, 0x00, 0x00, 0x00, 'c', 'h', 'e', 'z'], // Chez Scheme bytecode + ['N', 'E', 'K', 'O'], // NekoVM Bytecode ]; const dos_magic: []u8 = ['M', 'Z']; const pe_magic: []u8 = ['P', 'E', 0x00, 0x00]; @@ -89,6 +90,7 @@ fn is_blob(filename: str) (bool | fs::error | io::error) = { (false, "test/fixtures/hello.erl"), (false, "test/fixtures/hello.java"), (false, "test/fixtures/hello.lua"), + (false, "test/fixtures/hello.neko"), (false, "test/fixtures/hello.nqp"), (false, "test/fixtures/hello.pir"), (false, "test/fixtures/hello.py"), @@ -102,6 +104,7 @@ fn is_blob(filename: str) (bool | fs::error | io::error) = { (true, "test/fixtures/hello.exe"), (true, "test/fixtures/hello.luac53"), (true, "test/fixtures/hello.luac54"), + (true, "test/fixtures/hello.n"), (true, "test/fixtures/hello.nqp.moarvm"), (true, "test/fixtures/hello.o"), (true, "test/fixtures/hello.pir.pbc"), @@ -212,7 +215,7 @@ fn check_dir(dirname: str) (void | errors::invalid) = { case let e: fs::error => fmt::fatalf("os::readdir({}): {}", dirname, fs::strerror(e)); }; - assert(len(files_before) == 40); + assert(len(files_before) == 42); const ret = check_dir(dirname); assert(ret is void); @@ -223,7 +226,7 @@ fn check_dir(dirname: str) (void | errors::invalid) = { case let e: fs::error => fmt::fatalf("os::readdir({}): {}", dirname, fs::strerror(e)); }; - assert(len(files_after) == 24); + assert(len(files_after) == 25); }; export fn main() void = { diff --git a/test/fixtures/Makefile b/test/fixtures/Makefile @@ -14,7 +14,7 @@ DTC ?= dtc CHEZ ?= chezscheme NONBUNDLED_BLOBS = hello hello.a hello.o -TEST_BLOBS = $(NONBUNDLED_BLOBS) hello.exe hello.luac53 hello.luac54 hello.wasm hello.class hello.nqp.moarvm hello.pir.pbc perl_storage.pst hello.beam empty.dtb hello-chez.so +TEST_BLOBS = $(NONBUNDLED_BLOBS) hello.exe hello.luac53 hello.luac54 hello.wasm hello.class hello.nqp.moarvm hello.pir.pbc perl_storage.pst hello.beam empty.dtb hello-chez.so hello.n base: $(NONBUNDLED_BLOBS) @@ -69,3 +69,6 @@ empty.dtb: empty.dts hello-chez.so: hello-chez.ss echo '(compile-file "hello-chez.ss")' | $(CHEZ) -q + +hello.n: hello.neko + nekoc hello.neko diff --git a/test/fixtures/hello.n b/test/fixtures/hello.n Binary files differ. diff --git a/test/fixtures/hello.neko b/test/fixtures/hello.neko @@ -0,0 +1,4 @@ +// SPDX-FileCopyrightText: 2019-2022 deblob Authors <https://hacktivis.me/projects/deblob> +// SPDX-License-Identifier: BSD-3-Clause + +$print("Hello World!\n");