chore: import upstream snapshot with attribution
CI / Deep Native Runtime Cases (1/6) (push) Has been skipped
CI / Native Preflight (push) Failing after 1s
CI / Native Runtime Cases (1/2) (push) Failing after 0s
CI / Native Runtime Cases (2/2) (push) Failing after 1s
CI / Native Metadata Reports (push) Failing after 0s
CI / Native Direct Backend Artifacts (push) Failing after 0s
CI / Native Sanitizer Smoke (push) Failing after 1s
CI / Command Contract Snapshots (push) Failing after 1s
CI / Deep Conformance Suite (push) Has been skipped
CI / Graph Build Perf (push) Failing after 1s
CI / Deep Native Preflight (push) Has been skipped
CI / Deep Native Runtime Cases (2/6) (push) Has been skipped
CI / Deep Native Runtime Cases (3/6) (push) Has been skipped
CI / Conformance Suite (push) Failing after 1s
CI / Workspace Checks (push) Failing after 0s
CI / Deep Native Runtime Cases (5/6) (push) Has been skipped
CI / Deep Native Runtime Cases (6/6) (push) Has been skipped
CI / Deep Native Runtime Cases (4/6) (push) Has been skipped
CI / Deep Graph Build Perf (push) Has been skipped
CI / Deep Native Runtime Cases (1/6) (push) Has been skipped
CI / Native Preflight (push) Failing after 1s
CI / Native Runtime Cases (1/2) (push) Failing after 0s
CI / Native Runtime Cases (2/2) (push) Failing after 1s
CI / Native Metadata Reports (push) Failing after 0s
CI / Native Direct Backend Artifacts (push) Failing after 0s
CI / Native Sanitizer Smoke (push) Failing after 1s
CI / Command Contract Snapshots (push) Failing after 1s
CI / Deep Conformance Suite (push) Has been skipped
CI / Graph Build Perf (push) Failing after 1s
CI / Deep Native Preflight (push) Has been skipped
CI / Deep Native Runtime Cases (2/6) (push) Has been skipped
CI / Deep Native Runtime Cases (3/6) (push) Has been skipped
CI / Conformance Suite (push) Failing after 1s
CI / Workspace Checks (push) Failing after 0s
CI / Deep Native Runtime Cases (5/6) (push) Has been skipped
CI / Deep Native Runtime Cases (6/6) (push) Has been skipped
CI / Deep Native Runtime Cases (4/6) (push) Has been skipped
CI / Deep Graph Build Perf (push) Has been skipped
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
pub fn defaultName() -> String {
|
||||
return "resource-cli.txt"
|
||||
}
|
||||
|
||||
pub fn outputDir() -> String {
|
||||
return std.env.getOr("ZERO_RESOURCE_DIR", ".zero")
|
||||
}
|
||||
|
||||
pub fn outputName() -> String {
|
||||
return std.args.getOr(1, defaultName())
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
use config
|
||||
|
||||
use payload
|
||||
|
||||
pub fn main(world: World) -> Void raises [NotFound, TooLarge, Io] {
|
||||
let fs: Fs = std.fs.host()
|
||||
var path_storage: [96]u8 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||
let joined: Maybe<String> = std.path.join(path_storage, outputDir(), outputName())
|
||||
if !joined.has {
|
||||
raise TooLarge
|
||||
}
|
||||
let path: String = joined.value
|
||||
var payload_storage: [32]u8 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||
let payload_len: usize = writePayload(payload_storage)
|
||||
var created: owned<File> = check std.fs.createOrRaise(fs, path)
|
||||
check std.fs.writeAllOrRaise(&mut created, payload_storage[0..payload_len])
|
||||
let written_len: usize = check std.fs.fileLenOrRaise(&mut created)
|
||||
std.fs.close(&mut created)
|
||||
var opened: owned<File> = check std.fs.openOrRaise(fs, path)
|
||||
var read_storage: [32]u8 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||
let read_len: usize = check std.fs.readOrRaise(&mut opened, read_storage)
|
||||
if written_len == payload_len && read_len == payload_len && payloadOk(read_storage[0..read_len]) {
|
||||
check world.out.write("resource cli ok\n")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
pub fn writePayload(dst: MutSpan<u8>) -> usize {
|
||||
let _cleared: usize = std.mem.fill(dst, 0_u8)
|
||||
return std.mem.copy(dst, std.mem.span("resource cli ok\n"))
|
||||
}
|
||||
|
||||
pub fn payloadOk(bytes: Span<u8>) -> Bool {
|
||||
return std.mem.eqlBytes(bytes, std.mem.span("resource cli ok\n"))
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,7 @@
|
||||
[package]
|
||||
name = "resource-cli"
|
||||
version = "0.1.0"
|
||||
|
||||
[targets.cli]
|
||||
kind = "exe"
|
||||
main = "src/main.0"
|
||||
Reference in New Issue
Block a user