Merge branch 'lm/scry-runtime' into content-distribution

This commit is contained in:
Ted Blackman 2022-02-12 05:04:36 -06:00
commit 36550f8ea9
11 changed files with 2933 additions and 420 deletions

View File

@ -1,10 +1,10 @@
.PHONY: build build-all install cross release test pills ropsten-pills clean .PHONY: build build-all install cross release test pills ropsten-pills clean
build: build:
nix-build -A urbit -A herb --no-out-link nix-build -A urbit --no-out-link
install: install:
nix-env -f . -iA urbit -iA herb nix-env -f . -iA urbit
release: release:
sh/release sh/release

28
nix/overlays/m1.nix Normal file
View File

@ -0,0 +1,28 @@
final: prev:
let
isMusl = prev.stdenv.hostPlatform.isMusl;
optionalList = xs: if xs == null then [ ] else xs;
overrideStdenv = pkg: pkg.override { stdenv = prev.gcc9Stdenv; };
in prev.lib.optionalAttrs isMusl {
libsigsegv = prev.libsigsegv.overrideAttrs (attrs: {
preConfigure = (attrs.preConfigure or "") + ''
sed -i 's/^CFG_FAULT=$/CFG_FAULT=fault-linux-i386.h/' configure
'';
});
secp256k1 = prev.secp256k1.overrideAttrs (attrs: {
nativeBuildInputs = (attrs.nativeBuildInputs or [ ])
++ [ prev.buildPackages.stdenv.cc ];
});
rhash = overrideStdenv prev.rhash;
numactl = overrideStdenv prev.numactl;
lmdb = overrideStdenv prev.lmdb;
}

2101
nix/pkgs/2 Normal file

File diff suppressed because it is too large Load Diff

View File

