neurocyte / flow

Flow Control: a programmer's text editor
MIT License
226 stars 10 forks source link

NCInit failed #5

Closed torshepherd closed 3 months ago

torshepherd commented 3 months ago
~/flow master ❯ ./zig build -Doptimize=ReleaseFast && ./zig-out/bin/flow

flow ERROR: error.NCInitFailed
~/flow master ❯ ;1R!|000000000;10;1c1;0c>|WezTerm 20221119-145034-49b9839f55b:0000/0000/afaf000gb:0000/afaf/d7d75f5frgb:5f5f/0000/ffff/8787;rgb:5f5f/d7d7/0000f/afaf5;rgb:8787/5f5f/5f5f87/8787/d7d77d7/5f5fd7d74;141;rgb:afaf/8787/ffff0;rgb:afaf/d7d7/8787b:afaf/ffff/ffffd7/5f5f/8787787/ffff87874;205;rgb:ffff/5f5f/afaf4;rgb:ffff/afaf/0000b:ffff/d7d7/afaf08/0808/0808262/6262bcbc2026;2$y1016;2$y1;2S1;2S2;0;1397;552S1;0;65536S;552;1397t;24;127t

I think this is an error on my end, notcurses has had issues previously using WSL2 :/ , but should probably handle the init failed gracefully

torshepherd commented 3 months ago

The rest of the text got pasted in the terminal

neurocyte commented 3 months ago

Is this WezTerm on WSL2? Which distro?

neurocyte commented 3 months ago

This error usually means flow (actually notcurses) cannot find terminfo for your terminal.

torshepherd commented 3 months ago

Ubuntu 22.04 in WSL2 yep. I can try alacritty instead tonight

torshepherd commented 3 months ago

Should flow build for windows too? If so I can try natively

torshepherd commented 3 months ago

Just tried on a native Ubuntu 20.04 machine instead, got a different compile error this time

zig build-lib libunistring ReleaseFast native 1 errors

~/.cache/zig/p/.../linux-gnu/lib/thread-optim.h: error: 'sys/single_threaded.h' file not found

torshepherd commented 3 months ago

Ok yep, the issue is with the libunistring-zig dependency - I don't think it's fully hermetic libc?

torshepherd commented 3 months ago

Ok I see the issue. Basically all of the HAVE_X_HEADER in config.h in libunistring-zig are hardcoded to 1. They should probably either check using zig the version of glibc and set them like that or there should be hermetic glibc 2.32 shipped with it

neurocyte commented 3 months ago

Sorry, this is a regression. Flow is supposed to be building with musl on linux, but somewhere the default target got removed.

Try build with:

./zig build -Doptimize=ReleaseFast -Dtarget=native-native-musl

This should succeed on pretty much any linux distro, including WSL2.