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/
vpzom has joined #zig
<vpzom> What do I need to do to see line numbers in error traces? All I'm getting right now is "???:?:?:"
utzig has quit [Ping timeout: 268 seconds]
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 245 seconds]
utzig has joined #zig
utzig has quit [Ping timeout: 245 seconds]
neceve has quit [Remote host closed the connection]
mahmudov has quit [Ping timeout: 240 seconds]
<andrewrk> vpzom, do basic examples work for you? e.g. hello world with @panic("foo");
<andrewrk> philipwhite, given that 0.5.0 is to be released Monday, I think it would be good to use master branch
rifkik has joined #zig
dimenus has quit [Ping timeout: 240 seconds]
<rifkik> andrewrk, I feel like we should add a code of conduct, so that people won't act horribly to each other
chemist69 has quit [Ping timeout: 276 seconds]
chemist69 has joined #zig
_whitelogger has joined #zig
rifkik has quit [Remote host closed the connection]
_whitelogger has joined #zig
Mr_Slurpy has joined #zig
philipwhite has quit [Ping timeout: 245 seconds]
diltsman has joined #zig
zxrf has quit [Ping timeout: 252 seconds]
knebulae has quit [Read error: Connection reset by peer]
Mr_Slurpy has quit [Remote host closed the connection]
knebulae has joined #zig
diltsman has quit [Read error: Connection reset by peer]
hasanyasin has joined #zig
<hasanyasin> Hello all, total Zig noob here. Quick question: I have checked the zig source for command line arguments, but zig compiler CLI itself seems to be in
<hasanyasin> Hello all, total Zig noob here. Quick question: I have checked the zig source for command line arguments, but zig compiler CLI itself seems to be in CPP.
<hasanyasin> Is this the standard way to read command line arguments:
<hasanyasin> ```
<hasanyasin> ``` const args = try std.process.argsAlloc(allocator); if (args.len < 2) { return error.NoCommand; }```
<hasanyasin> ` const args = try std.process.argsAlloc(allocator); if (args.len < 2) { return error.NoCommand; }`
<hasanyasin> os.argv is also assigned in `lib/std/process.zig`, but it seems like in a posix-only block.
traviss has joined #zig
<traviss> did you try `var arg_it = os.args();`?
<hasanyasin> There seems to be a difference between 0.4 and master as args --> argv. I saw the method I used above on documentation, but that example was about wasm backend.
<hasanyasin> If you were to write a tutorial or documentation, what way would you show this?
<hasanyasin> I am not sure either, and that is why I wanted to ask. :D
<hasanyasin> By change at master (from args to argv), I meant os.args, not process. args.
<hasanyasin> Thank you so much @traviss. Maybe I should also check other open source projects under Zig in the wild section on the homepage.
<traviss> sounds like a good idea. i'm pretty new to zig as well so glad i could help.
<hasanyasin> (y)
hasanyasin has quit [Ping timeout: 260 seconds]
owl_000 has joined #zig
owl_000 has left #zig ["Leaving"]
hasanyasin has joined #zig
rifkik has joined #zig
hasanyas_ has joined #zig
hasanyasin has quit [Remote host closed the connection]
porky11 has joined #zig
hasanyas_ has left #zig [#zig]
hasanyasin has joined #zig
_whitelogger has joined #zig
mahmudov has joined #zig
donpdonp has quit [Read error: Connection reset by peer]
donpdonp has joined #zig
Hirezias has joined #zig
traviss has quit [Ping timeout: 265 seconds]
hasanyasin has quit [Remote host closed the connection]
<scientes> how do i link against system libc?
wootehfoot has joined #zig
rifkik has quit [Ping timeout: 276 seconds]
FireFox317 has joined #zig
mahmudov has quit [Ping timeout: 240 seconds]
Hirezias has quit [Ping timeout: 246 seconds]
Hirezias has joined #zig
utzig has joined #zig
mahmudov has joined #zig
rifkik has joined #zig
rifkik has quit [Client Quit]
utzig has quit [Ping timeout: 265 seconds]
rifkik has joined #zig
Ichorio has joined #zig
LargeEpsilon has joined #zig
FireFox317 has quit [Ping timeout: 276 seconds]
mahmudov has quit [Ping timeout: 245 seconds]
<keegans> scientes: --link c
<keegans> or linkLibC in build.zig
<scientes> that actually doesn't do it
<scientes> -target x86-64-linux-gnu fixed it
<keegans> oh , the default target is musl for -static , right ?
<keegans> makes sense then
utzig has joined #zig
waleee-cl has joined #zig
LargeEpsilon has quit [Ping timeout: 240 seconds]
lunamn_ has quit [Ping timeout: 240 seconds]
lunamn has joined #zig
hasanyasin has joined #zig
lunamn has quit [Ping timeout: 276 seconds]
lunamn has joined #zig
mahmudov has joined #zig
return0e has quit [Ping timeout: 240 seconds]
utzig has quit [Read error: Connection reset by peer]
akhetopnu has joined #zig
return0e has joined #zig
hasanyasin has quit [Remote host closed the connection]
hasanyasin has joined #zig
LargeEpsilon has joined #zig
hasanyasin has quit [Ping timeout: 268 seconds]
porky11 has quit [Ping timeout: 264 seconds]
<andrewrk> scientes, -lc does it. without a target specified it uses the native system
<scientes> oh ok
lunamn_ has joined #zig
lunamn has quit [Ping timeout: 245 seconds]
Traviss__ has joined #zig
<andrewrk> keegans, I'm merging your PR locally, playing around with it
<keegans> awesome let me know if you have any questions with setup
<andrewrk> I have 1 question - I tried removing crt_begin.o, crtbegin_dynamic.o, crtend_android.o and it builds & links just fine. can you confirm this works?
<andrewrk> I have reason to believe those .o files are not necessary
<andrewrk> here's my local diff: https://clbin.com/LEgtk
<keegans> oh
<keegans> yeah let me try it with the exe i was working on
<keegans> nah it breaks
<andrewrk> ok good to know thanks
<keegans> libc: Fatal signal 4 (SIGILL), code 2 (ILL_ILLOPN), fault addr 0x4000000000 in tid 73238 (snap-zig), pid 73238 (snap-zig)
<keegans> causes it to jump into garbage
<keegans> i think i tried this earlier too , yeah
<keegans> but worth a shot for sure
<andrewrk> I think the logic needs to be slightly different - it's always picking the dynamic one even when it could pick crtbegin_static.o
<andrewrk> how do you test running binaries btw?
<keegans> qemu , i compiled bionic from source off the tree and placed it in /system
<andrewrk> interesting
<keegans> it is really hacky , i can send the sysroot if you like
<keegans> that way qemu can load /system/lib/linker64
<keegans> so i can ensure that our dynamic binaries produced work
<andrewrk> I bet it would work with qemu -L android-ndk-r20/some/path
<keegans> no the ndk doesnt come with the linker
<andrewrk> oh
<keegans> but as i mentioned earlier you have to clone the entire 60gb android source tree to just build bionic
<keegans> and i also build toybox and mksh so i can chroot into an android-like environment to play around
<andrewrk> that's a lot of bytes
<andrewrk> I wonder what it would look like to set up something on the CI to get android test coverage
<keegans> yeah i have fresh android 9 builds of bionic and mksh and toybox for aarch64,arm32&x86,x86_64
<keegans> but it is very annoying to get it all set up
<andrewrk> I'll finish up the review on the PR right now. Just a couple tweaks and I think it's ready to merge
<keegans> sounds good :D
<keegans> yeah i will think about the CI thing . i think we could maybe just build a sysroot and describe the steps
<keegans> but you certainly don't want to be building bionic on your CI
<andrewrk> it runs fine without -lgcc though? great :)
<andrewrk> yeah one of the nice features of zig is that it provides libcompiler_rt.a for all targets by building it lazily from source
<keegans> yeah it works nicely without -lgcc , and now we don't need to pass that extra library path when building !
<keegans> i modified the set-up guide accordingly
<andrewrk> ok have a look at those comments and see what you think
<andrewrk> zig contributors are conspiring to delay 0.5.0 by forcing me to type up even more release notes :)
<keegans> andrewrk: not sure i follow here : https://github.com/ziglang/zig/pull/3331#discussion_r329318107
<keegans> so leave the code as it was, then have an if below for is target android then embed that if else inside ?
<andrewrk> keegans, my suggestion is https://clbin.com/TeLKL
<andrewrk> when I ls toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/23/ I see crtbegin_dynamic.o and crtbegin_static.o
<keegans> ah
<andrewrk> I also see crtbegin_so.o and crtend_so.o which makes me think that might be needed when doing `zig build-lib -dynamic`
<andrewrk> that can be handled separately from this PR though
<andrewrk> I'm getting the impression that android is a total mess
<andrewrk> so many things are unnecessarily nonstandard
<keegans> :D
<andrewrk> it's good to have an android developer in the community though :)
<andrewrk> a general-purpose language benefits from having diversity of users
Hirezias has quit [Ping timeout: 240 seconds]
<andrewrk> after I rewrite Groove Basin in Zig, maybe I'll make a simple android app that acts as a remote (pause/play, previous song, next song)
<andrewrk> keegans, looks good to me, ready for merge?
Hirezias has joined #zig
<keegans> just got back : sounds good ! let's do it
<keegans> make sure my changes were satisfactory
<andrewrk> yep
<andrewrk> merged
<andrewrk> thanks for your contributions :)
<keegans> thank you for zig :D
<andrewrk> alright I gotta close IRC and spend all day typing up release notes
<keegans> haha have fun, lots of good stuff for the release
<keegans> i'll continue hacking away at my android project
Ichorio has quit [Ping timeout: 245 seconds]
LargeEpsilon has quit [Ping timeout: 240 seconds]
<stratact> andrewrk: just a friendly reminder on my PR :D
<stratact> crap, I guess I was forgotten...
Akuli has joined #zig
rocx has joined #zig
<andrewrk> stratact, your PR is still tagged with the 0.5.0 milestone, it's not forgotten
utzig has joined #zig
<andrewrk> no promises though, I am really behind on release notes
<scientes> how am i suppose to look for a shared library in the current directory?
<scientes> instead of installing it
<scientes> <andrewrk> scientes, -lc does it. without a target specified it uses the native system
<scientes> I'm not seeing that
<scientes> i can only link against glibc's libmvec if I use -target glibc
<scientes> oh that doesn't work either, i have to use -L/lib/x86_64-linux-gnu/
<scientes> perhaps it is assuming merged /usr
Hirezias has quit [Ping timeout: 276 seconds]
Hirezias has joined #zig
LargeEpsilon has joined #zig
utzig has quit [Ping timeout: 276 seconds]
utzig has joined #zig
LargeEpsilon has quit [Ping timeout: 245 seconds]
avoidr has quit [Changing host]
avoidr has joined #zig
utzig has quit [Read error: Connection reset by peer]
Akuli has quit [Quit: Leaving]
adonese has joined #zig
<scientes> <andrewrk> scientes, -lc does it. without a target specified it uses the native system
<scientes> i'm not experiencing this, looking at --verbose-link
<scientes> and -gnu doesn't build libmvec
<scientes> ahh its because of the way we manage symbols
<scientes> i see
<scientes> i'll try to submit a patch later
utzig has joined #zig
<scientes> andrewrk, how do you generate abi.txt?
Ichorio has joined #zig
Hirezias has quit [Quit: WeeChat 2.6]
<scientes> yeah you must have a script
<scientes> I need to use that stuff cause if i directly link to the .so i get bad results for some reason
<scientes> and for some reason it works on my laptop, but not a system with glibc 2.29, no idea why
adonese has quit [Ping timeout: 260 seconds]
wootehfoot has quit [Quit: Leaving]
wootehfoot has joined #zig
Ichorio has quit [Ping timeout: 245 seconds]
waleee-cl has quit [Quit: Connection closed for inactivity]
<scientes> andrewrk, can you add libmvec to the glibc ABI stuff, it is not documented enough for me to do it
mipri has joined #zig