Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge develop to soon #513

Merged
merged 63 commits into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
034b958
Added boilerplate loch stuff and got it to commit
mopfel-winrux Feb 8, 2023
6a3fc61
Merge remote-tracking branch 'origin/master' into loch
mopfel-winrux Feb 8, 2023
894ecd0
Merge branch 'urbit:develop' into loch
mopfel-winrux Feb 8, 2023
2df93cf
forgot to add the damn main file
mopfel-winrux Feb 8, 2023
b30ac8f
modified loch
mopfel-winrux Feb 10, 2023
538f104
added print out to kick
mopfel-winrux Feb 20, 2023
b1abe83
modified workflow for read, red, and turn
mopfel-winrux Feb 21, 2023
1440c20
cleaned up interface
mopfel-winrux Feb 23, 2023
eccea2b
got read rite working. expanded api
mopfel-winrux Feb 24, 2023
8edcd60
Merge branch 'urbit:develop' into loch
mopfel-winrux Feb 25, 2023
3755c71
latest loch update
mopfel-winrux Mar 21, 2023
bf74688
Merge branch 'urbit:develop' into loch
mopfel-winrux Mar 21, 2023
8aa8310
fixed allocation bug
mopfel-winrux Mar 23, 2023
0a9d1bc
cleaned up some comments
mopfel-winrux Mar 24, 2023
cb20f2f
switch to lick
mopfel-winrux Apr 13, 2023
c97d77c
fixed the weird allocaiton crash on exit
mopfel-winrux Apr 13, 2023
327be05
modified api
mopfel-winrux Apr 13, 2023
71b54a8
changed spew to spit
mopfel-winrux Apr 14, 2023
cf180e8
copied a bunch of conn.c stuff for connections
mopfel-winrux Apr 20, 2023
21e3dd6
fixed spin and shut
mopfel-winrux Apr 25, 2023
eb9b2a6
sends connect and error cards
mopfel-winrux Apr 27, 2023
3d249a7
fixed disconnect
mopfel-winrux Apr 27, 2023
7d570f4
Merge branch 'urbit:develop' into lick
mopfel-winrux Apr 27, 2023
ea9d448
changed name from term to path
mopfel-winrux Apr 27, 2023
4413d20
cleaned up motes.h
mopfel-winrux Apr 27, 2023
fcc72c4
clean up some files made connect and disconenct info wotk with path
mopfel-winrux Apr 27, 2023
dff69fb
motes are in alphebitcal order now
mopfel-winrux Apr 27, 2023
15f01b6
fixed more path bugs
mopfel-winrux May 2, 2023
a4fd674
Merge branch 'urbit:develop' into lick
mopfel-winrux May 3, 2023
c3e5cd8
code cleanup
mopfel-winrux May 4, 2023
cd6bf86
Merge branch 'urbit:develop' into lick
mopfel-winrux May 11, 2023
ee4659f
vere: decrement zuse to %412
joemfb May 16, 2023
b7ec50e
cleaned up u3l_logs
Jun 6, 2023
3640040
changed to kelvin 412
Jun 9, 2023
75c2de5
cleaned up some print out
mopfel-winrux May 25, 2023
abb9d73
modified lick.c during review with @joemf
mopfel-winrux Jun 16, 2023
db19588
made changes @joemfb requested
mopfel-winrux Jun 19, 2023
dcfb38f
vere: decrement arvo to %237
joemfb Jun 20, 2023
0ac06a9
Merge branch 'develop' into next/kelvin/412
joemfb Jun 20, 2023
ef00a90
`%lick` vane (#358)
joemfb Jun 20, 2023
ed86acc
vere: bump %lull kelvin to %323
joemfb Jun 20, 2023
40006ec
pier: propagate pace to mars
pkova Jun 27, 2023
f7a75b5
Refactor the way arguments are passed in bazel, add -flto
fighet-parnet Jun 22, 2023
99bea10
pier: propagate pace to mars (#473)
Jul 3, 2023
6af1e32
update install.md
barter-simsum Jul 3, 2023
aca5410
s/musl-ar/musl-gcc-ar
barter-simsum Jul 3, 2023
ef758f4
Release vere-v2.11 to live (#488)
pkova Jul 5, 2023
d313f08
Merge master back to develop after vere-v2.11 (#489)
pkova Jul 5, 2023
1af525d
ames: forward iff we're a galaxy
matthew-levan Jul 12, 2023
e37e1f1
ames: forward iff we're a galaxy (#493)
matthew-levan Jul 14, 2023
6fe5409
Use llvm@15 linker/ar/nm
fighet-parnet Jul 18, 2023
50d602e
add -flto=thin to mac aarch64 build cflags for ez 10% gain (#469)
barter-simsum Jul 18, 2023
0fed1f9
conn: stop crashing on small receiving buffers
matthew-levan Jul 19, 2023
1384f9d
conn: stop crashing on small receiving buffers (#494)
matthew-levan Jul 20, 2023
3bd881c
`next`: no-op when pace is set to `once`
matthew-levan Jul 28, 2023
31a49f2
`next`: no-op when pace is set to `once` (#498)
matthew-levan Jul 28, 2023
a4d08a1
Merge next/kelvin/412 to develop (#499)
pkova Aug 1, 2023
f27b538
Update VERSION to 2.12
pkova Aug 1, 2023
43a2568
Update VERSION to 2.12 (#501)
pkova Aug 1, 2023
1221b6a
build: upgrade `zlib` to v1.3
matthew-levan Aug 19, 2023
78b9e7a
build: upgrade `zlib` to v1.3 (#503)
pkova Aug 23, 2023
53a4664
flake: update
midlyx-hatrys May 5, 2023
ef803b8
flake: update (#507)
eamsden Aug 31, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 8 additions & 13 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,21 @@ build --@io_bazel_rules_docker//transitions:enable=false
build --flag_alias=clang_version=//:clang_version
build --flag_alias=gcc_version=//:gcc_version

# Use optimized build by default. According to the bazel documentation, this
# corresponds to -O2 -DNDEBUG, but these are overriden in
# //bazel/common_settings.bzl:vere_library.
# https://bazel.build/docs/user-manual#build-semantics
build --compilation_mode=opt

# Don't include source level debug info on macOS. See
# https://github.com/urbit/urbit/issues/5561 and
# https://github.com/urbit/vere/issues/131.
build:linux --per_file_copt='pkg/.*@-g'
build:linux --host_copt='-g'
build --strip=never

# Use -O3 as the default optimization level.
build --per_file_copt='pkg/.*@-O3'
# Turn on optimization, CPU and memory debug for exec config, which we only use
# to run the fake ship tests. Also turn on extra snapshot validation.
build --host_copt='-O3'

# Turn on CPU and memory debug for exec config, which we only use to run the
# fake ship tests. Also turn on extra snapshot validation.
build --host_copt='-DU3_CPU_DEBUG'
build --host_copt='-DU3_MEMORY_DEBUG'
build --host_copt='-DC3DBG'
Expand All @@ -45,12 +47,5 @@ build:mem_dbg --per_file_copt='pkg/.*@-DU3_MEMORY_DEBUG'
build:cpu_dbg --per_file_copt='pkg/.*@-DU3_CPU_DEBUG'
build:snp_dbg --per_file_copt='pkg/.*@-DU3_SNAPSHOT_VALIDATION'

# Enable maximum debug info and disable optimizations for debug config. It's
# important that these lines come after setting the default debug and
# optimization level flags above.
build:dbg --per_file_copt='pkg/.*@-O0'
build:dbg --per_file_copt='pkg/.*@-g3'
build:dbg --per_file_copt='pkg/.*@-DC3DBG'

# Any personal configuration should go in .user.bazelrc.
try-import %workspace%/.user.bazelrc
32 changes: 32 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,38 @@ config_setting(
],
)

#
# CONFIGS DETAILING WHEN TO ENABLE CERTAIN FEATURES BY DEFAULT.
# CHANGES BEHAVIOR OF //bazel/common_settings.bzl:vere_library.
#

config_setting(
name = "thinlto",
constraint_values = [
"@platforms//os:macos",
],
values = {
"compilation_mode": "opt"
}
)

config_setting(
name = "lto",
constraint_values = [
"@platforms//os:linux",
],
values = {
"compilation_mode": "opt"
}
)

config_setting(
name = "debug",
values = {
"compilation_mode": "dbg"
}
)

#
# COMPILERS
#
Expand Down
5 changes: 3 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ bazel build :urbit
```

If you want a debug build, which changes the optimization level from `-O3` to
`-O0` and includes more debugging information, specify the `dbg` configuration:
`-O0` and includes more debugging information, specify `dbg` as the
`compilation_mode`:
```console
bazel build --config=dbg :urbit
bazel build --compilation_mode=dbg :urbit
```
Note that you cannot change the optimization level for third party
dependencies--those targets specified in `bazel/third_party`--from the command
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.11
2.12
4 changes: 2 additions & 2 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,10 @@ versioned_http_archive(
versioned_http_archive(
name = "zlib",
build_file = "//bazel/third_party/zlib:zlib.BUILD",
sha256 = "b3a24de97a8fdbc835b9833169501030b8977031bcb54b3b3ac13740f846ab30",
sha256 = "ff0ba4c292013dbc27530b3a81e1f9a813cd39de01ca5e0f8bf355702efa593e",
strip_prefix = "zlib-{version}",
url = "https://www.zlib.net/zlib-{version}.tar.gz",
version = "1.2.13",
version = "1.3",
)

#
Expand Down
47 changes: 47 additions & 0 deletions bazel/common_settings.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,50 @@ string_flag = rule(
build_setting = config.string(flag = True),
doc = "A string-typed build setting that can be set on the command line",
)

def vere_library(copts = [], linkopts = [], **kwargs):
native.cc_library(
copts = copts + select({
"//:debug": ["-O0", "-g3", "-DC3DBG"],
"//conditions:default": ["-O3"]
}) + select({
"//:lto": ['-flto'],
"//:thinlto": ['-flto=thin'],
"//conditions:default": []
}) + select({
# Don't include source level debug info on macOS. See
# https://github.com/urbit/urbit/issues/5561 and
# https://github.com/urbit/vere/issues/131.
"//:debug": [],
"@platforms//os:linux": ["-g"],
"//conditions:default": [],
}),
linkopts = linkopts + ['-g'] + select({
"//:lto": ['-flto'],
"//:thinlto": ['-flto=thin'],
"//conditions:default": []
}),
**kwargs,
)

def vere_binary(copts = [], linkopts = [], **kwargs):
native.cc_binary(
copts = copts + select({
"//:debug": ["-O0", "-g3", "-DC3DBG"],
"//conditions:default": ["-O3"]
}) + select({
"//:lto": ['-flto'],
"//:thinlto": ['-flto=thin'],
"//conditions:default": []
}) + select({
"//:debug": [],
"@platforms//os:linux": ["-g"],
"//conditions:default": [],
}),
linkopts = linkopts + ['-g'] + select({
"//:lto": ['-flto'],
"//:thinlto": ['-flto=thin'],
"//conditions:default": []
}),
**kwargs,
)
9 changes: 5 additions & 4 deletions bazel/toolchain/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ _aarch64_gcc = "toolchain-gcc-linux-aarch64"

cc_toolchain_config(
name = "gcc-linux-aarch64-config",
ar = "{}/aarch64-linux-musl/bin/aarch64-linux-musl-ar".format(_install_prefix),
ar = "{}/aarch64-linux-musl/bin/aarch64-linux-musl-gcc-ar".format(_install_prefix),
cc = "{}/aarch64-linux-musl/bin/aarch64-linux-musl-gcc".format(_install_prefix),
cc_flags = [
"-static",
Expand Down Expand Up @@ -104,7 +104,7 @@ _x86_64_gcc = "toolchain-gcc-linux-x86_64"

cc_toolchain_config(
name = "gcc-linux-x86_64-config",
ar = "{}/x86_64-linux-musl/bin/x86_64-linux-musl-ar".format(_install_prefix),
ar = "{}/x86_64-linux-musl/bin/x86_64-linux-musl-gcc-ar".format(_install_prefix),
cc = "{}/x86_64-linux-musl/bin/x86_64-linux-musl-gcc".format(_install_prefix),
cc_flags = [
"-static",
Expand Down Expand Up @@ -279,7 +279,7 @@ cc_toolchain_config(
# NOTE: building with `libtool` does not work on macOS due to lack of
# support in the `configure_make` rule provided by `rules_foreign_cc`.
# Therefore, we require setting `ar` as the archiver tool on macOS.
ar = "/usr/bin/ar",
ar = "/usr/local/opt/llvm@15/bin/llvm-ar",
# By default, Bazel passes the `rcsD` flags to `ar`, but macOS's `ar`
# implementation doesn't support `D`. We remove it with this attribute
# and corresponding `ar_flags_feature` in `cfg.bzl`.
Expand All @@ -288,7 +288,8 @@ cc_toolchain_config(
cc = "/usr/local/opt/llvm@15/bin/clang",
compiler = "clang",
compiler_version = "//:clang_version",
ld = "/usr/bin/ld",
ld = "/usr/local/opt/llvm@15/bin/llvm-lld",
nm = "/usr/local/opt/llvm@15/bin/llvm-nm",
sys_includes = [
"/usr/local/Cellar/llvm@15/15.0.7/lib/clang/15.0.7/include",
"/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include",
Expand Down
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion pkg/c3/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
# LIBRARIES
#

cc_library(
load("//bazel:common_settings.bzl", "vere_library")

vere_library(
name = "c3",
srcs = glob(
[
Expand Down
3 changes: 3 additions & 0 deletions pkg/c3/motes.h
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,7 @@
# define c3__ktts c3_s4('k','t','t','s')
# define c3__ktwt c3_s4('k','t','w','t')
# define c3__ktzp c3_s4('k','t','z','p')
# define c3__l c3_s1('l')
# define c3__lamb c3_s4('l','a','m','b')
# define c3__lame c3_s4('l','a','m','e')
# define c3__lang c3_s4('l','a','n','g')
Expand All @@ -686,6 +687,7 @@
# define c3__lg c3_s2('l','g')
# define c3__lib c3_s3('l','i','b')
# define c3__libd c3_s4('l','i','b','d')
# define c3__lick c3_s4('l','i','c','k')
# define c3__life c3_s4('l','i','f','e')
# define c3__lift c3_s4('l','i','f','t')
# define c3__like c3_s4('l','i','k','e')
Expand Down Expand Up @@ -1082,6 +1084,7 @@
# define c3__smts c3_s4('s','m','t','s')
# define c3__snap c3_s4('s','n','a','p')
# define c3__so c3_s2('s','o')
# define c3__soak c3_s4('s','o','a','k')
# define c3__sock c3_s4('s','o','c','k')
# define c3__soft c3_s4('s','o','f','t')
# define c3__sole c3_s4('s','o','l','e')
Expand Down
4 changes: 3 additions & 1 deletion pkg/ent/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
# LIBRARIES
#

cc_library(
load("//bazel:common_settings.bzl", "vere_library")

vere_library(
name = "ent",
srcs = ["ent.c"],
hdrs = ["ent.h"],
Expand Down
4 changes: 3 additions & 1 deletion pkg/noun/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
# LIBRARIES
#

cc_library(
load("//bazel:common_settings.bzl", "vere_library")

vere_library(
name = "noun",
srcs = glob(
[
Expand Down
4 changes: 3 additions & 1 deletion pkg/ur/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
# LIBRARIES
#

cc_library(
load("//bazel:common_settings.bzl", "vere_library")

vere_library(
name = "ur",
srcs = [
"bitstream.c",
Expand Down
4 changes: 3 additions & 1 deletion pkg/urcrypt/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
# LIBRARIES
#

cc_library(
load("//bazel:common_settings.bzl", "vere_library")

vere_library(
name = "urcrypt",
srcs = glob(
[
Expand Down
4 changes: 3 additions & 1 deletion pkg/urcrypt/ge-additions/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
cc_library(
load("//bazel:common_settings.bzl", "vere_library")

vere_library(
name = "ge-additions",
srcs = ["ge-additions.c"],
hdrs = ["ge-additions.h"],
Expand Down
6 changes: 4 additions & 2 deletions pkg/vere/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# GENERATED FILES
#

load("//bazel:common_settings.bzl", "vere_library", "vere_binary")

# An approximation of `xxd -i` that runs on all platforms where Bash is
# present. Generates a `.h` file that declares the array and array length as
# `extern` global variables and a `.c` file containing the array and array
Expand Down Expand Up @@ -86,7 +88,7 @@ genrule(
# LIBRARIES
#

cc_library(
vere_library(
name = "vere",
srcs = glob(
[
Expand Down Expand Up @@ -138,7 +140,7 @@ cc_library(
# BINARIES
#

cc_binary(
vere_binary(
name = "urbit",
srcs = [
"main.c",
Expand Down
1 change: 1 addition & 0 deletions pkg/vere/auto.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ u3_auto_init(u3_pier* pir_u)
car_u = _auto_link(u3_unix_io_init(pir_u), pir_u, car_u);
car_u = _auto_link(u3_term_io_init(pir_u), pir_u, car_u);
car_u = _auto_link(u3_fore_io_init(pir_u), pir_u, car_u);
car_u = _auto_link(u3_lick_io_init(pir_u), pir_u, car_u);

return car_u;
}
10 changes: 9 additions & 1 deletion pkg/vere/io/ames.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
c3_d fod_d; // forwards dropped count
c3_d foq_d; // forward queue size
c3_d fow_d; // forwarded count
c3_o for_o; // forwarding enabled
c3_d hed_d; // failed to read header
c3_d vet_d; // version mismatches filtered
c3_d mut_d; // invalid mugs filtered
Expand Down Expand Up @@ -1993,7 +1994,9 @@ _ames_hear(u3_ames* sam_u,
&& ( (pac_u->pre_u.rec_d[0] != sam_u->pir_u->who_d[0])
|| (pac_u->pre_u.rec_d[1] != sam_u->pir_u->who_d[1]) ) )
{
_ames_try_forward(pac_u);
if ( c3y == sam_u->sat_u.for_o ) {
_ames_try_forward(pac_u);
}
}
else {
// enter protocol-specific packet handling
Expand Down Expand Up @@ -2458,6 +2461,11 @@ u3_ames_io_init(u3_pier* pir_u)
sam_u->fig_u.see_o = c3y;
sam_u->fig_u.fit_o = c3n;

// enable forwarding on galaxies only
u3_noun who = u3i_chubs(2, sam_u->pir_u->who_d);
u3_noun rac = u3do("clan:title", who);
sam_u->sat_u.for_o = ( c3__czar == rac ) ? c3y : c3n;

// hashtable for scry cache
//
// 1500 bytes per packet * 100_000 = 150MB
Expand Down
7 changes: 2 additions & 5 deletions pkg/vere/io/conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,12 +337,9 @@ _conn_moor_bail(void* ptr_v, ssize_t err_i, const c3_c* err_c)

if ( err_i != UV_EOF ) {
u3l_log("conn: moor bail %zd %s", err_i, err_c);
if ( _(can_u->liv_o) ) {
_conn_send_noun(can_u, u3nq(0, c3__bail, u3i_word(err_i),
u3i_string(err_c)));
can_u->liv_o = c3n;
}
can_u->liv_o = c3n;
}

_conn_close_chan(san_u, can_u);
}

Expand Down
Loading