matu3ba / chepa Goto Github PK
View Code? Open in Web Editor NEWFast checking of paths on conformance for shell coding and absence of antipatterns.
License: MIT License
Fast checking of paths on conformance for shell coding and absence of antipatterns.
License: MIT License
failing for control_sequences:
input
zig build
zig build inttest # warning: generates ca. 480MB test folders
The generated tmp.debug
that should have basename
contains f_
, so the shell prints all knowledge.
output:
debug: file 'f_
'
error: NotDir
/home/misterspoon/dev/git/zig/zig/master/lib/std/os.zig:1341:24: 0x23606a in std.os.openZ (chepa)
.NOTDIR => return error.NotDir,
^
/home/misterspoon/dev/git/zig/zig/master/lib/std/os.zig:4683:25: 0x23288a in std.os.realpathZ (chepa)
else => |e| return e,
^
/home/misterspoon/dev/git/zig/zig/master/lib/std/os.zig:4668:5: 0x230952 in std.os.realpath (chepa)
return realpathZ(&pathname_c, out_buffer);
^
/home/misterspoon/dev/git/zig/chepa/src/main.zig:179:36: 0x229f1d in main (chepa)
const rl_sup_dir = try os.realpath(p_sup_dir, &tmp_buf);
^
The following command exited with error code 1 (expected 0):
cd /home/misterspoon/dev/git/zig/chepa && /home/misterspoon/dev/git/zig/chepa/zig-out/bin/chepa /home/misters
poon/dev/git/zig/chepa/test_folders
error: UnexpectedExitCode
/home/misterspoon/dev/git/zig/zig/master/lib/std/os.zig:2720:19: 0x2b5cc2 in std.os.readlinkZ (build)
.INVAL => return error.NotLink,
^
/home/misterspoon/dev/git/zig/zig/master/lib/std/os.zig:2699:9: 0x2b6a12 in std.os.readlink (build)
return readlinkZ(&file_path_c, out_buffer);
^
/home/misterspoon/dev/git/zig/zig/master/lib/std/os.zig:2424:19: 0x29fb4b in std.os.mkdiratZ (build)
.EXIST => return error.PathAlreadyExists,
^
/home/misterspoon/dev/git/zig/zig/master/lib/std/os.zig:2386:9: 0x29fa33 in std.os.mkdirat (build)
return mkdiratZ(dir_fd, &sub_dir_path_c, mode);
^
/home/misterspoon/dev/git/zig/zig/master/lib/std/fs.zig:1270:9: 0x29f926 in std.fs.Dir.makeDir (build)
try os.mkdirat(self.fd, sub_path, default_new_dir_mode);
^
/home/misterspoon/dev/git/zig/zig/master/lib/std/build/RunStep.zig:250:17: 0x2c6cf6 in std.build.RunStep.make
(build)
return error.UnexpectedExitCode;
^
/home/misterspoon/dev/git/zig/zig/master/lib/std/build.zig:3261:9: 0x2a02ae in std.build.Step.make (build)
try self.makeFn(self);
^
/home/misterspoon/dev/git/zig/zig/master/lib/std/build.zig:505:9: 0x29f3fc in std.build.Builder.makeOneStep (
build)
try s.make();
^
/home/misterspoon/dev/git/zig/zig/master/lib/std/build.zig:499:17: 0x29f3a8 in std.build.Builder.makeOneStep
(build)
return err;
^
/home/misterspoon/dev/git/zig/zig/master/lib/std/build.zig:460:13: 0x291d71 in std.build.Builder.make (build)
try self.makeOneStep(s);
^
/home/misterspoon/dev/git/zig/zig/master/lib/std/special/build_runner.zig:209:21: 0x288506 in main (build)
else => return err,
^
int shutdown(int s, int how); // s is socket descriptor
int how can be:
SHUT_RD or 0 Further receives are disallowed: recv
SHUT_WR or 1 Further sends are disallowed: send
SHUT_RDWR or 2 Further sends and receives are disallowed, both
Further receives are disallowed
std.x.net:
ipv4, ipv6 parser requires accurate length field, but this may not be always known or desirable,
ie for performance
=> we should define an unambiguous end symbol
==> check other implementations
address:
format does use :
as delimiter, but there is no end field for the port.
=> can not be parsed back
misc:
format/print + parse should support
future: kernel abstraction testing strategy? kernel errno semantic strategies, ie machine-readable api stuff?
[user@pc chepa]$ hyperfine './zig-out/bin/chepa perf_folders/ -c' 'fd -j1 "blabla" perf_folders/'
Benchmark 1: ./zig-out/bin/chepa perf_folders/ -c
Time (mean ± σ): 606.5 ms ± 16.5 ms [User: 279.6 ms, System: 312.3 ms]
Range (min … max): 591.7 ms … 649.9 ms 10 runs
Benchmark 2: fd -j1 "blabla" perf_folders/
Time (mean ± σ): 1.355 s ± 0.021 s [User: 0.508 s, System: 0.831 s]
Range (min … max): 1.324 s … 1.396 s 10 runs
Summary
'./zig-out/bin/chepa perf_folders/ -c' ran
2.23 ± 0.07 times faster than 'fd -j1 "blabla" perf_folders/'
[user@pc chepa]$ hyperfine './zig-out/bin/chepa perf_folders/' 'fd -j1 "blabla" perf_folders/'
Benchmark 1: ./zig-out/bin/chepa perf_folders/
Time (mean ± σ): 598.5 ms ± 5.0 ms [User: 278.3 ms, System: 307.1 ms]
Range (min … max): 592.0 ms … 606.0 ms 10 runs
Benchmark 2: fd -j1 "blabla" perf_folders/
Time (mean ± σ): 1.374 s ± 0.021 s [User: 0.543 s, System: 0.816 s]
Range (min … max): 1.346 s … 1.418 s 10 runs
Summary
'./zig-out/bin/chepa perf_folders/' ran
2.30 ± 0.04 times faster than 'fd -j1 "blabla" perf_folders/'
Incomplete list to check for utf8
Other perf improvements:
Input
zig build inttest
output
The following command exited with error code 3 (expected 0):
cd /home/misterspoon/dev/git/zig/chepa && /home/misterspoon/dev/git/zig/chepa/zig-out/bin/chepa -outfile /home/misterspoon/dev/git/zig/chepa/zig-cache/tmp/inttest.txt /home/misterspoon/dev/git/zig/chepa/test_folders
error: UnexpectedExitCode
For comparison:
/home/user/dev/git/zig/chepa/zig-out/bin/chepa -outfile /home/user/dev/git/zig/chepa/zig-cache/tmp/inttest.txt /home/user/dev/git/zig/chepa/test_folders/
echo $?
succeds with
3
build.zig: StdIoAction limits make, which executes *RunStep
requires comptime-selection of string compare function, which is currently not possible in libstd.
child_process.zig ExecResult we can not reuse dependency resolving
src/test.zig is not usable and neither has custom string matching
possible solutions:
make()
of RunStep.zig
Long-term goal is to have parallelization and user-configuration of zig test_runner
, which does step 2.
However, writing the test cases into test
-blocks feels like an aweful hack and having an idea how to make it in build.zig is needed eventually anyway.
see ziglang/zig#11629 for justification.
relevant, to identify/trace where child got stuck or terminates unexpectedly (intermediate results)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.