sm2n has quit [Read error: Connection reset by peer]
sm2n has joined #zig
<Raito_Bezarius>
hm
<Raito_Bezarius>
I now have an ELF with *only* debug symbols and no code :D
sm2n has quit [Excess Flood]
sm2n has joined #zig
<g-w1>
lol
<Raito_Bezarius>
is there something specific regarding entrypoints when using custom os.system in the root of my source file?
<Raito_Bezarius>
hm maybe I need a linker script
sm2n_ has joined #zig
sm2n has quit [Read error: Connection reset by peer]
xackus has quit [Ping timeout: 240 seconds]
cole-h has quit [Ping timeout: 268 seconds]
pfg_ has joined #zig
cole-h has joined #zig
leon-p has quit [Quit: leaving]
<pfg_>
is there any way to specify -isysroot with zig? I'm trying to build an ios app but it needs `-framework UIKit` which needs `-isysroot $(xcrun --sdk iphonesimulator --show-sdk-path)` otherwise it's not found.
arkurious has quit [Quit: Leaving]
earnestly has quit [Ping timeout: 240 seconds]
<pfg_>
`has_sysroot` seems to automatically use `-isysroot $system_sdk_path` instead of it being possible to specify a custom sysroot
sm2n_ has quit [Remote host closed the connection]
sm2n_ has joined #zig
mikdusan has joined #zig
sm2n_ has quit [Read error: Connection reset by peer]
sm2n has joined #zig
sm2n_ has joined #zig
sm2n has quit [Read error: Connection reset by peer]
sm2n_ has quit [Read error: Connection reset by peer]
<marler8997>
in zig, if it's "packed" it's 18 bytes, which is the correct size based on both what C++ says and the fact that it only works at runtime if it's 18 bytes. But when I mark it as "extern struct", it's 20 bytes
<marler8997>
I'm generating all win32 structs using "extern struct". I'm not sure if this is an exception, or if they're all actually supposed to be packed?
<daurnimator>
marler8997: zig @sizeOf is not the actual size; it's how large it would be in an array. more like `max(@realSize(), @alignOf())`
<marler8997>
using "extern struct" changes the layout in such a way that windows does not recognize it, it's only when I use "packed" that it accepts it
<marler8997>
the WAVEFORMATEX struct is the 3rd parameter, when I use "extern struct" I get error 32 (WAVEERR_BADFORMAT)
<marler8997>
oh interesting, when I copy the struct definition to my local file in C++, the sizeof goes to 20! So the header must be using some sort of alignment directives somewhere
<marler8997>
I don't really see any alignment directives around it...weird
<marler8997>
wow, I can copy the entire header and it still shows sizeof is 20! there's something really wonky going on here
<marler8997>
found it, there's a "#pragma pack(1)" in mmsystem.h around the location where it include mmeapi.h...wow
sord937 has joined #zig
a_chou has joined #zig
<marler8997>
fyi, I realized the metadata does include a "packing size". So I'm translating a packing size of 1 to "packed". Not sure what to do about 2/4 byte packings...?
cole-h has quit [Ping timeout: 252 seconds]
a_chou has quit [Quit: a_chou]
jokoon has joined #zig
elerch has joined #zig
<ikskuh>
ifreund: can i somehow pass a normal shell script to nix-shell?
Bernstein has joined #zig
eyepatchOwl has quit [Remote host closed the connection]
recalloc has quit [Ping timeout: 265 seconds]
recalloc has joined #zig
<ikskuh>
ah, i figured. thanks for the shell.nix file :)
sm2n has quit [Ping timeout: 240 seconds]
sm2n has joined #zig
tefter has joined #zig
sm2n has quit [Excess Flood]
sm2n has joined #zig
sm2n_ has joined #zig
sm2n has quit [Ping timeout: 240 seconds]
earnestly has joined #zig
sm2n_ has quit [Read error: Connection reset by peer]
sm2n has joined #zig
sm2n_ has joined #zig
sm2n has quit [Read error: Connection reset by peer]
sm2n_ has quit [Remote host closed the connection]
sm2n has joined #zig
novakane has quit [Quit: WeeChat 3.1]
sm2n has quit [Remote host closed the connection]
sm2n has joined #zig
novakane has joined #zig
sm2n has quit [Remote host closed the connection]
sm2n has joined #zig
sm2n has quit [Remote host closed the connection]
sm2n has joined #zig
sm2n_ has joined #zig
sm2n has quit [Read error: Connection reset by peer]
jokoon2 has joined #zig
jokoon has quit [Ping timeout: 260 seconds]
sm2n_ has quit [Remote host closed the connection]
sm2n has joined #zig
sm2n_ has joined #zig
sm2n has quit [Read error: Connection reset by peer]
ur5us__ has joined #zig
sm2n_ has quit [Remote host closed the connection]
sm2n_ has joined #zig
knebulae has quit [Read error: Connection reset by peer]
[wtf] has joined #zig
sm2n_ has quit [Remote host closed the connection]
sm2n_ has joined #zig
sm2n_ has quit [Remote host closed the connection]
sm2n_ has joined #zig
<ifreund>
no problem :)
sm2n_ has quit [Read error: Connection reset by peer]
sm2n_ has joined #zig
earl has quit [Ping timeout: 250 seconds]
txdv has quit [Ping timeout: 260 seconds]
earl has joined #zig
sm2n has joined #zig
sm2n_ has quit [Ping timeout: 260 seconds]
<ikskuh>
i maybe should start using nix...
<ikskuh>
but learning another language?
<dutchie>
the nix language is very small
<dutchie>
the main issue in my experience is that the "standard library" isn't very well documented
txdv has joined #zig
<ifreund>
yeah, nix docs suck in general in my experience
mokafolio has quit [Quit: Bye Bye!]
sm2n has quit [Remote host closed the connection]
<ifreund>
I don't think I'll ever use nixos, it doesn't really appeal to my sensibilities, but using nix on void linux for some select projects works pretty well
sm2n has joined #zig
mokafolio has joined #zig
cow-orker has joined #zig
sm2n has quit [Excess Flood]
sm2n has joined #zig
sm2n has quit [Remote host closed the connection]
earl has quit [Ping timeout: 250 seconds]
sm2n has joined #zig
sm2n has quit [Excess Flood]
sm2n has joined #zig
zenkuro has quit [Ping timeout: 246 seconds]
sm2n has quit [Excess Flood]
sm2n has joined #zig
zenkuro has joined #zig
sm2n has quit [Remote host closed the connection]
sm2n has joined #zig
sm2n has quit [Excess Flood]
sm2n has joined #zig
earl has joined #zig
leon-p has joined #zig
sm2n has quit [Excess Flood]
sm2n has joined #zig
ur5us__ has quit [Ping timeout: 240 seconds]
sm2n has quit [Remote host closed the connection]
sm2n has joined #zig
sm2n has quit [Excess Flood]
sm2n has joined #zig
mokafolio has quit [Quit: Bye Bye!]
mokafolio has joined #zig
sm2n has quit [Remote host closed the connection]
sm2n has joined #zig
arkurious has joined #zig
jokoon2 has quit [Ping timeout: 260 seconds]
sm2n_ has joined #zig
sm2n has quit [Ping timeout: 240 seconds]
sm2n_ has quit [Remote host closed the connection]
sm2n has joined #zig
sm2n has quit [Excess Flood]
sm2n has joined #zig
waleee-cl has joined #zig
sm2n has quit [Remote host closed the connection]
sm2n has joined #zig
jokoon2 has joined #zig
tefter has quit [Ping timeout: 246 seconds]
xackus has joined #zig
tefter has joined #zig
knebulae has joined #zig
sm2n_ has joined #zig
sm2n has quit [Read error: Connection reset by peer]
sm2n_ has quit [Read error: Connection reset by peer]
sm2n_ has joined #zig
sm2n_ has quit [Read error: Connection reset by peer]
sm2n_ has joined #zig
sm2n has joined #zig
sm2n_ has quit [Ping timeout: 252 seconds]
sm2n has quit [Read error: Connection reset by peer]
sm2n_ has joined #zig
sm2n_ has quit [Remote host closed the connection]
sm2n_ has joined #zig
sm2n_ has quit [Remote host closed the connection]
sm2n has joined #zig
gracefu has joined #zig
gracefu_ has quit [Ping timeout: 268 seconds]
Kingreil has joined #zig
sm2n_ has joined #zig
sm2n has quit [Ping timeout: 260 seconds]
sm2n_ has quit [Remote host closed the connection]
sm2n_ has joined #zig
Snektron has quit [Ping timeout: 245 seconds]
AtomToast has quit [Ping timeout: 245 seconds]
ugla has quit [Ping timeout: 245 seconds]
siraben has quit [Ping timeout: 245 seconds]
sm2n_ has quit [Read error: Connection reset by peer]
sm2n_ has joined #zig
earl has quit [Ping timeout: 245 seconds]
Snektron has joined #zig
ugla has joined #zig
bitmapper has joined #zig
rtpg has quit [Ping timeout: 250 seconds]
earl has joined #zig
novakane has quit [Quit: WeeChat 3.1]
betawaffle has quit [Ping timeout: 260 seconds]
TheLemonMan has joined #zig
siraben has joined #zig
AtomToast has joined #zig
rtpg has joined #zig
betawaffle has joined #zig
rtpg has quit [Ping timeout: 252 seconds]
betawaffle has quit [Max SendQ exceeded]
betawaffle has joined #zig
sm2n_ has quit [Read error: Connection reset by peer]
sm2n_ has joined #zig
rtpg has joined #zig
marler8997 has quit [Read error: Connection reset by peer]
sm2n_ has quit [Remote host closed the connection]
sm2n_ has joined #zig
adsr has quit [Ping timeout: 265 seconds]
<koakuma>
TheLemonMan, re: lld, that's great, thanks so much! What did you do to make it link?
<TheLemonMan>
I had to implement all the missing relocation types
patwid has quit [Read error: Connection reset by peer]
linuxgemini1 has joined #zig
patwid has joined #zig
<TheLemonMan>
then got sidetracked into upstreaming some LLVM patch in order to write some test cases
adsr has joined #zig
pingiun has quit [Quit: Bye!]
pingiun has joined #zig
dongcarl7 has joined #zig
sm2n has joined #zig
sm2n_ has quit [Ping timeout: 240 seconds]
dongcarl has quit [Quit: Ping timeout (120 seconds)]
linuxgemini has quit [Quit: Ping timeout (120 seconds)]
kragacles has quit [Remote host closed the connection]
<marler8997>
ifreund, are you saying there's already a way to get the package name from log scopes?
<ifreund>
marler8997: no, but when writing a package you can put all of your logging in a scope with the same name as your package, and I would consider this good practice
<marler8997>
yeah I would agree
<ifreund>
the whole point of having scopes in the API was so that you can filter out logging from dependencies
<ifreund>
or, at least having them implemented the way they are with an enum literal
<ifreund>
and you're right that we currently do rely on package authors being well behaved and using a scope unique to their package and not polluting the default scope
<ifreund>
but I'm not convinced we need to introduce more complexity to address that problem
<marler8997>
I see std.log not only being used to differentiate packages, but also contain sub-categories within the same package
<marler8997>
if we didn't need subcategories, we could simplify std.log.scoped to only contain the package name and nothing else
<ifreund>
very true, we do this in stage2
<ifreund>
do we even have a way to get the package name at comptime yet?
<marler8997>
not that I know of, and doing so could pose problems
<ifreund>
I think you need to rework that issue into a proposal for such a bulitin...
<marler8997>
because I'm not sure if Zig assumes that a package will compile the same way depending on if it's package name changes
<marler8997>
my proposal for optional build.zig dependencies ran into this issue as well
<marler8997>
and my idea was to provide the package name, but make it known only at runtime
<ifreund>
I think this area has not received enough attention yet, but will once we self host and shift the focus towards the build system/package manager
<marler8997>
yeah, and yes the proposal is incomplete. I created it for now to document the concept and we might need to wait a bit before we know what the implementation will look like (i.e. how do we get the package name?)
<ifreund>
I think knowing what the implementation would look like is required in order to decide if it is desireable or not
a_chou has joined #zig
<marler8997>
andrewrk, what is your thoughts on having the package name affect compilation? Do we do that today? Should we allow that?
casaca has joined #zig
<TheLemonMan>
marler8997, can you still reproduce #5476?
<marler8997>
TheLemonMan, yup, looks like it's still there
<marler8997>
ifreund, if we allow the package name to affect compilation, the solution should be trivial, I think an enum with all the package names would be nice. If we dont' allow it to affect compilation, it might be quite difficult, I can't think of a solution atm
<TheLemonMan>
can you dump header and debug_dir contents?
<marler8997>
also might need something like that for my build proposal
<marler8997>
but in that case the value could be known at runtime only
<andrewrk>
marler8997, I think this is related to another issue that isn't solved yet, which is wanting to set different optimization modes (-O) per package
<ikskuh>
ifreund: my zig installation now is fucked :(
<ikskuh>
zig init-exe && zig build run
<ikskuh>
fails
<ifreund>
ikskuh: and what does ldd zig say?
<marler8997>
andrewrk, if a package is included multiple times with different names in the same compilation, is it compiled the exact same way?
<ikskuh>
and when cross-compiling for musl with "-Dtarget=x86_64-linux"
<ikskuh>
i got a horrible stack trace
<ifreund>
ikskuh: yeah, that sounds like it's caused by the glibc version mismatch between nix and the rest of your system
jokoon has joined #zig
jokoon2 has quit [Ping timeout: 260 seconds]
pretty_dumm_guy has quit [Ping timeout: 240 seconds]
Akuli has joined #zig
jokoon has quit [Client Quit]
<ikskuh>
yeah
<ikskuh>
i've rolled back to the master from website
sm2n has quit [Read error: Connection reset by peer]
sm2n has joined #zig
sm2n has quit [Remote host closed the connection]
<TheLemonMan>
ifreund, I'm not a fan of adding extra commas out of the blue, after all the lines are broken by the comment and not by the comma
Bernstein has quit [Remote host closed the connection]
<ifreund>
TheLemonMan: My priority is that the behavior is consistent with all the other comma separated lists where we use a trailing comma to indicate that they should be broken over multiple lines
<ifreund>
inserting a comma if comments or multiline strings force the list across multiple lines but there is no trailing comma in the original source is the status quo
<ifreund>
If you'd like to propose changing that I'd recommend doing that in an issue
<TheLemonMan>
nah, I'll close the PR, no time to fight the system
<andrewrk>
btw I'm building a fresh docker image for drone CI in hopes it resolves the issue
<ifreund>
nice
<andrewrk>
all these computers need more babysitting than 2 year olds
<ifreund>
andrewrk: I got zlib cross compiling in zig-bootstrap, but we need to link it in zig's cmake and I'm far from a cmake expert
<andrewrk>
ifreund, what we need for libz.a to go into the correct prefix and then everything should just work
<andrewrk>
the -DCMAKE_PREFIX_PATH
<andrewrk>
(in the lib/ dir of course)
<ifreund>
that's what I thought, but zig's current cmake fails to add that to the linker line for the final binary
<ifreund>
it does "just work" for the llvm builds
<andrewrk>
ah I see. think we need to hard code it
<andrewrk>
zig has no way to know it needs to put libz.a on the linker line otherwise
<andrewrk>
the only improvement I can see there is to add it to target_link_libraries rather than set(EXE_LDFLAGS
<ifreund>
I think we need to only do this if statically linking llvm though as it's a transitive dependency
<ifreund>
but I don't know how to capture that in an if statement. We already have some code that adds -lz for specific targets if statically linking llvm
<ifreund>
but for zig bootstrap we don't set ZIG_STATIC or ZIG_STATIC_LLVM so I'm not sure what to check
<andrewrk>
you can just patch it in, I'll make it cleaner when doing a future update
<ifreund>
alright cool, I think we need to patch the upstream cmake as well since I realized that the master builds for the website are built using the ci scripts
<andrewrk>
ah so when I rebuild the ci tarballs with your changes, it will require libz static lib on the linker line, yeah?
<andrewrk>
that's fine, I'm prepared to deal with that
<andrewrk>
probably will just be -DZIG_LLVM_NEEDS_LIBZ=ON
<andrewrk>
there's no way to find out this information, it has to be provided by the user
<ifreund>
yeah that's right
<ifreund>
I guess that explains why I couldn't find a way if there really is none :D
<ifreund>
perhaps you need to override the default panic handler
<ikskuh>
ifreund: i did that already
<ikskuh>
it look slike it comes from std.debug.panic
<andrewrk>
ikskuh, I have an idea to make this easier with a flag, but haven't tried to implement it yet. in the meantime the trick I use is to delete stuff until the "foo not found" compile errors become useful
<ikskuh>
:D
<ifreund>
ikskuh: did you maken your root.panic override pub?
<andrewrk>
ironically this is exactly the situation the "referenced here" errors are supposed to help with, but in your moment of need they are failing you
<ikskuh>
ifreund: ack.
<ikskuh>
i did all the obvious stuff already :)
<ikskuh>
andrewrk: thanks, that was a good hint
<ikskuh>
my pub log() is the culprit
<ikskuh>
Writer().print
<ikskuh>
ah, no
<ikskuh>
std.heap.GeneralPurposeAllocator
<ifreund>
ah the stack trace printing?
<ikskuh>
yep
<ikskuh>
andrewrk: can i disable stack trace printing?
<andrewrk>
yes. which stack trace are you referring to?
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
<ikskuh>
the one in the GPA, i don't know which one exactly
<andrewrk>
you don't need hacks, you can just do what you want. GPA supports disabling stack traces, also you could just not call the function that does leak checking
<ikskuh>
but i want leak checking *grin*
<ikskuh>
the core problem here imho is that stack trace format *assumes* it goes to stdout
<ikskuh>
and thus uses the detectTtyConfig
<ikskuh>
so if i am on a linux and write a stack trace to a file, it will horribly fail and writes escape codes into my file
<andrewrk>
why won't the tty detection work in that case?
<ikskuh>
because tty_config is determined from std.io.getStdErr()
<mikdusan>
but supportsAnsiEscapeCodes() returns false when .wasi
<ikskuh>
i use .freestanding ;)
mikdusan has quit [Quit: WeeChat 3.0.1]
<ikskuh>
mikdusan: this would also just be a hacky workaround
ur5us__ has joined #zig
stilbruch has quit [Quit: goodbye]
stilbruch has joined #zig
hiljusti has joined #zig
ur5us__ has quit [Ping timeout: 245 seconds]
zenkuro has quit [Ping timeout: 252 seconds]
<ifreund>
Q/bu3
<ikskuh>
ifreund: wanna change the password?
<ikskuh>
hm, what would be a appropiate strategy for fixing the escape code thingy?
<ifreund>
ikskuh: that was a fumbled /buffer 3 since I alread had typed a Q here for some reason :P
<ikskuh>
:D
bitmapper has joined #zig
pretty_dumm_guy has joined #zig
<ikskuh>
huh
<ikskuh>
> GPA supports disabling stack traces, also you could just not call the function that does leak checking
<ikskuh>
this didn't work, the code is still referenced
<ikskuh>
also: if i want a resettable GPA, should i back it by a arena allocator?
<ikskuh>
or does gpa.deinit() free unfreed data?
[wtf] has quit [Quit: [wtf]]
<andrewrk>
gpa cannot support freeing leaked memory because it is designed to work in release modes as well, in which case it does not track leaked memory
<ikskuh>
okay
<ikskuh>
so i'm using a backing allocator with arena backing
<ikskuh>
hm, disabling safety solves the problem
hiljusti has quit [Ping timeout: 260 seconds]
<ifreund>
andrewrk: the zig-bootstrap zlib PR should be ready to go whenever you get around to updating CI tarballs :)
<andrewrk>
thanks!
<ifreund>
time to take a look at the system libc linking default thing
novakane has quit [Quit: WeeChat 3.1]
<ifreund>
that was easy :)
<g-w1>
tysm
<ifreund>
no problem, I prefer to fix things I personally broke if possible :D
<g-w1>
same
_aaron_ has quit [Quit: Leaving]
ur5us__ has joined #zig
ur5us__ has quit [Remote host closed the connection]
ur5us__ has joined #zig
nvmd has joined #zig
sord937 has quit [Quit: sord937]
tefter has quit [Remote host closed the connection]
tefter has joined #zig
nvmd has quit [Quit: Later nerds.]
Akuli has quit [Quit: Leaving]
hiljusti has joined #zig
<Raito_Bezarius>
var user_stack = [_]u64{0} ** 1024;
<Raito_Bezarius>
why is it valid?
<Raito_Bezarius>
invalid*
<g-w1>
please say the error
<Raito_Bezarius>
ahem none
<Raito_Bezarius>
the zig fmt has an old invalid error
<Raito_Bezarius>
like missing semicolon
<Raito_Bezarius>
but compiling this works just fine…
<g-w1>
what zig version?
<Raito_Bezarius>
~0.8
<Raito_Bezarius>
the ~ is because I'm using a precise commit
<Raito_Bezarius>
yes it was an invalid syntax at some point $t_0
<Raito_Bezarius>
and then the error stuck and made me believe it was invalid syntax at $t_0 + Δ
<Raito_Bezarius>
but it was remnants of $t_0
hiljusti has quit [Ping timeout: 260 seconds]
<Raito_Bezarius>
can it be normal that Zig do not generate any valid instruction in the binary for a certain addr?
<Raito_Bezarius>
I have some user_fn doing some stuff, when I take its ptr at runtime, it gives me some addr α, I know how much I need to adjust to know the runtime addresses as I have my image base β
<Raito_Bezarius>
so I check with objdump the binary at α + β
<Raito_Bezarius>
and see it does not exist in the binary, but at the runtime, something writes into it
<Raito_Bezarius>
some invalid code btw
hiljusti has joined #zig
<Raito_Bezarius>
it goes from 0x0 → 0xd8a0 (binary is loaded by UEFI) → 0x63e88a0 (something happens??)