gyro icon indicating copy to clipboard operation
gyro copied to clipboard

[Error] If package has system libraries as deps Segfault will appear

Open WiktorJanecki opened this issue 3 years ago • 2 comments

I have this package tree:

LinkSystemLibrary("c").........] --- a--b--final LinkSystemLibrary("glfw")....]

As you can see first library depends on system libs, and the second one on the first one. Final package will be created by users which want to use my "b" package. But the problem is final package cannot be run unless user manually link system libraries in final/build.zig What's worse, there is no error when building final package. Only SegFault when it is runned. Will there be any feature that's automatically adds system libraries to deps.zig or something similar?

WiktorJanecki avatar May 02 '21 20:05 WiktorJanecki

It was intended that this area was left "unfinished", the reason here was to experiment with builder packages that let you choose between using system libraries or building C libraries locally and statically compiling, Eg. https://github.com/mattnite/ZLibBuilder

For your case, it is required for a root project to know what system libraries it needs to link to.

mattnite avatar May 06 '21 14:05 mattnite

Got it. but I think there definitely should be some kind of warning that package has syslibs as dependencies instead of segfault. Maybe gyro build should check and warn about that.

WiktorJanecki avatar May 10 '21 15:05 WiktorJanecki