ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
<_0joshuaolson1>
Thankfully, that won't be necessary. llvm-devel did get me Core.h, I just used 'find' wrong too... (sorry). Trying again.
<_0joshuaolson1>
I double-checked - I applied the diff to the right file, and I have /usr/include/llvm-c/Core.h. Same output, though. I have CMake 3.10.1
<hopppetosse>
andrewrk: would it be possible to have both release and debug builds for windows on appveyor?
<andrewrk>
hopppetosse, the debug build of llvm+clang for windows is quite large
<andrewrk>
I think if you need to debug zig itself, it's a fair requirement to build from source
<_0joshuaolson1>
Not including the logs, but I have them
<_0joshuaolson1>
Maybe relevant: the problem is CLANG_INCLUDE_LIBS, not llvm
<_0joshuaolson1>
Do you know a file I can check for that?
<_0joshuaolson1>
Okay, sorry for taking your time. Installing clang-devel on Fedora does pull in Clang, but gcc was used as I wanted. I'll just make a tiny readme PR again and you can nit it there.
<_0joshuaolson1>
*clang the compiler binary*
<andrewrk>
_0joshuaolson1, ok the diff I gave you worked, and it found llvm headers. so we just need clang headers
<andrewrk>
did clang-devel make zig's cmake output work?
<_0joshuaolson1>
Yes, it does work now. But I reverted the diff and it also compiles correctly.
<andrewrk>
oh.
<_0joshuaolson1>
I'll just PR that the 'library' has to include headers (Fedora doesn't think so)
<andrewrk>
just put the word "development" before "libraries"
<_0joshuaolson1>
For LLD too?
<_0joshuaolson1>
Thanks for your patience. PR 808. Have a good one.
<GitHub118>
[zig] 0joshuaolson1 opened pull request #808: Clarify what is meant by 'libraries' (master...patch-1) https://git.io/vAHQ7
_0joshuaolson1 has quit [Quit: Page closed]
<GitHub187>
[zig] andrewrk closed pull request #808: Clarify what is meant by 'libraries' (master...patch-1) https://git.io/vAHQ7
<GitHub179>
zig/master c787837 Joshua Olson: Clarify what is meant by 'libraries' (#808)
hopppetosse has quit [Ping timeout: 240 seconds]
davr0s has joined #zig
noonien has quit [Quit: Connection closed for inactivity]
steveno_ has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
steveno_ has quit [Quit: Leaving]
Tobba has joined #zig
davr0s has joined #zig
jdufault has joined #zig
jdufault has quit [Ping timeout: 260 seconds]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hoppetosse has joined #zig
hopppetosse has joined #zig
return0e_ has quit [Remote host closed the connection]
return0e has joined #zig
hoppetosse has quit [Ping timeout: 240 seconds]
hoppetosse has joined #zig
hopppetosse has quit [Ping timeout: 255 seconds]
<hoppetosse>
MajorLag: I'm still getting that link error, even after specifying the libraries and stdcc
<hoppetosse>
*stdcallcc
<hoppetosse>
I did manage to create a smaller windows.h.zig with WIN32_LEAN_AND_MEAN after andrewrk pointed out I could use an intermediate .h file with all necessary declarations
<hoppetosse>
only about 30k lines
<MajorLag>
Odd. Are you on the latest artifact? That should give a more informative linker error
<hoppetosse>
yep, latest artifact
<hoppetosse>
unless I somehow downloaded the wrong one
<MajorLag>
I'm still using the monstrosity I created without LEAN_AND_MEAN. I've got several hours into cleaning it up at this point. translate-c seems to be unaware that it can't cast between ints and pointers without @intToPtr and @ptrToInt, among about 1000 other little things, like missing macros, intrinsics, and some stuff that is used in assignments but doesn't seem to exist. There's about 140 extern functions that are
<MajorLag>
I that don't actuall seem to exist in any library or dll.
<MajorLag>
and you still just get "error: link error"?
<MajorLag>
Also this is kind of hilarious, it translates `(3*4)` as `(&3)(4)`
<hoppetosse>
hahaha oh my
<hoppetosse>
I'll check my function signatures
<hoppetosse>
actually, now it's error: link failed
<hoppetosse>
With --verbose-link, I get something suspicious
<MajorLag>
that's not much more helpful. Hmm... I wonder what's different? I'm not even linking against anything other than OpenGL that Zig doesn't link behind my back. My build script is just `zig build-exe main.zig --library "./OpenGL32.Lib"`
return0e has quit [Remote host closed the connection]
<MajorLag>
strange... my --verbose-link is identical to yours (plus opengl). I invalidated my zig-cache just to be sure there wasn't something stupid going on there, still built fine.
<hoppetosse>
I think I worked it out
<MajorLag>
what parts of the API are you calling?
<MajorLag>
oh?
<hoppetosse>
It wasn't an issue with the windows api
<hoppetosse>
it was something to do with linking with C
<hoppetosse>
I tried to link it manually, and a few things stood out: I have spaces in the path to my libs, and at some point in my code I was using calloc
<hoppetosse>
I'm not sure where it was going wrong, but I removed the --library c and the call to calloc and it built
<hoppetosse>
also, the output command was lld ...
<hoppetosse>
I had to call with lld-link
<hoppetosse>
also, for some reason, the subsystem was console and not windows, but that fixed itself apparently
<MajorLag>
my subsystem is console, and lld
<MajorLag>
but I don't link with C
hoppetosse has quit [Ping timeout: 255 seconds]
jdufault has joined #zig
hoppetosse has joined #zig
<hoppetosse>
MajorLag: It's all working splendidly now, thanks for everything!
<andrewrk>
hoppetosse, appveyor has multiple branches, I think you wanted to grab the llvm6 branch build
<andrewrk>
MajorLag, hoppetosse, I've been slowly adding the important parts of the windows API into std.os.windows as well
davr0s has joined #zig
<andrewrk>
the nice thing about this is that it doesn't require h file parsing, and if you depend on them you automatically get DLL dependencies of kernel32.dll etc
Hejsil has joined #zig
<andrewrk>
MajorLag, also, zig-cache isn't a cache yet :) it's just a temp folder where everything in it gets overwritten every time you run zig
<andrewrk>
funny how nobody trusts it just because it has "cache" in the name
<andrewrk>
(I don't blame you)
<andrewrk>
computers have taught us not to trust caches
<hoppetosse>
andrewrk: that's right, I got the wrong branch off appveyor
<hoppetosse>
but it works on the other one, so I'm already happy
<hoppetosse>
andrewrk: I noticed translate-c only chokes on a couple of things when using LEAN_AND_MEAN
<hoppetosse>
An enum that has a negative and a hex literal that mess up when choosing the const type
<andrewrk>
hoppetosse, if you collected a couple small examples and filed issues that would be very helpful
<hoppetosse>
the only reason I haven't is that I'm running a release build and can't really file useful reports
hoppetosse has quit [Ping timeout: 255 seconds]
hoppetosse has joined #zig
jdufault has quit [Ping timeout: 265 seconds]
<hoppetosse>
andrewrk: do we still need a debug build of llvm-clang to make a debug build of zig?
<andrewrk>
on windows, yes
<andrewrk>
hoppetosse, why do you need a debug build to find examples of .h files that translate incorrectly?
<MajorLag>
I wish I'd have kept notes on the things translate-c has botched so far, sorry. Offhand: it doesn't realize it needs to use @intToPtr/@ptrToInt, it doesn't know it can't (currently) @ptrCast to a nullable, it tries to negate a literal 0, it thinks (3*4) is a cast, it thinks (CONSTANT - 2) is a cast... lots of things with casting actually, C doesn't make it easy... it doesn't seem to understand 1234UL, it gives up
<MajorLag>
say I blame it), and it set __FLT_EPSILON to 0.000000000 (doesn't handle scientific notation literals?).
<hoppetosse>
I don't need it to find them, but I do to debug them
<hoppetosse>
It doens't handle multi-line macros very well
<hoppetosse>
I'll make issues for the ones that stood out to me
<andrewrk>
ah I see
<MajorLag>
Still, it did pretty well on windows.h considering how monsterously huge it is and how much weird crap it does.
<andrewrk>
MajorLag, thanks! most of these are fixable
<hoppetosse>
andrewrk: should I make a separate issue for each translate-c failure?
<andrewrk>
hoppetosse, yes please
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ofelas has quit [Quit: shutdown -h now]
hopppetosse has joined #zig
hoppetosse has quit [Ping timeout: 276 seconds]
hoppetosse has joined #zig
hopppetosse has quit [Ping timeout: 240 seconds]
hopppetosse has joined #zig
hoppetosse has quit [Ping timeout: 240 seconds]
hoppetosse has joined #zig
hopppetosse has quit [Ping timeout: 240 seconds]
hopppetosse has joined #zig
hoppetosse has quit [Ping timeout: 256 seconds]
hoppetosse has joined #zig
hopppetosse has quit [Ping timeout: 256 seconds]
davr0s has joined #zig
<andrewrk>
hoppetosse, thanks for the writeups
<hoppetosse>
pleased, I'm just trying to track down a couple more
<MajorLag>
Is there a known issue: comptime struct cannot self-reference?
Tobba has quit [Read error: Connection reset by peer]
<MajorLag>
andrewrk re: issue 810: @typeOf(2147483648) is a literal, so we'd end up at the else clause right?: c_int(2147483648) should be an error since max of signed int32 is 2147483647. Unless there's some trickery with c_ types I'm missing.
<andrewrk>
MajorLag, I'm not able to work on it at the moment - can you make an issue for the self-reference thing?
<andrewrk>
duplicate issues are no big deal
<andrewrk>
what's happening in the C code? is it truncating?
<MajorLag>
it's bitcasted. -2147483648
<andrewrk>
ah I see
<andrewrk>
we'll add logic in the generated code from the macro parsing for that
<andrewrk>
MajorLag, thanks
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<hoppetosse>
The new pointer reform will be good for translate-c
<andrewrk>
what in particular?
<andrewrk>
pointer arithmetic?
<hoppetosse>
I'm often running into trouble with flexible array members
<hoppetosse>
struct with the last field being a pointer representing an array of runtime defined lenfght
<hoppetosse>
I just think having a cleaner mapping between c and zig is going to help
return0e has quit [Remote host closed the connection]
<andrewrk>
I think you're right
Tobba has joined #zig
<hoppetosse>
error: array access of non-array type is pretty pervasive
davr0s has joined #zig
<hoppetosse>
error: array access of non-array type is pretty pervasive
<hoppetosse>
sorry, wrong window
isd has joined #zig
return0e has joined #zig
isd has quit [Ping timeout: 260 seconds]
zesterer has joined #zig
isd has joined #zig
cenomla has joined #zig
arBmind has joined #zig
hopppetosse has joined #zig
hoppetosse has quit [Ping timeout: 260 seconds]
<MajorLag>
hoppetosse , if you or anyone else is ineterested, I wrote a comptime utf8 -> utf16 (no-BOM LE) function for use with windows.
Hejsil has quit [Read error: Connection reset by peer]
<hopppetosse>
I haven't needed it yet, but sure =)
<andrewrk>
MajorLag, oh sweet, can you post that somewhere? we need that for #534
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<hopppetosse>
I haven't needed it yet, but sure =)
davr0s has joined #zig
Tobba_ has joined #zig
<andrewrk>
MajorLag, let me know when your build starts taking > 1 second
<andrewrk>
I need a bigger project to test out optimizations and caching :)