ngld / knossos

NuKnossos a complete rewrite of the old Knossos mod manager. Nebula also lives here since it's easier to manage both projects in a single monorepo. If you're looking for the old code, go to https://github.com/ngld/old-knossos.
Apache License 2.0
24 stars 2 forks source link

fix(libarchive): successfully build with .so fallback #18

Closed neersighted closed 3 years ago

ngld commented 3 years ago

I don't like the .so fallback since it changes what the function does. find_static_lib should only return static libs. We could rename it to find_maybe_static_lib or something like that but I'd rather restore the static option and use it to switch between find_static_lib and -l.... -l respects the user's linker path and is more intuitive than our custom library lookup code.

neersighted commented 3 years ago

I considered that, but this also seemed a decent option as ldconfig should also respect the user's linker path... Since I'd rather not add a knob that is mostly for me to be able to build on Arch, and since people who are not me also might be baffled by the missing library that they think they installed, what do you think about just calling this function prefer_static_lib or similar?

ngld commented 3 years ago

That could work as well. ldconfig respects global settings (through /etc/ld.conf) but doesn't respect LDFLAGS="-L..." task configure .... That said, I'm not sure if we're freezing the LDFLAGS env var in our task script. We probably should.

ngld commented 3 years ago

My main concern is that if the task script doesn't fail loudly if it can't find a static library, we might end up with an unexpected dependency in a release build. I've added a new option for this in the CI refactor PR (#19) and clarified the error message. The only acceptable alternative to the option for me would require logging whether the configure script used a dynamic or static library but I'd rather not have to check the log for every release to make sure that the release linked against the static library.