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/
<mkchan> so i can compile my program and run it in release-fast but release-safe and normal debug builds don't finish (they output huge zig-cache folders/.o files and then fail anyway. I'm not sure why it's so large, maybe someone can help me reduce it? Because it basically forces me to throw away asserts and roll my own application-layer flag for a debug build (in release-fast):
<mkchan> https://gist.github.com/Mk-Chan/0e45f17dd0208da6f1339c8735a8cbd1 main() is at the bottom. large input layer (40,960 input features) is probably the cause
<mkchan> besides the inconvenience of losing out on debug and release-safe mode, it's usable, however
cole-h has quit [Quit: Goodbye]
<alexnask[m]> How do they fail in debug mode? Does the compiler crash or is there an error message?
<mkchan> so with build-exe, it outputs a ~6.3GB .o file then crashes with some error, i can get that for you. with zig build and zig-cache it goes up to 32+GB and then i just stop it because it's a bit dangerous to let it go on i suppose
<mkchan> lld error, relocation R_X86_64_32S out of range: 6755902144 is not in [-2147483648, 2147483647]
earnestly has quit [Ping timeout: 256 seconds]
<alexnask[m]> Can you try `@setRuntimeSafety(false);` in your feedForward functions?
<mkchan> sure
<mkchan> ok so release-safe compiles with @setRuntimeSafety(false) and outputs the same sizes as release-fast but debug still blows up
st4ll1 has quit [Ping timeout: 260 seconds]
<alexnask[m]> hm
st4ll1 has joined #zig
<mkchan> actually the release safe binary is 837KB and release-fast is 165KB, sorry
<mkchan> also even release-fast doesn't compile on windows
<mkchan> LLVM out of memory
<daurnimator> justin_smith: FYI std.LinearFifo is a ringbuffer.
ur5us_ has quit [Ping timeout: 260 seconds]
<daurnimator> though it doesn't use any atomics; at least right now....
ur5us_ has joined #zig
reductum has joined #zig
nephele_ has joined #zig
nephele has quit [Ping timeout: 272 seconds]
nephele_ is now known as nephele
<mkchan> upon developing a bit further and actually passing in some real values instead of zero-initializing the network in the same code above, the compiler just runs out of memory and dies. basically using comptime this way is not feasible
<daurnimator> mkchan: the current comptime implementation is.... memory hungry
<daurnimator> mkchan: the one in stage2 should be much better
<mkchan> any idea when that'll be in zig master?
<daurnimator> sorry 2020 has thrown off my crystal ball
<fengb> Rumor is by 0.8.0 release
<mkchan> that's at least 6 months away assuming 0.7.0 is close (with huge optimism)
a_chou has joined #zig
<mkchan> ok, i'll store this code in a gist and revisit it then. I'll just refactor this to define the type non-generically so i can continue with my app
flokli has quit [Ping timeout: 260 seconds]
skrzyp has quit [Ping timeout: 260 seconds]
_whitelogger has joined #zig
a_chou has quit [Remote host closed the connection]
<justin_smith> reposting while it's quieter: I'm working on a blog post about the translation of the example jack simple client from C to Zig, any feedback / review of the code and the refactor are welcome (in particular if I'm missing something that would simplify / improve the code and make it on par with mainstream zig code that I'm missing) https://github.com/noisesmith/zig-jack-examples
<lunamn> justin_smith: cool stuff!! afaik its discouraged to use c pointers ([*c]u8) directly (and may be even fully disallowed in the future, i can't find the specific issue about it), and if i recall correctly, ?[*:0]u8 would be the nicer type as [*c]u8 coerces to that. another point is that at the end of main() you call free and close the jack client but
<lunamn> you could put a 'defer { _ = c.jack_client_close(client); }' right after the client's initialization
_whitelogger has joined #zig
reductum has quit [Quit: WeeChat 2.9]
waleee-cl has quit [Quit: Connection closed for inactivity]
mmohammadi9812 has joined #zig
marnix has joined #zig
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
ur5us_ has quit [Ping timeout: 240 seconds]
cole-h has joined #zig
marnix has quit [Ping timeout: 260 seconds]
marnix has joined #zig
decentpenguin has quit [Read error: Connection reset by peer]
decentpenguin has joined #zig
bsrd has quit [Quit: WeeChat 2.9]
bsrd has joined #zig
cole-h has quit [Quit: Goodbye]
neptunepink has quit [Ping timeout: 240 seconds]
neptunepink has joined #zig
earnestly has joined #zig
ur5us_ has joined #zig
mokafolio has quit [Quit: Bye Bye!]
mokafolio has joined #zig
mmohammadi9812 has quit [Ping timeout: 246 seconds]
dermetfan has joined #zig
mmohammadi9812 has joined #zig
<ifreund> justin_smith: here's my suggestions: https://paste.rs/0XR.diff
<ifreund> notably, you can just use the null keyword instead of defining your own
<ifreund> also, you don't need to export the callback functions, just sest them to callconv(.C)
<ifreund> the rest of the changes are just minor bits of cleanup
<ifreund> you could also just use return instead of all the exit calls in main(), though that's more subjective
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
st4ll1 has quit [Ping timeout: 240 seconds]
mmohammadi9812 has quit [Quit: I quit (╯°□°)╯︵ ┻━┻]
ur5us_ has quit [Ping timeout: 260 seconds]
cmrs has quit [Quit: ZNC 1.7.5 - https://znc.in]
cmrs has joined #zig
st4ll1 has joined #zig
mmohammadi9812 has joined #zig
simp2979 has joined #zig
<simp2979> Hey!
<simp2979> I'm a novice at programming and new to zig, so I was messing around with Zig's std lib to see a bit about how it worked, especially the start.zig code
<simp2979> I have a gist with some printf debugging I did to see how some of it was executed in a windows build
<simp2979> (not familiar with irc much or how code formatting might work so bear with me)
<simp2979> CRTStartup
waleee-cl has joined #zig
<simp2979> I have been looking at this for a while and I can't seem to tell how and why `WinMainCRTStartup`, and `callMain` etc are all being called twice and with no respect to the (hacky) local vars I threw in there.
<simp2979> (I apologize for the borderline offensive way I went about this printf debugging in advance :P )
<simp2979> Is there any place I can look to get an understanding of what's happening here? Thanks in advance! :)
<simp2979> (The gist purposely has a revision without the edits I made to start.zig so you can see the diffs)
<ifreund> simp2979: perhaps you're seeing output from the startup code for the zig build system?
<ifreund> how are you running your program?
<simp2979> I have the build.zig file linked.
<simp2979> With that said I don't know that much about the zig build system, it should be the default from regular old init-exe, iirc
<simp2979> Oh, sorry
<simp2979> I misread.
<simp2979> I'm calling it via a .bat file that I forgot to link.
<simp2979> ```@echo offrem echo %cd%:call ..\..\env\zig.exe build runrem echo ---rem call ..\..\env\zig.exe test src\main.zigrem call ..\..\env\zig.exe run src\main.zig```
<simp2979> (still don't know irc formatting well, let me repost)
<simp2979> @echo offrem echo %cd%:call ..\..\env\zig.exe build runrem echo ---rem call ..\..\env\zig.exe test src\main.zigrem call ..\..\env\zig.exe run src\main.zig
<simp2979> nope, sorry again
mmohammadi9812 has quit [Ping timeout: 258 seconds]
mmohammadi9812 has joined #zig
<simp2979> the important thing there is that the only thing not commented out via `rem` is `call ..\..\env\zig.exe build run`
<simp2979> so just `zig build run`
<simp2979> Hmm, so calling `kanto.exe` directly seems to so all of that once, but then the order still places "all your codebase" in the middle.
<simp2979> So why is `zig build run` returning in this nested fashion? is the `WinMainCRTStartup` being used in `zig.exe`? In any case that gives me a direction to look. Thanks ifreund.
mmohammadi9812 has quit [Ping timeout: 246 seconds]
<ikskuh> `WinMainCRTStartup` is ony of the windows entry points into your executable
<ikskuh> so everyone should use these (windows afaik doesn't execute the function called main)
<simp2979> Uhh, clarify what you mean.
<simp2979> iirc WinMainCRTStartup is how windows, by default, enters, which normally calls all the CRT stuff behind the scenes.
<simp2979> (if you're using msvc or whatever)
<simp2979> But in start.zig, `main` is indeed called via a definition of CRTStartup which is exported at comptime.
marnix has quit [Read error: Connection reset by peer]
<simp2979> but it looks like using `zig build` with the `run` step calls it twice, for whatever reason (and the prints there are nested) I assume it has to do with the build system.
mmohammadi9812 has joined #zig
<ifreund> simp2979: when zig builds and runs your build.zig file, the start code is run
<ifreund> there's nothing very special about the zig build system, you can see the wrapper code in std/special/build_runner.zig
<simp2979> Oh, okay, so that's how zig.exe handles the build file, it compiles the code and runs it on the target platform.
<simp2979> I guess the nesting is what threw me off.
<simp2979> > you can see the wrapper code in std/special/build_runner.zig
<simp2979> Thanks!
<simp2979> I'll look there.
<simp2979> Yep. This explains, thanks again ifreund! :D
<ifreund> no problem!
develonepi3 has joined #zig
mmohammadi9812 has quit [Ping timeout: 240 seconds]
mmohammadi9812 has joined #zig
marnix has joined #zig
st4ll1 has quit [Ping timeout: 256 seconds]
jmiven has quit [Quit: reboot !]
jmiven has joined #zig
skrzyp1 is now known as skrzyp
mmohammadi98120 has joined #zig
mmohammadi9812 has quit [Ping timeout: 272 seconds]
mmohammadi98120 is now known as mmohammadi9812
ifreund1 has joined #zig
ifreund has quit [Ping timeout: 264 seconds]
ifreund1 is now known as ifreund
mmohammadi9812 has quit [Ping timeout: 258 seconds]
mmohammadi9812 has joined #zig
Akuli has joined #zig
mmohammadi9812 has quit [Ping timeout: 265 seconds]
a_chou has joined #zig
mmohammadi9812 has joined #zig
mmohammadi9812 has quit [Ping timeout: 260 seconds]
mmohammadi9812 has joined #zig
mmohammadi9812 has quit [Quit: I quit (╯°□°)╯︵ ┻━┻]
mmohammadi9812 has joined #zig
<justin_smith> lunamn: ifreund: thanks for the read and suggestions, checking it out now
<justin_smith> lunamn: I tried changing "var ports_raw: [*c][*c]const u8 = undefined;" to "var ports_raw: [*c][*:0]const u8 = undefined;" but this fails, as I'm using the return value of a C function directly and the type isn't compatible
<justin_smith> I could hide this usage of [*c] the same way I did all the others, directly using the return value of a C function and relying on inference
<justin_smith> or I could use inline casts surrounding the call
<justin_smith> but IMHO that's not eliminating the problem, that's just shuffling / hiding it
<justin_smith> oh, after another sip of coffee this indeed works: "var ports_raw: [*c]?[*:0]const u8 = undefined;"
<justin_smith> I need to do some pointer exercises to really understand what's going on here, the docs are short but don't directly inform what I see in real code yet...
<ifreund> you really don't need the ports_raw thing, see the diff I linked :)
<justin_smith> ifreund: looking at that next, thanks
<ifreund> [*c] will coerce to any optional zig pointer type
<ifreund> so [*c][*c] will coerce to ?*?[*:0]u8 for example
<justin_smith> ifreund: thanks so much, this is reinforcing that the thing I really need to master is the ? prefix on pointers...
<ifreund> this type can be read as "an optional pointer to a single optional 0-terminated string of u8s"
<ifreund> in pure zig code you don't generally need as much ?s
<ifreund> in C anything can be null though
<justin_smith> ifreund: but the original was a pointer to an array of null terminated strings, the first null string meaning the end of the strings
<justin_smith> or maybe I misunderstand
<ifreund> oh I could have read that wrong
<justin_smith> it's just coincidence that in the simple client code the first port name is always used
<justin_smith> in real code you might iterate the port names
<ifreund> in that case the zig type would be [*:null]?[*:0]u8
<justin_smith> stopping on the first "empty string" which thanks to unboxed arrays is the same as "null element in the array"
<justin_smith> ifreund: I'll try that thanks again
<ifreund> might need ?[*:null]?[*:0]u8 actually, though arguably you shouldn't
xackus_ has joined #zig
<justin_smith> ifreund: I spent a while meditating on that null that could simultaneously be read as "zero length string" and "last element placeholder for null terminated array of strings", I wonder if that has a name
<ifreund> those aren't the same though
<ifreund> a zero length string in c is a non-null pointer to a null byte
<justin_smith> ifreund: how would the bytes in memory be different? an extra pointer dereference right?
<justin_smith> right, got it
<justin_smith> baby brain still learning basics
<ifreund> no worries :)
<justin_smith> ifreund: wow, this is really extensive, and there's a lot I can learn from it
<ifreund> glad it'll be useful, only took me a couple minutes :)
<justin_smith> "var ports_raw: ?[*:null]?[*:0]const u8 = undefined;" did the trick, I'd tried something similar but was missing the ? prefixes
<ifreund> if you use `orelse` on every get_ports() call you can likely get rid of the first ?
<justin_smith> ifreund: also, with that declaration for ports_raw, how would I index it?
<justin_smith> ports_raw[0] is invalid as it's an array
<ifreund> well, you can't safely index a sentinal terminated pointer without iterating it to see how many entries there are
<justin_smith> ahh, so I'd have a loop, and at some point break from the loop with the port I want, or I'd get a count, allocate an array, and index that...
<ifreund> if you know better than the compiler you can of course @ptrCast() it to a [*] pointer instead of [*:null]
<justin_smith> right, but I know it can be null (client with no ports)
<justin_smith> which would be a zero length array
<ifreund> you can also use std.mem.span() to turn it into a slice and then use a for loop
<justin_smith> cool, working on other suggestions and I'll mark that as promising for later
<ifreund> e.g. for (std.mem.span(ports)) |port| { // do something }
<justin_smith> that looks like precisely the semantics I'd want (maybe building a linked list now that I think of it...)
<justin_smith> lunamn: I was able to include both of your suggestions, they are pushed to gh
<justin_smith> ifreund: do I read this correctly, that std.heap.c_allocator.destroy is guaranteed to work on data that some library allocated via malloc and returned to my code?
<leeward> If you're linking to C code, why not use free?
<justin_smith> leeward: that's what I had originally, but ifreund had a useful set of changes including that one
<ifreund> yes, std.heap.c_allocator() wraps malloc/free/destroy
<justin_smith> great
<ifreund> you can just use free, but I apprectiate the type safety of the the zig allocator interface
<justin_smith> ifreund: is it surprising that std.heap.c_allocator wouldn't show up here? https://ziglang.org/documentation/master/std/#std;heap
<ifreund> not terribly, the online docs for the standard library are quite WIP
<leeward> It is a bug though.
<ifreund> i'd recommend just browsing the source, ZLS also helps
<ifreund> indeed
<justin_smith> so to find things like that I'd browse the stdlib code, or see it used in someone else's code
<justin_smith> cool
<leeward> Yeah, the stdlib sources are still the best place to look to find things.
<justin_smith> code reading is also a good way to learn better style / idioms, so looks like that's where I'm headed
<justin_smith> might actually make that lock free stuff today
dermetfan has quit [Ping timeout: 260 seconds]
dermetfan has joined #zig
cole-h has joined #zig
<justin_smith> ifreund: I pushed changes to the repo based on your feedback, I hope it's OK to use your name in the commit / blog post since it was in the diff
<ifreund> sure, my name is fairly public knowledge :)
<fengb> Mr Freund??
<ifreund> who would have guessed? :P
mokafolio has quit [Quit: Bye Bye!]
mokafolio has joined #zig
mokafolio has quit [Client Quit]
<companion_cube> andrewrk: did you think further about `block { … break }` ?
mokafolio has joined #zig
<andrewrk> I'll open a proposal
<companion_cube> :)
develonepi3 has left #zig ["Leaving"]
layneson has joined #zig
frett27 has joined #zig
LanceThePants has quit [Read error: Connection reset by peer]
LanceThePants has joined #zig
mokafolio has quit [Quit: Bye Bye!]
mokafolio has joined #zig
a_chou has quit [Quit: a_chou]
<nikki93> can you use inline for or sth like that to define a struct with members based on some list?
<ifreund> nikki93: you want @Type()
<nikki93> like eg. if you had a func that takes some struct type and returns a type with the same members as that one (maybe with some filter) + some others or sth
<ifreund> note that support for creating structs with @Type() is fairly new, so you'll need a recent master build
<nikki93> ooh interesting. so you build a type info then you can make a type out of it. cool
radgeRayden has quit [Ping timeout: 272 seconds]
wootehfoot has joined #zig
mokafolio has quit [Quit: Bye Bye!]
mokafolio has joined #zig
mokafolio has quit [Client Quit]
mokafolio has joined #zig
marnix has quit [Ping timeout: 260 seconds]
frett27 has quit [Ping timeout: 240 seconds]
jjsullivan__ has joined #zig
st4ll1 has joined #zig
mmohammadi9812 has quit [Quit: I quit (╯°□°)╯︵ ┻━┻]
wilsonk has quit [Quit: Leaving.]
wilsonk has joined #zig
wootehfoot has quit [Read error: Connection reset by peer]
marnix has joined #zig
st4ll1 has quit [Ping timeout: 256 seconds]
st4ll1 has joined #zig
marnix has quit [Ping timeout: 265 seconds]
radgeRayden has joined #zig
marijnfs has joined #zig
<marijnfs> why can't i perform the binary ~ in a comptime int?
<Nypsie[m]> I assume it's because comptime int doesn't have any bitsize
<marijnfs> would i have to intcast it or something?
<Nypsie[m]> So you'd have to explicity coerce it to a type with @as(..., int)
<Nypsie[m]> i.e. `const x = ~@as(u8, 100)`
st4ll1 has quit [Ping timeout: 265 seconds]
<marijnfs> ok that seems to work
<marijnfs> it @as better than @intCast?
<Nypsie[m]> For comptime int yes
<ifreund> @as() is always safe
<Nypsie[m]> True, but the input must be comptime known, right?
<ifreund> not necessarily
<Nypsie[m]> Ah ok, good to know :)
<ifreund> you can use as to cast from a runtime known u32 to usize for example
<ifreund> and yeah, always use @as() over @intCast() or similar if you can
st4ll1 has joined #zig
mokafolio has quit [Quit: Bye Bye!]
mokafolio has joined #zig
mmohammadi9812 has joined #zig
mokafolio has quit [Client Quit]
mokafolio has joined #zig
mokafolio has quit [Client Quit]
<marijnfs> i'm now defining an enum, and i have some values that are assigned 127
<marijnfs> but I get the error that it doesn't fit a u5
<marijnfs> why does it want u5?
<marijnfs> basically there is a skip in the enum values, so total of enums in there is not so large
mmohammadi9812 has quit [Quit: I quit (╯°□°)╯︵ ┻━┻]
nvmd has quit [Quit: Later nerds.]
dch has quit [Ping timeout: 244 seconds]
rzezeski has quit [Ping timeout: 240 seconds]
<ifreund> u5 is the smallest type that can represent enough distinct numbers for all of your enum variants
wjlroe has quit [Ping timeout: 244 seconds]
nikki93 has quit [Ping timeout: 244 seconds]
yrashk has quit [Ping timeout: 260 seconds]
l1x has quit [Ping timeout: 246 seconds]
tracernz has quit [Ping timeout: 244 seconds]
jzelinskie has quit [Ping timeout: 260 seconds]
euantorano has quit [Ping timeout: 260 seconds]
kwilczynski has quit [Ping timeout: 260 seconds]
wjlroe has joined #zig
rzezeski has joined #zig
waleee-cl has quit [Ping timeout: 260 seconds]
eddyb[legacy] has quit [Ping timeout: 260 seconds]
r0bby has quit [Ping timeout: 260 seconds]
betawaffle has quit [Ping timeout: 260 seconds]
<marijnfs> ifreund: but if i specifically mention a value of 127 then it doesn't fit
gonz_ has quit [Ping timeout: 260 seconds]
r0bby has joined #zig
yrashk has joined #zig
mokafolio has joined #zig
<ifreund> you can use enum(u8) then
betawaffle has joined #zig
dch has joined #zig
tracernz has joined #zig
eddyb[legacy] has joined #zig
waleee-cl has joined #zig
euantorano has joined #zig
nikki93 has joined #zig
kwilczynski has joined #zig
jzelinskie has joined #zig
gonz_ has joined #zig
l1x has joined #zig
ur5us_ has joined #zig
mokafolio has quit [Quit: Bye Bye!]
mokafolio has joined #zig
marnix has joined #zig
mokafolio has quit [Client Quit]
<marijnfs> ifreund: that seems to be what i need
mokafolio has joined #zig
<marijnfs> would make sense if zig can figure that one out
mokafolio has quit [Client Quit]
mokafolio has joined #zig
<ifreund> well, I'm not sure it should implicitly use more bits than necessary to represent all variants
<marijnfs> ifreund: but if one of the values is 127, it needs at least 7 bits right?
<marijnfs> not 5
<marijnfs> i'm trying to use the enum to define different values that happen when reading input
<marijnfs> but it's hard to compare to an enum?
<marijnfs> how do i compare some u8 in this case to an enum
<ifreund> say you have an enum with 4 variants, the minimum number of bits to represent all 4 variants is ld(4) = 2
<ifreund> @enumToInt()/@intToEnum()
marnix has quit [Ping timeout: 260 seconds]
<marijnfs> i see enumToInt, that does get a bit cumbersome when dealing with c libraries
<ifreund> you may just want some constants in a namespace
<marijnfs> yeah i guess you could represent the enum, but still would need some table to convert to the int value afterwards?
<marijnfs> ifreund: yeah that could work too i guess
<marijnfs> if i put them in a struct the have sort of a namespace?
mokafolio has quit [Quit: Bye Bye!]
<ifreund> yes, a struct without fields is what I mean by a namespace
mokafolio has joined #zig
<ifreund> the "would need some kind of table" thing is why zig doesn't let you use 127 as the value of an enum(u5), it would make @enumToInt()/@intToEnum() not free
<marijnfs> so the range of numbers you use has to be equal to the unique items
LanceThePants has quit [Read error: Connection reset by peer]
Akuli has quit [Quit: Leaving]
LanceThePants has joined #zig
st4ll1 has quit [Ping timeout: 272 seconds]
st4ll1 has joined #zig
marijnfs has quit [Ping timeout: 258 seconds]
wilsonk has quit [Ping timeout: 256 seconds]
wilsonk has joined #zig
jzelinskie has quit [Ping timeout: 260 seconds]
jzelinskie has joined #zig
nikki93 has quit [Ping timeout: 258 seconds]
nikki93 has joined #zig
st4ll1 has quit [Ping timeout: 256 seconds]
st4ll1 has joined #zig
dermetfan has quit [Ping timeout: 260 seconds]
jjsullivan__ has quit [Ping timeout: 260 seconds]
guan has quit [Read error: Connection reset by peer]
karrick has quit [Ping timeout: 244 seconds]
rzezeski has quit [Read error: Connection reset by peer]
nikki93 has quit [Ping timeout: 260 seconds]
waleee-cl has quit [Ping timeout: 240 seconds]
strmpnk has quit [Read error: Connection reset by peer]
jzelinskie has quit [Ping timeout: 260 seconds]
JimRM has quit [Read error: Connection reset by peer]
Cynthia has quit [Ping timeout: 244 seconds]
euantorano has quit [Ping timeout: 260 seconds]
yrashk has quit [Ping timeout: 260 seconds]
betawaffle has quit [Ping timeout: 260 seconds]
tracernz has quit [Ping timeout: 260 seconds]
dch has quit [Ping timeout: 260 seconds]
eddyb[legacy] has quit [Ping timeout: 260 seconds]
r0bby has quit [Ping timeout: 260 seconds]
wjlroe has quit [Ping timeout: 272 seconds]
ovf has quit [Ping timeout: 260 seconds]
nikita` has quit [Ping timeout: 260 seconds]
guan has joined #zig
procnto has quit [Ping timeout: 272 seconds]
dputtick has quit [Ping timeout: 272 seconds]
euantorano has joined #zig
jzelinskie has joined #zig
karrick has joined #zig
wjlroe has joined #zig
betawaffle has joined #zig
nikita` has joined #zig
dputtick has joined #zig
Cynthia has joined #zig
rzezeski has joined #zig
strmpnk has joined #zig
nikki93 has joined #zig
halbeno has quit [Remote host closed the connection]
dch has joined #zig
eddyb[legacy] has joined #zig
procnto has joined #zig
yrashk has joined #zig
tracernz has joined #zig
waleee-cl has joined #zig
ovf has joined #zig
JimRM has joined #zig
r0bby has joined #zig
halbeno has joined #zig
betawaffle has quit [Ping timeout: 258 seconds]
betawaffle has joined #zig
mokafolio has quit [Quit: Bye Bye!]
mokafolio has joined #zig
<justin_smith> I'm trying to build the head of the main repo, wondering if anyone can make heads or tails of these linking errors 200~http://ix.io/2yys
<justin_smith> maybe my system is oddly configured, it's manjaro arm64
<justin_smith> perhaps I don't have a minimum clang version?
<tdeo> i think the build script is supposed to detect that, weird
<justin_smith> what I'm really trying to do is run some tests in std, I'll just point the distro "zig" to the std in my git repo instead of self hosting for now
<justin_smith> next question: file has a relative import and I get - "error: import of file outside package path ../std.zig" - is there a flag / path to set?
<justin_smith> I'm feeling like I'm missing a basic step by step "how to run tests against files in the dev repo" guide
<alexnask[m]> Have you read this document: <https://github.com/ziglang/zig/blob/master/CONTRIBUTING.md>? It describes how to run stdlib tests
<justin_smith> alexnask[m]: that's what I was likely missing thanks
<justin_smith> alexnask[m]: make fails, it seems like an llvm error, this means I can't run the tests in std files without editing them / porting them?
<justin_smith> I"m not trying to run the test suite for all of std, I just want to run the tests against one specific file
<alexnask[m]> You should just run the `zig build test <flags>` steps in your git repo
<alexnask[m]> Ah well you can prob `zig test <path/to/file>`
<justin_smith> then I need a version of master, or a distro, that isn't broken
<alexnask[m]> I thought you had a working `zig` and wanted to test stdlib changes
<justin_smith> right
<justin_smith> zig test gets weird errors because the file hard-codes a path inside the repo
<justin_smith> so there's two versions of std and things are just broken
<justin_smith> maybe I'll just change the test to not do that
<alexnask[m]> I see, check out `zig build --help`, there are a variety of test filters
<justin_smith> I want the tests in this file, filtering it isn't the solution
<justin_smith> I'll just get rid of `const std = @import("../std.zig");` and make the other chnages that might require
<justin_smith> ok, changing an import of "../std.zig" to "std" seems to do what I need
<justin_smith> it would be nice to be able to build locally too but that looks like a much more complex can of worms
gert_ has joined #zig