@ -9,6 +9,7 @@ daemon = $(wildcard daemon/*.c)
worker = $(wildcard worker/*.c) worker = $(wildcard worker/*.c)
tests = $(wildcard tests/*.c) tests = $(wildcard tests/*.c)
bench = $(wildcard bench/*.c) bench = $(wildcard bench/*.c)
wireshark = $(wildcard wireshark/*.c)
compat := $(foreach dir,$(compat),$(wildcard compat/$(dir)/*.c)) compat := $(foreach dir,$(compat),$(wildcard compat/$(dir)/*.c))
@ -77,6 +78,12 @@ build/urbit-worker: $(common_objs) $(worker_objs)
@mkdir -p ./build @mkdir -p ./build
@$(CC) $^ $(LDFLAGS) -o $@ @$(CC) $^ $(LDFLAGS) -o $@
build/ames-wireshark: $(common_objs) $(worker_objs)
@echo CC -o $@
@mkdir -p ./build
@$(CC) wireshark/main.c $(LDFLAGS) -o $@
# CCDEPS and CCEXTRA are empty except in MingW build, # CCDEPS and CCEXTRA are empty except in MingW build,
# which uses them to inject a C source transform step # which uses them to inject a C source transform step
%.o: %.c $(headers) $(CCDEPS) %.o: %.c $(headers) $(CCDEPS)

5
pkg/urbit/configure vendored
View File

@ -97,6 +97,11 @@ case $(tr A-Z a-z <<< $cpu) in
defmacro U3_OS_ENDIAN_little 1 defmacro U3_OS_ENDIAN_little 1
defmacro U3_CPU_aarch64 1 defmacro U3_CPU_aarch64 1
;; ;;
arm64)
defmacro U3_OS_ENDIAN_little 1
defmacro U3_CPU_aarch64 1
;;
*) *)
echo "Unknown or unsupported CPU: '$cpu'" >&2 echo "Unknown or unsupported CPU: '$cpu'" >&2
exit 1 exit 1

View File

@ -72,6 +72,7 @@
# define c3__ber c3_s3('b','e','r') # define c3__ber c3_s3('b','e','r')
# define c3__bias c3_s4('b','i','a','s') # define c3__bias c3_s4('b','i','a','s')
# define c3__bic c3_s3('b','i','c') # define c3__bic c3_s3('b','i','c')
# define c3__bide c3_s4('b','i','d', 'e')
# define c3__bind c3_s4('b','i','n','d') # define c3__bind c3_s4('b','i','n','d')
# define c3__bink c3_s4('b','i','n','k') # define c3__bink c3_s4('b','i','n','k')
# define c3__bird c3_s4('b','i','r','d') # define c3__bird c3_s4('b','i','r','d')
@ -548,6 +549,7 @@
# define c3__homp c3_s4('h','o','m','p') # define c3__homp c3_s4('h','o','m','p')
# define c3__hook c3_s4('h','o','o','k') # define c3__hook c3_s4('h','o','o','k')
# define c3__hoon c3_s4('h','o','o','n') # define c3__hoon c3_s4('h','o','o','n')
# define c3__hoot c3_s4('h','o','o','t')
# define c3__hop c3_s3('h','o','p') # define c3__hop c3_s3('h','o','p')
# define c3__hosc c3_s4('h','o','s','c') # define c3__hosc c3_s4('h','o','s','c')
# define c3__hose c3_s4('h','o','s','e') # define c3__hose c3_s4('h','o','s','e')
@ -914,6 +916,7 @@
# define c3__punk c3_s4('p','u','n','k') # define c3__punk c3_s4('p','u','n','k')
# define c3__punt c3_s4('p','u','n','t') # define c3__punt c3_s4('p','u','n','t')
# define c3__pure c3_s4('p','u','r','e') # define c3__pure c3_s4('p','u','r','e')
# define c3__purr c3_s4('p','u','r','r')
# define c3__push c3_s4('p','u','s','h') # define c3__push c3_s4('p','u','s','h')
# define c3__put c3_s3('p','u','t') # define c3__put c3_s3('p','u','t')
# define c3__quac c3_s4('q','u','a','c') # define c3__quac c3_s4('q','u','a','c')

View File

@ -1,6 +1,37 @@
#include "all.h" #include "all.h"
#include "vere/vere.h" #include "vere/vere.h"
// ripped TODO: reemove
/*u3_head: ames or fine packet header
*/
typedef struct _u3_head {
c3_o req_o; // is request (fine only)
c3_o sim_o; // is ames protocol?
c3_y ver_y; // protocol version
c3_y sac_y; // sender class
c3_y rac_y; // receiver class
c3_l mug_l; // truncated mug hash of u3_body
c3_o rel_o; // relayed?
} u3_head;
/* u3_prel: ames/fine packet prelude
*/
typedef struct _u3_prel {
c3_y sic_y; // sender life tick
c3_y ric_y; // receiver life tick
c3_d sen_d[2]; // sender
c3_d rec_d[2]; // receiver
c3_d rog_d; // origin lane (optional)
} u3_prel;
typedef struct _u3_body {
u3_prel pre_u; // prelude
c3_s con_s; // content size
c3_y* con_y; // content
c3_l mug_l; // checksum
} u3_body;
/* _setup(): prepare for tests. /* _setup(): prepare for tests.
*/ */
static void static void
@ -30,6 +61,51 @@ _test_ames(void)
} }
} }
static void
_test_sift_etch()
{
u3_head* hed_u = c3_calloc(sizeof(*hed_u));
u3_body* bod_u = c3_calloc(sizeof(*bod_u));
hed_u->sim_o = c3y;
hed_u->ver_y = 1;
hed_u->sac_y = 4;
hed_u->rac_y = 4;
hed_u->rel_o = c3n;
bod_u->pre_u.sen_d[0] = 0;
bod_u->pre_u.sen_d[1] = 0;
bod_u->pre_u.rec_d[0] = 182;
bod_u->pre_u.rec_d[1] = 0;
c3_y* str = (c3_y*)"test";
bod_u->con_y = str;
bod_u->con_s = 5;
c3_y** out_y;
c3_w pac_w = _ames_etch_pack(hed_u, bod_u, out_y);
u3_head* nhed_u = c3_calloc(sizeof(*nhed_u));
u3_body* nbod_u = c3_calloc(sizeof(*nbod_u));
_ames_sift_head(nhed_u, *out_y);
*out_y += 4;
c3_y_ames_sift_body(nbod_u, *out_y);
if( 0 != memcmp(hed_u, nhed_u, sizeof(*hed_u))) {
fprintf(stderr, "ames: header serialisation mismatch(a)\r\n");
exit(1);
}
if( 0 != memcmp(bod_u, nbod_u, sizeof(*bod_u))) {
fprintf(stderr, "ames: body serialisation fail(a)\r\n");
exit(1);
} else {
fprintf(stderr, "ames: pass (a)\r\n");
exit(1);
}
}
/* main(): run all test cases. /* main(): run all test cases.
*/ */
int int

File diff suppressed because it is too large Load Diff

View File

View File

@ -22,7 +22,7 @@ let
# #
# Typically the inputs listed here also have a shell.nix in their respective # Typically the inputs listed here also have a shell.nix in their respective
# source directory you can use directly. # source directory you can use directly.
inputsFrom = with pkgsLocal; [ ent herb urbit urcrypt ]; inputsFrom = with pkgsLocal; [ ent urbit urcrypt ];
# Collect the named attribute from all dependencies listed in inputsFrom. # Collect the named attribute from all dependencies listed in inputsFrom.
mergeFrom = name: pkgs.lib.concatLists (pkgs.lib.catAttrs name inputsFrom); mergeFrom = name: pkgs.lib.concatLists (pkgs.lib.catAttrs name inputsFrom);

2
test Normal file
View File

@ -0,0 +1,2 @@
~[46.318 46.574 46.830 47.086 47.342 47.598 47.854 48.110 48.366 48.622 48.878 49.134 49.390 49.646 49.902 50.158 50.414]