~ecs

trapped on the surface of a sphere

https://ecs.d2evs.net

she/her

~ecs/public-inbox

Last active a month ago

~ecs/mrsh-dev

Last active 2 months ago
View more

Recent activity

[PATCH helios] add mailmap 27 days ago

From Ember Sawady to ~sircmpwn/helios-devel

---
still don't love this part of git tbqh
 .mailmap | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 .mailmap

diff --git a/.mailmap b/.mailmap
new file mode 100644
index 0000000..fa10312
--- /dev/null
+++ b/.mailmap
@@ -0,0 +1 @@
Ember Sawady <ecs@d2evs.net>
--
[message trimmed]

Re: No bit-wise unary inverse op? a month ago

From Ember Sawady to ~mpu/qbe

On Fri Jun 14, 2024 at 1:03 AM UTC, Roland Paterson-Jones wrote:
> Obviously both neg and not can be constructed from existing binary ops
> with a constant arg. Also neg is possibly specially defined for
> floating point?

floating-point neg can't be trivially reimplemented, since:

%out =d sub d_0, d_0

is +0.0, whereas

%out =d neg d_0

is -0.0

Re: How to convert f32/f32 into host-related (endianness) bytes? a month ago

From Ember Sawady to ~sircmpwn/hare-users

On Thu Jun 13, 2024 at 5:38 AM UTC, Ye Wison wrote:
> My question: What's the best way to convert `f32/f64` into
> host-related (endianness) bytes?

math::f{32,64}bits followed by the same thing you're doing for u{32,64} 
should be right

Re: Passing a slice of strings to a variadic function a month ago

From Ember Sawady to ~sircmpwn/hare-users

On Thu Jun 13, 2024 at 4:23 AM UTC, Eze Anyanwu wrote:
> Version info would probably be useful huh...

nah, the version isn't really gonna be relevant; that's not gonna work 
regardless of version, and so long as you're using something from after 
for-each was introduced, my workaround should work fine

Re: Passing a slice of strings to a variadic function a month ago

From Ember Sawady to ~sircmpwn/hare-users

yeah, we've known about this for a while, and unfortunately it's pretty 
much impossible to make work :/

there's a ticket i wrote here https://todo.sr.ht/~sircmpwn/hare/835 
mostly as a placeholder to remind us to take another look into this asp 
in the future in case stuff changes, but for now the best workaround is:

let fmtargs: []fmt::formattable = [];
defer free(fmtargs);
for (let arg .. os::args) append(fmtargs, arg);
fmt::println(fmtargs...);

(a slightly more in-depth explanation of why this can't be made to work: 
(str | ...) has a different representation, and crucially a different

Re: How to use module only for unit test? a month ago

From Ember Sawady to ~sircmpwn/hare-users

On Sun Jun 2, 2024 at 6:57 AM UTC, Ye Wison wrote:
> Ok, thanks for the quick reply:) BTW, is that possible to happen like
> this in the future:

not really. in theory we could have some sort of `use_test` keyword, but 
in practice it's not really worth it

the reason for this, as xha said, is that the build driver needs to 
parse imports, and we don't want it to have to fully parse the entire 
module. if necessary, you can separate your tests out into separate 
foo+test.ha files, which will avoid pulling in dependencies at runtime, 
but in practice it's not particularly an issue: we enable --gc-sections, 
so any unused parts of modules will be removed at link time anyways

[PATCH hare 2/2] linux::vdso: fix memory leak a month ago

From Ember Sawady to ~sircmpwn/hare-dev

Signed-off-by: Ember Sawady <ecs@d2evs.net>
---
 linux/vdso/+linux/vdso.ha | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/linux/vdso/+linux/vdso.ha b/linux/vdso/+linux/vdso.ha
index 0309c223..7a4a0fdc 100644
--- a/linux/vdso/+linux/vdso.ha
+++ b/linux/vdso/+linux/vdso.ha
@@ -34,6 +34,8 @@ type vdso_ctx = struct {

let ctx: nullable *vdso_ctx = null;

@fini fn ctx() void = free(ctx);
[message trimmed]

[PATCH hare 1/2] debug: statically allocate sigaltstack a month ago

From Ember Sawady to ~sircmpwn/hare-dev

Signed-off-by: Ember Sawady <ecs@d2evs.net>
---
 debug/fault.ha | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debug/fault.ha b/debug/fault.ha
index f8ca4934..b038c294 100644
--- a/debug/fault.ha
+++ b/debug/fault.ha
@@ -15,7 +15,7 @@ def ALTSTACK_SIZE: size = 16384;

@init fn init_overflow() void = {
	rt::sigaltstack(&rt::stack_t {
		ss_sp = rt::malloc(ALTSTACK_SIZE): *opaque,
[message trimmed]

Re: [PATCH hare] os::exec: add fallback for pre-faccessat2 linux a month ago

From Ember Sawady to ~sircmpwn/hare-dev

On Tue May 28, 2024 at 6:50 AM UTC, Drew DeVault wrote:
> On pre-faccessat2 can we fallback to faccessat(1)?

i guess we could? it leads to a toctou, since we can't use 
AT_EMPTY_PATH, but maybe that's better than just skipping the check

Re: [PATCH hare] os::exec: add fallback for pre-faccessat2 linux a month ago

From Ember Sawady to ~sircmpwn/hare-dev

someone came into #hare a few weeks ago running ubuntu 20.2 (which uses 
linux 5.4, before faccessat2 was introduced in 5.8), with the build 
driver printing "Error: Command not found: harec"

we traced this back to os::exec erroring out due to faccessat2()
returning ENOSYS. the faccessat2() is in order to fix the following 
scenario:

$ mkdir /tmp/foo
$ mkdir /tmp/bar
$ touch /tmp/foo/baz
$ ln -s $(which true) /tmp/bar/baz
$ env PATH=/tmp/foo:/tmp/bar hare-exec baz