mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-01 11:33:41 +03:00
Merge branch 'master' into chat-message-types
This commit is contained in:
commit
05950770f4
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e0db2000c69c5e325413d3483183f2d87c810b9596ed68f0e5eb1755525668b8
|
||||
size 6972895
|
||||
oid sha256:5debf91880c73d052429ca487555aa60aa2ee4f173c9f059e30b61372689910e
|
||||
size 7118127
|
||||
|
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a8d28b096db251b3abffb2d96cf243274ba377e19d71dbfce87bb38d3cd88a9f
|
||||
size 4609208
|
||||
oid sha256:3637fc5590ee06dc2281ecd7efc05f56bc5a31de2b6be9da4262af3740e5a86d
|
||||
size 4761228
|
||||
|
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:210786877b2436c005e70f67ce929d3f56d624b4497f3476f3f0dcbadbcbb084
|
||||
size 9692780
|
||||
oid sha256:39ac7d52391426c31ff6b341536610a2704f8f5831c7d650357274c52b76d4a3
|
||||
size 9847553
|
||||
|
@ -1,13 +1,15 @@
|
||||
crossenv:
|
||||
|
||||
rec {
|
||||
argon2 = import ./deps/argon2/cross.nix { inherit crossenv; };
|
||||
murmur3 = import ./deps/murmur3/cross.nix { inherit crossenv; };
|
||||
uv = import ./deps/uv/cross.nix { inherit crossenv; };
|
||||
ed25519 = import ./deps/ed25519/cross.nix { inherit crossenv; };
|
||||
sni = import ./deps/sni/cross.nix { inherit crossenv; };
|
||||
scrypt = import ./deps/scrypt/cross.nix { inherit crossenv; };
|
||||
softfloat3 = import ./deps/softfloat3/cross.nix { inherit crossenv; };
|
||||
secp256k1 = import ./deps/secp256k1/cross.nix { inherit crossenv; };
|
||||
h2o = import ./deps/h2o/cross.nix { inherit crossenv uv; };
|
||||
argon2 = import ./deps/argon2/cross.nix { inherit crossenv; };
|
||||
murmur3 = import ./deps/murmur3/cross.nix { inherit crossenv; };
|
||||
uv = import ./deps/uv/cross.nix { inherit crossenv; };
|
||||
ed25519 = import ./deps/ed25519/cross.nix { inherit crossenv; };
|
||||
sni = import ./deps/sni/cross.nix { inherit crossenv; };
|
||||
scrypt = import ./deps/scrypt/cross.nix { inherit crossenv; };
|
||||
softfloat3 = import ./deps/softfloat3/cross.nix { inherit crossenv; };
|
||||
secp256k1 = import ./deps/secp256k1/cross.nix { inherit crossenv; };
|
||||
h2o = import ./deps/h2o/cross.nix { inherit crossenv uv; };
|
||||
ivory-header = import ./deps/ivory-header/cross.nix { inherit crossenv; };
|
||||
ca-header = import ./deps/ca-header/cross.nix { inherit crossenv; };
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ let
|
||||
|
||||
vendor =
|
||||
with deps;
|
||||
[ argon2 ed25519 h2o murmur3 scrypt secp256k1 sni softfloat3 uv ent ge-additions ];
|
||||
[ argon2 ed25519 h2o murmur3 scrypt secp256k1 sni softfloat3 uv ent ge-additions ivory-header ca-header ];
|
||||
|
||||
in
|
||||
|
||||
|
27
nix/deps/ca-header/builder.sh
Executable file
27
nix/deps/ca-header/builder.sh
Executable file
@ -0,0 +1,27 @@
|
||||
source $stdenv/setup
|
||||
|
||||
set -ex
|
||||
|
||||
cleanup () {
|
||||
echo "done"
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
|
||||
|
||||
if ! [ -f "$SSL_CERT_FILE" ]; then
|
||||
echo "$SSL_CERT_FILE doesn't exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p ./include
|
||||
|
||||
cat $SSL_CERT_FILE > include/ca-bundle.crt
|
||||
xxd -i include/ca-bundle.crt > ca-bundle.h
|
||||
|
||||
mkdir -p $out/include
|
||||
|
||||
mv ca-bundle.h $out/include
|
||||
rm -rf ./include
|
||||
|
||||
set +x
|
8
nix/deps/ca-header/cross.nix
Normal file
8
nix/deps/ca-header/cross.nix
Normal file
@ -0,0 +1,8 @@
|
||||
{ crossenv }:
|
||||
|
||||
crossenv.make_derivation rec {
|
||||
name = "ca-bundle.h";
|
||||
builder = ./builder.sh;
|
||||
native_inputs = with crossenv.nixpkgs; [ cacert xxd ];
|
||||
SSL_CERT_FILE = "${crossenv.nixpkgs.cacert}/etc/ssl/certs/ca-bundle.crt";
|
||||
}
|
7
nix/deps/ca-header/default.nix
Normal file
7
nix/deps/ca-header/default.nix
Normal file
@ -0,0 +1,7 @@
|
||||
{ pkgs }:
|
||||
|
||||
pkgs.stdenv.mkDerivation {
|
||||
name = "ca-bundle.h";
|
||||
builder = ./builder.sh;
|
||||
nativeBuildInputs = with pkgs; [ cacert xxd ];
|
||||
}
|
@ -1,13 +1,15 @@
|
||||
{ pkgs ? import ../nixpkgs.nix }:
|
||||
|
||||
rec {
|
||||
argon2 = import ./argon2 { inherit pkgs; };
|
||||
murmur3 = import ./murmur3 { inherit pkgs; };
|
||||
uv = import ./uv { inherit pkgs; };
|
||||
ed25519 = import ./ed25519 { inherit pkgs; };
|
||||
sni = import ./sni { inherit pkgs; };
|
||||
scrypt = import ./scrypt { inherit pkgs; };
|
||||
softfloat3 = import ./softfloat3 { inherit pkgs; };
|
||||
secp256k1 = import ./secp256k1 { inherit pkgs; };
|
||||
h2o = import ./h2o { inherit pkgs uv; };
|
||||
argon2 = import ./argon2 { inherit pkgs; };
|
||||
murmur3 = import ./murmur3 { inherit pkgs; };
|
||||
uv = import ./uv { inherit pkgs; };
|
||||
ed25519 = import ./ed25519 { inherit pkgs; };
|
||||
sni = import ./sni { inherit pkgs; };
|
||||
scrypt = import ./scrypt { inherit pkgs; };
|
||||
softfloat3 = import ./softfloat3 { inherit pkgs; };
|
||||
secp256k1 = import ./secp256k1 { inherit pkgs; };
|
||||
h2o = import ./h2o { inherit pkgs uv; };
|
||||
ivory-header = import ./ivory-header { inherit pkgs; };
|
||||
ca-header = import ./ca-header { inherit pkgs; };
|
||||
}
|
||||
|
41
nix/deps/ivory-header/builder.sh
Executable file
41
nix/deps/ivory-header/builder.sh
Executable file
@ -0,0 +1,41 @@
|
||||
source $stdenv/setup
|
||||
|
||||
set -ex
|
||||
|
||||
cleanup () {
|
||||
echo "done"
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
|
||||
|
||||
if ! [ -f "$IVORY" ]; then
|
||||
echo "$IVORY doesn't exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#
|
||||
# heuristics to confirm the ivory pill is valid
|
||||
#
|
||||
|
||||
# greater than 10KB
|
||||
#
|
||||
if [ $(du -k $IVORY | cut -f1) -gt 10 ]; then
|
||||
echo "$IVORY is less than 10KB"
|
||||
fi
|
||||
|
||||
# first 7 bytes != "version" (start of an lfs pointer)
|
||||
#
|
||||
if [ "$(cat $(IVORY) | head -c 7)" = "version" ]; then
|
||||
echo "$IVORY starts with 'version'; it's an LFS pointer"
|
||||
fi
|
||||
|
||||
cat $IVORY > u3_Ivory.pill
|
||||
xxd -i u3_Ivory.pill > ivory.h
|
||||
|
||||
mkdir -p $out/include
|
||||
|
||||
mv ivory.h $out/include
|
||||
rm u3_Ivory.pill
|
||||
|
||||
set +x
|
11
nix/deps/ivory-header/cross.nix
Normal file
11
nix/deps/ivory-header/cross.nix
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
crossenv,
|
||||
ivory ? ../../../bin/ivory.pill
|
||||
}:
|
||||
|
||||
crossenv.make_derivation rec {
|
||||
name = "ivory.h";
|
||||
builder = ./builder.sh;
|
||||
native_inputs = with crossenv.nixpkgs; [ xxd ];
|
||||
IVORY = ivory;
|
||||
}
|
11
nix/deps/ivory-header/default.nix
Normal file
11
nix/deps/ivory-header/default.nix
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
pkgs,
|
||||
ivory ? ../../../bin/ivory.pill
|
||||
}:
|
||||
|
||||
pkgs.stdenv.mkDerivation {
|
||||
name = "ivory.h";
|
||||
builder = ./builder.sh;
|
||||
nativeBuildInputs = with pkgs; [ xxd ];
|
||||
IVORY = ivory;
|
||||
}
|
@ -15,17 +15,41 @@ cleanup () {
|
||||
|
||||
trap cleanup EXIT
|
||||
|
||||
# update pill strategy to ensure correct staging
|
||||
# update pill strategy to ensure correct staging
|
||||
#
|
||||
|
||||
herb ./pier -p hood -d "+hood/mount /=home="
|
||||
|
||||
cp $ARVO/lib/pill.hoon ./pier/home/lib/
|
||||
chmod -R u+rw ./pier/home/lib/
|
||||
# update :lens, :dojo and dependencies
|
||||
#
|
||||
# XX reduce this list
|
||||
#
|
||||
cp $ARVO/app/lens.hoon ./pier/home/app/ 2>/dev/null || true
|
||||
cp $ARVO/app/dojo.hoon ./pier/home/app/ 2>/dev/null || true
|
||||
cp $ARVO/lib/base64.hoon ./pier/home/lib/ 2>/dev/null || true
|
||||
cp $ARVO/lib/server.hoon ./pier/home/lib/ 2>/dev/null || true
|
||||
cp $ARVO/lib/sole.hoon ./pier/home/lib/ 2>/dev/null || true
|
||||
mkdir -p ./pier/home/mar/lens/
|
||||
cp $ARVO/mar/lens/* ./pier/home/mar/lens/ 2>/dev/null || true
|
||||
|
||||
cp $ARVO/sur/lens.hoon ./pier/home/sur/ 2>/dev/null || true
|
||||
cp $ARVO/sur/sole.hoon ./pier/home/sur/ 2>/dev/null || true
|
||||
|
||||
# update +solid and its dependencies
|
||||
#
|
||||
cp $ARVO/lib/pill.hoon ./pier/home/lib/ 2>/dev/null || true
|
||||
cp $ARVO/gen/solid.hoon ./pier/home/gen/ 2>/dev/null || true
|
||||
|
||||
chmod -R u+rw ./pier/home/
|
||||
|
||||
herb ./pier -p hood -d "+hood/commit %home"
|
||||
herb ./pier -p hood -d "+hood/unmount %home"
|
||||
|
||||
# stage new desk for pill contents
|
||||
# XX horrible hack to ensure the update is applied first
|
||||
#
|
||||
sleep 10
|
||||
|
||||
# stage new desk for pill contents
|
||||
#
|
||||
herb ./pier -p hood -d '+hood/merge %stage our %home'
|
||||
herb ./pier -p hood -d "+hood/mount /=stage="
|
||||
|
@ -17,7 +17,7 @@ let
|
||||
import ./urbit {
|
||||
inherit pkgs ent debug ge-additions;
|
||||
inherit (deps) argon2 murmur3 uv ed25519 sni scrypt softfloat3;
|
||||
inherit (deps) secp256k1 h2o;
|
||||
inherit (deps) secp256k1 h2o ivory-header ca-header;
|
||||
};
|
||||
|
||||
urbit = mkUrbit { debug=false; };
|
||||
|
@ -1,8 +1,7 @@
|
||||
{
|
||||
pkgs,
|
||||
debug,
|
||||
ivory ? ../../../bin/ivory.pill,
|
||||
argon2, ed25519, ent, ge-additions, h2o, murmur3, scrypt, secp256k1, sni, softfloat3, uv
|
||||
argon2, ed25519, ent, ge-additions, h2o, murmur3, scrypt, secp256k1, sni, softfloat3, uv, ivory-header, ca-header
|
||||
}:
|
||||
|
||||
let
|
||||
@ -12,10 +11,10 @@ let
|
||||
|
||||
deps =
|
||||
with pkgs;
|
||||
[ curl gmp libsigsegv ncurses openssl zlib lmdb cacert xxd ];
|
||||
[ curl gmp libsigsegv ncurses openssl zlib lmdb ];
|
||||
|
||||
vendor =
|
||||
[ argon2 softfloat3 ed25519 ent ge-additions h2o scrypt uv murmur3 secp256k1 sni ];
|
||||
[ argon2 softfloat3 ed25519 ent ge-additions h2o scrypt uv murmur3 secp256k1 sni ivory-header ca-header ];
|
||||
|
||||
in
|
||||
|
||||
@ -31,7 +30,6 @@ pkgs.stdenv.mkDerivation {
|
||||
hardeningDisable = if debug then [ "all" ] else [];
|
||||
|
||||
CFLAGS = if debug then "-O3 -g -Werror" else "-O3 -Werror";
|
||||
IVORY = ivory;
|
||||
MEMORY_DEBUG = debug;
|
||||
CPU_DEBUG = debug;
|
||||
EVENT_TIME_DEBUG = false;
|
||||
|
@ -4,8 +4,7 @@
|
||||
ent,
|
||||
name ? "urbit",
|
||||
debug ? false,
|
||||
ivory ? ../../../bin/ivory.pill,
|
||||
ge-additions, cacert, xxd
|
||||
ge-additions
|
||||
}:
|
||||
|
||||
let
|
||||
@ -16,7 +15,7 @@ let
|
||||
|
||||
vendor =
|
||||
with deps;
|
||||
[ argon2 softfloat3 ed25519 ge-additions h2o scrypt uv murmur3 secp256k1 sni ];
|
||||
[ argon2 softfloat3 ed25519 ge-additions h2o scrypt uv murmur3 secp256k1 sni ivory-header ca-header ];
|
||||
|
||||
in
|
||||
|
||||
@ -27,13 +26,10 @@ env.make_derivation {
|
||||
CPU_DEBUG = debug;
|
||||
EVENT_TIME_DEBUG = false;
|
||||
NCURSES = env.ncurses;
|
||||
SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
|
||||
IVORY = ivory;
|
||||
|
||||
name = "${name}-${env_name}";
|
||||
exename = name;
|
||||
src = ../../../pkg/urbit;
|
||||
native_inputs = [ xxd ];
|
||||
cross_inputs = crossdeps ++ vendor ++ [ ent ];
|
||||
builder = ./release.sh;
|
||||
}
|
||||
|
@ -12,5 +12,5 @@ import ./default.nix {
|
||||
inherit (tlon)
|
||||
ent ge-additions;
|
||||
inherit (deps)
|
||||
argon2 ed25519 h2o murmur3 scrypt secp256k1 sni softfloat3 uv;
|
||||
argon2 ed25519 h2o murmur3 scrypt secp256k1 sni softfloat3 uv ivory-header ca-header;
|
||||
}
|
||||
|
@ -21,8 +21,7 @@ let
|
||||
|
||||
urbit = env:
|
||||
import ./pkgs/urbit/release.nix env
|
||||
{ ent = ent env; ge-additions = ge-additions env; cacert = nixpkgs.cacert;
|
||||
xxd = nixpkgs.xxd; debug = false; name = "urbit"; };
|
||||
{ ent = ent env; ge-additions = ge-additions env; debug = false; name = "urbit"; };
|
||||
|
||||
builds-for-platform = plat:
|
||||
plat.deps // {
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,19 +1,25 @@
|
||||
/- lens
|
||||
/+ *server, base64
|
||||
/- lens, *sole
|
||||
/+ base64, *server
|
||||
/= lens-mark /: /===/mar/lens/command
|
||||
/!noun/
|
||||
=, format
|
||||
|%
|
||||
:: +move: output effect
|
||||
:: +lens-out: json or named octet-stream
|
||||
::
|
||||
+$ lens-out
|
||||
$% [%json =json]
|
||||
[%mime =mime]
|
||||
==
|
||||
:: +move: output effect
|
||||
::
|
||||
+$ move [bone card]
|
||||
:: +card: output effect payload
|
||||
:: +card: output effect payload
|
||||
::
|
||||
+$ card
|
||||
$% [%connect wire binding:eyre term]
|
||||
[%http-response =http-event:http]
|
||||
[%peer wire dock path]
|
||||
[%peel wire dock mark path]
|
||||
[%peer wire dock path]
|
||||
[%poke wire dock poke]
|
||||
[%pull wire dock ~]
|
||||
==
|
||||
@ -80,16 +86,74 @@
|
||||
[ost.bow %poke /import [our.bow app.source.com] %import c]~
|
||||
::
|
||||
:_ this(job.state (some [ost.bow com]))
|
||||
[ost.bow %peel /sole [our.bow %dojo] %lens-json /sole]~
|
||||
[ost.bow %peer /sole [our.bow %dojo] /sole]~
|
||||
::
|
||||
++ diff-lens-json
|
||||
|= [=wire jon=json]
|
||||
++ diff-sole-effect
|
||||
|= [=wire fec=sole-effect]
|
||||
^- (quip move _this)
|
||||
?~ jon
|
||||
=/ out
|
||||
|- ^- (unit lens-out)
|
||||
=* loop $
|
||||
?+ -.fec
|
||||
~
|
||||
::
|
||||
%tan
|
||||
%- some
|
||||
:- %json
|
||||
%- wall:enjs:format
|
||||
(turn (flop p.fec) |=(=tank ~(ram re tank)))
|
||||
::
|
||||
%txt
|
||||
(some %json s+(crip p.fec))
|
||||
::
|
||||
%sag
|
||||
%- some
|
||||
[%mime p.fec (as-octs:mimes:html (jam q.fec))]
|
||||
::
|
||||
%sav
|
||||
:: XX use +en:base64 or produce %mime a la %sag
|
||||
::
|
||||
%- some
|
||||
:- %json
|
||||
%- pairs:enjs:format
|
||||
:~ file+s+(crip <`path`p.fec>)
|
||||
data+s+(crip (en-base64:mimes:html q.fec))
|
||||
==
|
||||
::
|
||||
%mor
|
||||
=/ all `(list lens-out)`(murn p.fec |=(a=sole-effect loop(fec a)))
|
||||
?~ all ~
|
||||
~| [%multiple-effects all]
|
||||
?> ?=(~ t.all)
|
||||
(some i.all)
|
||||
==
|
||||
::
|
||||
?~ out
|
||||
[~ this]
|
||||
?> ?=(^ job.state)
|
||||
:_ this(job.state ~)
|
||||
[bone.u.job.state %http-response (json-response:app (json-to-octs jon))]~
|
||||
:_ ~
|
||||
:+ bone.u.job.state
|
||||
%http-response
|
||||
?- -.u.out
|
||||
%json
|
||||
(json-response:app (json-to-octs json.u.out))
|
||||
::
|
||||
%mime
|
||||
:* %start
|
||||
:~ 200
|
||||
['content-type' 'application/octet-stream']
|
||||
?> ?=([@ @ ~] p.mime.u.out)
|
||||
:- 'content-disposition'
|
||||
^- @t
|
||||
%^ cat 3
|
||||
'attachment; filename='
|
||||
(rap 3 '"' i.p.mime.u.out '.' i.t.p.mime.u.out '"' ~)
|
||||
==
|
||||
(some q.mime.u.out)
|
||||
%.y
|
||||
==
|
||||
==
|
||||
::
|
||||
++ diff-export
|
||||
|= [=wire data=*]
|
||||
@ -132,6 +196,8 @@
|
||||
?> ?=(^ job.state)
|
||||
:_ this
|
||||
:~ [ost.bow %poke /sole [our.bow %dojo] %lens-command com.u.job.state]
|
||||
:: XX move to +diff-sole-effect?
|
||||
::
|
||||
[ost.bow %pull /sole [our.bow %dojo] ~]
|
||||
==
|
||||
::
|
||||
|
@ -716,8 +716,12 @@
|
||||
++ circ :: circle
|
||||
;~ pose
|
||||
(cold incir col)
|
||||
;~(pfix cen (stag self urs:ab))
|
||||
;~(pfix net (stag (^sein:title self) urs:ab))
|
||||
;~ pfix cen
|
||||
%+ stag self
|
||||
%+ sear |=(circ=name ?:(=('' circ) ~ (some circ)))
|
||||
urs:ab
|
||||
==
|
||||
::
|
||||
%+ cook
|
||||
|= {a/@p b/(unit term)}
|
||||
|
@ -97,7 +97,7 @@
|
||||
=? hav ?=(^ fil.lon)
|
||||
:: XX this whitelist needs to be reviewed
|
||||
::
|
||||
?. ?= ?($css $hoon $json $md $txt $udon $umd)
|
||||
?. ?= ?($css $hoon $html $js $json $md $png $txt $udon $umd)
|
||||
-.tyl
|
||||
::
|
||||
:: install only files with whitelisted marks
|
||||
|
@ -1,12 +0,0 @@
|
||||
::
|
||||
:::: /hoon/json/lens/mar
|
||||
::
|
||||
/? 310
|
||||
::
|
||||
:::: ~fyr
|
||||
::
|
||||
|_ jon/json
|
||||
++ grab |% ++ noun json
|
||||
--
|
||||
++ grow |% ++ json jon
|
||||
-- --
|
@ -50,27 +50,6 @@
|
||||
++ grow
|
||||
=, enjs
|
||||
|%
|
||||
++ lens-json :: json for cli client
|
||||
^- ?(~ ^json) :: null = ignore
|
||||
?+ -.sef ~
|
||||
$tan (wall (turn (flop p.sef) |=(a/tank ~(ram re a))))
|
||||
$txt s+(crip p.sef)
|
||||
$sag
|
||||
=/ =atom (jam q.sef)
|
||||
=/ =octs [(met 3 atom) atom]
|
||||
=/ enc (en:base64 octs)
|
||||
(pairs file+s+(crip <`path`p.sef>) data+s+enc ~)
|
||||
$sav
|
||||
(pairs file+s+(crip <`path`p.sef>) data+s+(crip (en-base64:mimes:html q.sef)) ~)
|
||||
::
|
||||
$mor
|
||||
=+ all=(turn p.sef |=(a/sole-effect lens-json(sef a)))
|
||||
=. all (skip all |=(a/^json ?=(~ a)))
|
||||
?~ all ~
|
||||
?~ t.all i.all
|
||||
~|(multiple-effects+`(list ^json)`all !!)
|
||||
==
|
||||
::
|
||||
++ json
|
||||
^- ^json
|
||||
?+ -.sef
|
||||
|
@ -17290,6 +17290,14 @@
|
||||
=+ new=(~(mint ut sut) %noun gen)
|
||||
[new +>+<.$(mit (~(put by mit) [sut gen] new))]
|
||||
::
|
||||
++ slam :: ++slam, cached
|
||||
|= [gat=vase sam=vase]
|
||||
^- [vase worm]
|
||||
=/ sut=type [%cell p.gat p.sam]
|
||||
=/ gen=hoon [%cnsg [%$ ~] [%$ 2] [%$ 3] ~]
|
||||
=^ new=type +>+<.$ (play sut gen)
|
||||
[[new (slum q.gat q.sam)] +>+<.$]
|
||||
::
|
||||
++ slap :: ++slap, cached
|
||||
|= {vax/vase gen/hoon}
|
||||
^- {vase worm}
|
||||
|
@ -7315,6 +7315,10 @@
|
||||
=. size.queue +(size.queue)
|
||||
::
|
||||
[~ queue]
|
||||
:: max is zero, the oldest item to return is the one which just went in.
|
||||
::
|
||||
?: =(~ queue.queue)
|
||||
[`item queue]
|
||||
:: we're at max capacity, so pop before pushing; size is unchanged
|
||||
::
|
||||
=^ oldest queue.queue ~(get to queue.queue)
|
||||
|
37
pkg/arvo/tests/sys/hoon/vases.hoon
Normal file
37
pkg/arvo/tests/sys/hoon/vases.hoon
Normal file
@ -0,0 +1,37 @@
|
||||
/+ *test
|
||||
|%
|
||||
++ test-slam-wa-dry ^- tang
|
||||
::
|
||||
%+ expect-eq
|
||||
!>(7)
|
||||
-:(~(slam wa *worm) !>(add) !>([3 4]))
|
||||
:: +test-slam-wa-wet: does +slam:wa perform correct wet type inference?
|
||||
::
|
||||
:: Also test that the cache doesn't gain any new entries when given a
|
||||
:: sample of a previously seen type.
|
||||
::
|
||||
++ test-slam-wa-wet ^- tang
|
||||
:: use the same .list-type for both calls
|
||||
::
|
||||
:: Types defined on different lines won't be noun-equal, and so
|
||||
:: won't test that the cache kicked in on the second entry.
|
||||
::
|
||||
=/ list-type=type -:!>(*(list @))
|
||||
=| worm0=worm
|
||||
=+ [res1 worm1]=(~(slam wa worm0) !>(flop) [list-type ~[1 2 3]])
|
||||
=+ [res2 worm2]=(~(slam wa worm1) !>(flop) [list-type ~[4 5 6]])
|
||||
::
|
||||
;: weld
|
||||
%+ expect-eq
|
||||
res1
|
||||
[list-type ~[3 2 1]]
|
||||
::
|
||||
%+ expect-eq
|
||||
res2
|
||||
[list-type ~[6 5 4]]
|
||||
::
|
||||
%+ expect-eq
|
||||
!> worm1
|
||||
!> worm2
|
||||
==
|
||||
--
|
@ -125,4 +125,29 @@
|
||||
results1
|
||||
results2
|
||||
==
|
||||
::
|
||||
++ test-put-zero
|
||||
::
|
||||
=| q=(capped-queue @u)
|
||||
=. max-size.q 0
|
||||
:: specialize type
|
||||
::
|
||||
=+ to-capped-queue=(to-capped-queue @u)
|
||||
:: push enough values to evict one
|
||||
::
|
||||
::
|
||||
=^ maybe1 q (~(put to-capped-queue q) 5)
|
||||
=/ results1
|
||||
%+ expect-eq
|
||||
!> [~ 5]
|
||||
!> maybe1
|
||||
=/ results2
|
||||
%+ expect-eq
|
||||
!> 0
|
||||
!> size.q
|
||||
::
|
||||
;: weld
|
||||
results1
|
||||
results2
|
||||
==
|
||||
--
|
||||
|
@ -425,7 +425,12 @@ url = "http://localhost:%s" % PORT
|
||||
|
||||
r = requests.post(url, data=json.dumps(payload))
|
||||
|
||||
if r.text[0] == '"':
|
||||
if r.headers.get('content-type') == 'application/octet-stream':
|
||||
name = r.headers.get('content-disposition').split('filename=',1)[1][1:-1]
|
||||
with open(name, 'wb') as f:
|
||||
for block in r.iter_content(1024):
|
||||
f.write(block)
|
||||
elif r.text[0] == '"':
|
||||
print r.text[1:-1].encode('utf-8').decode('string_escape')
|
||||
elif r.text[0] == '{':
|
||||
# print r.text
|
||||
|
41
pkg/interface/chat/package-lock.json
generated
41
pkg/interface/chat/package-lock.json
generated
@ -1609,7 +1609,8 @@
|
||||
"ansi-regex": {
|
||||
"version": "2.1.1",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"aproba": {
|
||||
"version": "1.2.0",
|
||||
@ -1630,12 +1631,14 @@
|
||||
"balanced-match": {
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
@ -1650,17 +1653,20 @@
|
||||
"code-point-at": {
|
||||
"version": "1.1.0",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"concat-map": {
|
||||
"version": "0.0.1",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"console-control-strings": {
|
||||
"version": "1.1.0",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"core-util-is": {
|
||||
"version": "1.0.2",
|
||||
@ -1777,7 +1783,8 @@
|
||||
"inherits": {
|
||||
"version": "2.0.3",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"ini": {
|
||||
"version": "1.3.5",
|
||||
@ -1789,6 +1796,7 @@
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"number-is-nan": "^1.0.0"
|
||||
}
|
||||
@ -1803,6 +1811,7 @@
|
||||
"version": "3.0.4",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
}
|
||||
@ -1810,12 +1819,14 @@
|
||||
"minimist": {
|
||||
"version": "0.0.8",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"minipass": {
|
||||
"version": "2.3.5",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"safe-buffer": "^5.1.2",
|
||||
"yallist": "^3.0.0"
|
||||
@ -1834,6 +1845,7 @@
|
||||
"version": "0.5.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"minimist": "0.0.8"
|
||||
}
|
||||
@ -1914,7 +1926,8 @@
|
||||
"number-is-nan": {
|
||||
"version": "1.0.1",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"object-assign": {
|
||||
"version": "4.1.1",
|
||||
@ -1926,6 +1939,7 @@
|
||||
"version": "1.4.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
@ -2011,7 +2025,8 @@
|
||||
"safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"safer-buffer": {
|
||||
"version": "2.1.2",
|
||||
@ -2047,6 +2062,7 @@
|
||||
"version": "1.0.2",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"code-point-at": "^1.0.0",
|
||||
"is-fullwidth-code-point": "^1.0.0",
|
||||
@ -2066,6 +2082,7 @@
|
||||
"version": "3.0.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"ansi-regex": "^2.0.0"
|
||||
}
|
||||
@ -2109,12 +2126,14 @@
|
||||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"yallist": {
|
||||
"version": "3.0.3",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -4,6 +4,7 @@ p, h1, h2, h3, h4, h5, h6, a, input, textarea, button {
|
||||
-webkit-margin-before: unset;
|
||||
-webkit-margin-after: unset;
|
||||
font-family: Inter, sans-serif;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
textarea, select, input, button {
|
||||
@ -136,3 +137,11 @@ h2 {
|
||||
.lh-16 {
|
||||
line-height: 16px;
|
||||
}
|
||||
|
||||
.mono {
|
||||
font-family: "Source Code Pro", monospace;
|
||||
}
|
||||
|
||||
.label-small-mono.list-ship {
|
||||
line-height: 29px;
|
||||
}
|
@ -310,7 +310,7 @@ export class ChatInput extends Component {
|
||||
className={'ml2 mt2 mr2 bn ' +
|
||||
this.getSpeechStyle(state.messageType, state.clipboard)
|
||||
}
|
||||
style={{ flexGrow: 1, resize: 'none' }}
|
||||
style={{ flexGrow: 1, height: 40, resize: 'none' }}
|
||||
ref={this.textareaRef}
|
||||
placeholder={props.placeholder}
|
||||
value={state.message}
|
||||
|
@ -1,5 +1,6 @@
|
||||
import React, { Component } from 'react';
|
||||
import classnames from 'classnames';
|
||||
import { Sigil } from '/components/lib/icons/sigil';
|
||||
|
||||
|
||||
export class MemberElement extends Component {
|
||||
@ -23,7 +24,7 @@ export class MemberElement extends Component {
|
||||
`~${window.ship}` === props.host) {
|
||||
actionElem = (
|
||||
<a onClick={this.onRemove.bind(this)}
|
||||
className="w-40 dib underline black btn-font">
|
||||
className="w-40 dib list-ship black underline label-small-mono pointer">
|
||||
Remove
|
||||
</a>
|
||||
);
|
||||
@ -34,10 +35,11 @@ export class MemberElement extends Component {
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className="flex mb2">
|
||||
<Sigil ship={props.ship} size={32} />
|
||||
<p
|
||||
className={
|
||||
"w-60 dib black pr3 mb2 label-small-mono label-regular"
|
||||
"w-60 dib v-mid black pr3 ml2 nowrap label-small-mono list-ship label-regular"
|
||||
}>
|
||||
{props.ship}
|
||||
</p>
|
||||
|
@ -83,7 +83,7 @@ export class MemberScreen extends Component {
|
||||
);
|
||||
|
||||
|
||||
let inviteButtonClasses = "label-regular underline black btn-font pointer";
|
||||
let inviteButtonClasses = "label-regular black btn-font pointer";
|
||||
if (!this.state.error) {
|
||||
inviteButtonClasses = inviteButtonClasses + ' black';
|
||||
}
|
||||
@ -113,16 +113,17 @@ export class MemberScreen extends Component {
|
||||
</p>
|
||||
<textarea
|
||||
ref={ e => { this.textarea = e; } }
|
||||
className="w-80 db ba overflow-y-hidden gray mb2"
|
||||
className="w-80 db ba overflow-y-hidden mono gray mb2"
|
||||
style={{
|
||||
resize: 'none',
|
||||
height: 150
|
||||
}}
|
||||
spellCheck="false"
|
||||
onChange={this.inviteMembersChange.bind(this)}></textarea>
|
||||
<button
|
||||
onClick={this.inviteMembers.bind(this)}
|
||||
className={inviteButtonClasses}>
|
||||
Invite
|
||||
-> Invite
|
||||
</button>
|
||||
{errorElem}
|
||||
{successElem}
|
||||
|
@ -185,8 +185,9 @@ export class NewScreen extends Component {
|
||||
</p>
|
||||
<textarea
|
||||
ref={ e => { this.textarea = e; } }
|
||||
className="body-regular fw-normal ba pa2 mb2 db w-100"
|
||||
className="body-regular mono fw-normal ba pa2 mb2 db w-100"
|
||||
placeholder="~zod, ~bus"
|
||||
spellCheck="false"
|
||||
style={{
|
||||
resize: 'none',
|
||||
height: 150
|
||||
|
@ -7,7 +7,7 @@ daemon = $(wildcard daemon/*.c)
|
||||
worker = $(wildcard worker/*.c)
|
||||
|
||||
common = $(jets) $(noun) $(vere)
|
||||
headers = $(shell find include -type f) include/ca-bundle.h include/ivory.h
|
||||
headers = $(shell find include -type f)
|
||||
|
||||
common_objs = $(shell echo $(common) | sed 's/\.c/.o/g')
|
||||
daemon_objs = $(shell echo $(daemon) | sed 's/\.c/.o/g')
|
||||
@ -23,14 +23,6 @@ all_exes = ./build/mug_tests ./build/jam_tests ./build/hashtable_tests \
|
||||
# -Wall issues all types of errors. This is off (for now)
|
||||
CFLAGS := $(CFLAGS)
|
||||
|
||||
ifeq ($(SSL_CERT_FILE),)
|
||||
$(error SSL_CERT_FILE is undefined)
|
||||
endif
|
||||
|
||||
ifeq ($(IVORY),)
|
||||
$(error IVORY is undefined)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
.PHONY: all test clean mkproper
|
||||
@ -48,22 +40,10 @@ clean:
|
||||
rm -f ./tags $(all_objs) $(all_exes)
|
||||
|
||||
mrproper: clean
|
||||
rm -f config.mk include/config.h include/ca-bundle.h include/ivory.h
|
||||
rm -f config.mk include/config.h
|
||||
|
||||
################################################################################
|
||||
|
||||
include/ca-bundle.h:
|
||||
@echo XXD -i $(SSL_CERT_FILE)
|
||||
@cat $(SSL_CERT_FILE) > include/ca-bundle.crt
|
||||
@xxd -i include/ca-bundle.crt > include/ca-bundle.h
|
||||
@rm include/ca-bundle.crt
|
||||
|
||||
include/ivory.h:
|
||||
@echo XXD -i $(IVORY)
|
||||
@cat $(IVORY) > u3_Ivory.pill
|
||||
@xxd -i u3_Ivory.pill > include/ivory.h
|
||||
@rm u3_Ivory.pill
|
||||
|
||||
build/hashtable_tests: $(common_objs) tests/hashtable_tests.o
|
||||
@echo CC -o $@
|
||||
@mkdir -p ./build
|
||||
|
10
pkg/urbit/configure
vendored
10
pkg/urbit/configure
vendored
@ -2,13 +2,17 @@
|
||||
|
||||
set -e
|
||||
|
||||
URBIT_VERSION=0.8.0
|
||||
URBIT_VERSION=0.8.1
|
||||
|
||||
deps=" \
|
||||
curl gmp sigsegv argon2 ed25519 ent h2o scrypt sni uv murmur3 secp256k1 \
|
||||
softfloat3 ncurses ssl crypto z lmdb ge-additions \
|
||||
"
|
||||
|
||||
headers=" \
|
||||
ivory.h ca-bundle.h \
|
||||
"
|
||||
|
||||
echo '#pragma once' >include/config.h
|
||||
|
||||
defmacro () {
|
||||
@ -77,6 +81,10 @@ do LDFLAGS="${LDFLAGS-} -l$dep"
|
||||
${PKG_CONFIG-pkg-config} --cflags --libs $dep 2>/dev/null || true
|
||||
done
|
||||
|
||||
for header in $headers
|
||||
do LDFLAGS="${LDFLAGS-} -I$header"
|
||||
done
|
||||
|
||||
cat >config.mk <<EOF
|
||||
CFLAGS := ${CFLAGS-} -funsigned-char -ffast-math -std=gnu99
|
||||
LDFLAGS := $LDFLAGS
|
||||
|
@ -38,10 +38,14 @@ _cue_push(c3_ys mov,
|
||||
// (off==0 means we're on a north road)
|
||||
//
|
||||
if ( 0 == off ) {
|
||||
c3_assert(u3R->cap_p > u3R->hat_p);
|
||||
if( !(u3R->cap_p > u3R->hat_p) ) {
|
||||
u3m_bail(c3__meme);
|
||||
}
|
||||
}
|
||||
else {
|
||||
c3_assert(u3R->cap_p < u3R->hat_p);
|
||||
if( !(u3R->cap_p < u3R->hat_p) ) {
|
||||
u3m_bail(c3__meme);
|
||||
}
|
||||
}
|
||||
|
||||
cueframe* fam_u = u3to(cueframe, u3R->cap_p + off);
|
||||
|
@ -138,8 +138,25 @@ _jam_buf_atom(_jam_buf* buf_u, u3_noun a)
|
||||
else {
|
||||
_jam_buf_chop(&buf_u, 2, 1);
|
||||
*top = u3t(a);
|
||||
|
||||
u3R->cap_p += mov;
|
||||
|
||||
// XX disabled for performance
|
||||
// may be unnecessary, u3h_put calls u3r_mug,
|
||||
// which uses and checks the stack
|
||||
//
|
||||
#if 0
|
||||
if ( 0 == off ) {
|
||||
if( !(u3R->cap_p > u3R->hat_p) ) {
|
||||
u3m_bail(c3__meme);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if( !(u3R->cap_p < u3R->hat_p) ) {
|
||||
u3m_bail(c3__meme);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
top = u3to(u3_noun, u3R->cap_p + off);
|
||||
*top = u3h(a);
|
||||
}
|
||||
|
@ -586,8 +586,13 @@ u3a_push(c3_w len_w)
|
||||
top -= len_w;
|
||||
cur = top;
|
||||
u3p(void) cap_p = u3R->cap_p = u3of(void, top);
|
||||
c3_assert(cap_p < u3R->mat_p);
|
||||
c3_assert(cap_p > u3R->hat_p);
|
||||
|
||||
if( !( cap_p < u3R->mat_p &&
|
||||
cap_p > u3R->hat_p ) )
|
||||
{
|
||||
u3m_bail(c3__meme);
|
||||
}
|
||||
|
||||
return cur;
|
||||
}
|
||||
else {
|
||||
@ -595,8 +600,13 @@ u3a_push(c3_w len_w)
|
||||
top += len_w;
|
||||
u3R->cap_p = u3of(void, top);
|
||||
u3p(void) cap_p = u3R->cap_p = u3of(void, top);
|
||||
c3_assert(cap_p > u3R->mat_p);
|
||||
c3_assert(cap_p < u3R->hat_p);
|
||||
|
||||
if( !( cap_p > u3R->mat_p &&
|
||||
cap_p < u3R->hat_p ) )
|
||||
{
|
||||
u3m_bail(c3__meme);
|
||||
}
|
||||
|
||||
return cur;
|
||||
}
|
||||
}
|
||||
|
@ -1345,6 +1345,22 @@ static inline void
|
||||
_n_push(c3_ys mov, c3_ys off, u3_noun a)
|
||||
{
|
||||
u3R->cap_p += mov;
|
||||
|
||||
// XX stack sanity-check disabled for performance
|
||||
//
|
||||
#if 0
|
||||
if ( 0 == off ) {
|
||||
if( !(u3R->cap_p > u3R->hat_p) ) {
|
||||
u3m_bail(c3__meme);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if( !(u3R->cap_p < u3R->hat_p) ) {
|
||||
u3m_bail(c3__meme);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
u3_noun* p = u3to(u3_noun, u3R->cap_p + off);
|
||||
*p = a;
|
||||
}
|
||||
|
@ -1597,10 +1597,14 @@ _mug_push(c3_ys mov,
|
||||
// (off==0 means we're on a north road)
|
||||
//
|
||||
if ( 0 == off ) {
|
||||
c3_assert(u3R->cap_p > u3R->hat_p);
|
||||
if( !(u3R->cap_p > u3R->hat_p) ) {
|
||||
u3m_bail(c3__meme);
|
||||
}
|
||||
}
|
||||
else {
|
||||
c3_assert(u3R->cap_p < u3R->hat_p);
|
||||
if( !(u3R->cap_p < u3R->hat_p) ) {
|
||||
u3m_bail(c3__meme);
|
||||
}
|
||||
}
|
||||
|
||||
mugframe* fam_u = u3to(mugframe, u3R->cap_p + off);
|
||||
|
Loading…
Reference in New Issue
Block a user