ChanServ changed the topic of #zig to: zig programming language | https://ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
ur5us has quit [Ping timeout: 245 seconds]
gracefu_ has quit [Ping timeout: 260 seconds]
eax has joined #zig
<andrewrk> thanks casaca. Loris did an excellent job with it
earnestly has quit [Ping timeout: 260 seconds]
pretty_dumm_guy has quit [Quit: WeeChat 3.2-dev]
hiljusti has joined #zig
hiljusti has quit [Ping timeout: 260 seconds]
eax has left #zig [#zig]
arkurious has quit [Quit: Leaving]
kiedtl has quit [Ping timeout: 252 seconds]
wilsonk_ has quit [Quit: Leaving]
gracefu_ has joined #zig
hiljusti has joined #zig
sm2n has quit [Remote host closed the connection]
sm2n has joined #zig
cole-h has joined #zig
kiedtl has joined #zig
wilsonk has joined #zig
zenkuro has quit [Ping timeout: 265 seconds]
wilsonk has quit [Quit: Leaving.]
wilsonk has joined #zig
hiljusti has quit [Ping timeout: 260 seconds]
Kingreil has quit [Quit: Kingreil]
terinjokes has quit [Quit: ZNC 1.8.1 - https://znc.in]
terinjokes has joined #zig
slowtyper has joined #zig
aerona has quit [Quit: Leaving]
hiljusti has joined #zig
amk has quit [Ping timeout: 240 seconds]
amk has joined #zig
novakane has joined #zig
waleee-cl has quit [Quit: Connection closed for inactivity]
cole-h has quit [Ping timeout: 252 seconds]
eyepatchOwl has quit [Ping timeout: 240 seconds]
ur5us has joined #zig
ur5us has quit [Ping timeout: 245 seconds]
ur5us has joined #zig
CodeSpelunker has joined #zig
slowtyper has quit [Quit: WeeChat 3.1]
hiljusti has quit [Ping timeout: 260 seconds]
SimonNa has joined #zig
CodeSpelunker has quit [Quit: CodeSpelunker]
ur5us has quit [Ping timeout: 268 seconds]
leon-p has joined #zig
kenran has joined #zig
earnestly has joined #zig
shurane has joined #zig
kenran has quit [Remote host closed the connection]
ur5us has joined #zig
leon-p has quit [Ping timeout: 245 seconds]
eyepatchOwl_ has joined #zig
leon-p has joined #zig
ur5us has quit [Ping timeout: 245 seconds]
arkurious has joined #zig
casaca has quit [Ping timeout: 252 seconds]
jokoon has joined #zig
novakane has quit [Ping timeout: 245 seconds]
novakane has joined #zig
a_chou has joined #zig
eyepatchOwl_ has quit [Quit: Connection closed for inactivity]
a_chou has quit [Quit: a_chou]
v0idify has joined #zig
casaca has joined #zig
v0idify has left #zig [#zig]
kenran has joined #zig
<g-w1> https://github.com/ziglang/zig/issues/8786 is also reproing for me on nixos :(
zenkuro has joined #zig
<g-w1> using nix-shell -p gcc gives the further errors that the person in the issue stated about zlib
<g-w1> the question is, why shell out to gcc?
<g-w1> heres the strace w/o gcc https://clbin.com/HbdEY
<g-w1> non-tarball zig works 👌
<g-w1> my guess is the ci got borked
ifreund1 has joined #zig
<g-w1> nvm, its just that my dev env had gcc
<g-w1> TheLemonMan: so now i must have a system c compiler in my env in order to use zig cc?
ifreund has quit [Disconnected by services]
ifreund1 is now known as ifreund
ifreund has quit [Quit: WeeChat 3.1]
ifreund has joined #zig
v0idify has joined #zig
pretty_dumm_guy has joined #zig
cole-h has joined #zig
bitmapper has joined #zig
waleee-cl has joined #zig
jokoon has quit [Quit: Leaving]
<jzelinskie> since zig has comptime, why don't people use it to discover all the C files when they're writing build.zig files that call `lib.addCSourceFile`?
<Nypsie> I've seen people do that ;)
<jzelinskie> ah good, I was afraid there was maybe a reason you can't because I've only seen build files with huge lists of source files
<ifreund> that wouldn't use comptime... just normal code run in the build.zig
<ifreund> and there are very good reasons to explicitly list all the source files instead, infact I'd recommend this
<jzelinskie> yeah good point -- it isn't comptime
<ifreund> meson forces this for example
<jzelinskie> is there a doc for meson that covers the subject well?
<jzelinskie> thanks!
<ifreund> it's also just far more explicit
<jzelinskie> the section actually sounds like an argument to actually make it use comptime though 🤣
<jzelinskie> that section*
<jzelinskie> but yeah, being explicit seems fine
<ifreund> you can't make syscalls at comptime
<jzelinskie> ah, well that settles that ;)
kenran has quit [Quit: leaving]
eyepatchOwl_ has joined #zig
cole-h has quit [Ping timeout: 240 seconds]
zenkuro has quit [Ping timeout: 240 seconds]
zenkuro has joined #zig
<andrewrk> to be clear, build.zig runs at runtime
<andrewrk> but that might be a bit counter intuitive, since it runs before compiling your code
<jzelinskie> yeah, it makes sense if you think of it as a separate build tool
<jzelinskie> which it is or else it'd be some crazy JIT thing
<andrewrk> ifreund, I want to make the default to use zig-provided libc (not try to detect native libc) when compiling natively and not linking any native system libs
<jzelinskie> I'm currently deep in the automake/autotools weeds
<g-w1> * repl: if you try `run` with -ofmt=c you get an access denied error because it tries to execute the .c file as a child process instead of executing `zig run` on it. <- andrewrk do you want `zig run file.zig -ofmt=c` to work, or only `run` in the repl to work for c files?
<andrewrk> jzelinskie, I've found sometimes the best strategy is to just guess rather than try to read all that horrible stuff
<jzelinskie> yeah, I just want to see the final generated makefile
<andrewrk> ah right yeah that's useful. also useful is running a real build with `make VERBOSE=1` and looking at the output
Akuli has joined #zig
<ifreund> andrewrk: I'm fine with that in theory, but don't know how you would implement that
<g-w1> yay! now i won't need gcc for zig
<ifreund> how does the compiler know where a given library comes from? I guess the user has to tell it somehow
<jzelinskie> holy shit yeah... running make with verbose is what I want not to read this mess
<jzelinskie> I'm always afraid to run makefiles because I don't know if they're going to `make install` and just start dumping/overwriting shit to my system
<jzelinskie> I should've just done this in docker :\
<jzelinskie> the `make VERBOSE=1` isn't quite as useful as I'd like because this project using libtool
tefter has quit [Ping timeout: 245 seconds]
tefter has joined #zig
<andrewrk> ifreund, if you pass -lfoo and it's not one of the known libc libs, then it assumes system provided. otherwise, assumes no system dependencies
<andrewrk> this is already the case for whether to run native system include / library directories
<ifreund> ok, and if the user is providing their own shared objects they can just put them on the command line like `zig build-exe -l main.zig foo.so` and we would use the zig-provided libc?
<jzelinskie> are .inc files autotools? it looks like jq stuffs the builtin jq expressions (defined in JQ's expression language) into an object file using whatever tool uses .inc
<ifreund> oops, that should be -lc not -l
<jzelinskie> nvm, it's actually just using the preprocessor to include it
<jzelinskie> is the zig builder ordered in anyway? for example, do I need to specify that I'm linking to libc before I add my C source files?
<g-w1> i don't think so
<g-w1> b.exec is ordered tho ofc
<nerthus> to be a bit of a bikeshedder, in the "how to build LLVM" part of the docs, there is the ~/local suggestion but wouldnt ~/.local be better to respect XDG spec?
<andrewrk> jzelinskie, sometimes C code uses .inc instead of .c when #including stuff
<andrewrk> ifreund, that sounds about right
<jzelinskie> what is PIC when it comes to linking? When I was reading about libtool it talks about it and build.zig for redis forces it on
<jzelinskie> I feel like I can never effectively google this stuff because the words overlap with too many other things
eyepatchOwl_ has quit [Quit: Connection closed for inactivity]
<andrewrk> Position Independent Code. you need it when making a static library but know that it will eventually be linked into a shared library
<betawaffle> jzelinskie: pic can’t use any absolute addresses.
<betawaffle> Like for jumps, globals, etc
pretty_d1 has joined #zig
pretty_dumm_guy has quit [Ping timeout: 265 seconds]
earnestly has quit [Ping timeout: 245 seconds]
pretty_d1 has quit [Quit: WeeChat 3.2-dev]
pretty_dumm_guy has joined #zig
earnestly has joined #zig
mokafolio has quit [Quit: Bye Bye!]
mokafolio has joined #zig
notzmv has quit [Ping timeout: 240 seconds]
mokafolio has quit [Ping timeout: 250 seconds]
notzmv has joined #zig
<jzelinskie> what's the difference between `.linkLibC()` and `.linkSystemLibrary("c")`? is one not using the zig distributed libc?
v0idify has left #zig [#zig]
<ifreund> jzelinskie: there is no difference
<jzelinskie> hmm, I'm not really sure how I should include this `.inc` file, as it `.addCSourceFile()` hates the extension
<ifreund> what is in the file?
<ifreund> .inc isn't some standard C thing unless I'm very mistaken
<jzelinskie> it's a bunch of strings that get #included in another c source file
<ifreund> you don't need to compile it then
<jzelinskie> `static const char jq_builtins[] = #include "src/builtin.inc"` that's the literal code
<ifreund> yes, but all you need to do is make sure it's in the include path
<ifreund> it will then get pulled in when you're compiling the c file that includes it
<jzelinskie> I guess I should use `.addIncludeDir()`then rather than specifying each include file individually?
<ifreund> yes, addIncludeDir() for the directory with your headers
<ifreund> and addCSource() for the .c files
<jzelinskie> `fatal error: 'src/builtin.inc' file not found` :\
<jzelinskie> the src directory has both the headers and the source files
<ifreund> does it have the builtin.inc file too?
<jzelinskie> yep, everything is in src
<ifreund> and did you add "." as an include directory
<jzelinskie> I did "src"
<ifreund> that include statement uses the path src/builtin.inc, which is realtive to the include directory
<ifreund> which means src won't work
<ifreund> because there is no src/src/builtin.inc
<jzelinskie> ah yeah duh
<jzelinskie> that fixed it, damn thanks
<ifreund> no problem!
<jzelinskie> it looks like it's using my system's macos libc and not the target that's shipped with zig, do I have to specify that?
<jzelinskie> error(compilation): clang failed with stderr: /Users/jzelinskie/Code/oss/jq/src/builtin.c:1368:14: error: static declaration of 'strptime' follows non-static declaration
<jzelinskie> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/time.h:117:7: note: previous declaration is here
<jzelinskie> I'm getting quite a few errors from preprocessor macros that are evaluating as if I'm missing things
<ifreund> using native-native-gnu as the target will make it use the libc zig ships
mokafolio has joined #zig
<jzelinskie> I figured that'd be the case with `const target = b.standardTargetOptions(.{});`
<jzelinskie> ah, i'm never setting the target
<ifreund> this default will be changed back to using the libc zig ships when not linking system libs soon
<ifreund> as andrewrk and I were just discussing above :D
novakane has quit [Quit: WeeChat 3.1]
<jzelinskie> 👍
_aaron_ has joined #zig
zenkuro has quit [Ping timeout: 240 seconds]
zenkuro has joined #zig
klltkr has joined #zig
Akuli has quit [Quit: Leaving]
hiljusti has joined #zig
notzmv has quit [Read error: Connection reset by peer]
Kingreil has joined #zig
notzmv has joined #zig
leon-p has quit [Quit: leaving]
mpli98 has joined #zig
mpli98 has quit [Client Quit]
mpli has joined #zig
mpli has quit [Client Quit]
cole-h has joined #zig
mpli has joined #zig
<mpli> hey folks, my friend tried joining this channel for the first time and received a ban for some unknown reason. Can someone explain what happened? (his username is Mysoft)
mokafolio has quit [Quit: Bye Bye!]
<ugla> mpli: does he have a registered nick?
<mpli> give me a sec, ill ask him
jamii has joined #zig
<jamii> Hello!
<jamii> I'm having some trouble with async.
xackus__ has quit [Quit: Leaving]
<jamii> The intention is to suspend this toy interpreter after a fixed amount of work so it can live in another event loop.
<jamii> But with the current code on 0.7.1 I get "awaiting function resumed"
<jamii> I dont understand why. The eval seems to reach suspend{} and then I call resume on it. The later call to await in main isn't even reached.
<jamii> I thought maybe there was a sneaky await on IO somewhere in eval but I don't know how to check.
<AtomToast> Damn, gpa just telling me where I fucked up with a double free is pretty fucking neat
<mpli> @ugla he does and is authenticated as Mysoft
xackus has joined #zig
<AtomToast> <jamii "But with the current code on 0.7"> I don't know much about async but I think using 0.7.1 isn't really recommended
notzmv has quit [Ping timeout: 245 seconds]
<ikskuh> 0.7.1 is soon over half a year old now i think
<jamii> Ok, I'll try with master
marler8997 has joined #zig
braket0 has joined #zig
<jamii> Ok, same on masggter but with a nicer stack trace - https://gist.github.com/jamii/08eeed17955d86e201dc1498619bb638
braket has quit [Ping timeout: 268 seconds]
braket0 is now known as braket
<jamii> Here is a very stripped down version that produces the same error - https://gist.github.com/jamii/fb39e1d2f07f26642b63fbe127033812
<jamii> I guess I have some fundamental misunderstanding here.
<jamii> If I move the suspend into `eval` then it works fine.
<jamii> Is this a bug or am I just totally misunderstanding how suspend works?
Bad_K4rMa has joined #zig
Bad_K4rMa has left #zig [#zig]
nathanael has quit [Remote host closed the connection]
nathanael has joined #zig
<ifreund> mpli: could be that his username is matched by some wildcard ban targeting some past trouble maker, I believe andrewrk is currently the only op here
<mpli> weird, he is pretty chill
<mpli> and he says he didnt get any bans before
klltkr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<mpli> I reached out to andrew, thanks for the help ifreund
<fengb> jamii: b_frame implicitly awaits on a's result. You'll need to manually resume a, which isn't actually set anywhere