diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2024-02-19 10:54:49 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2024-02-19 10:54:49 -0300 |
commit | 97fcaef0f769f4d59ff063e477ecffdc7e3c6103 (patch) | |
tree | bd66adf338d972112c99fc26946a0a39553de0e4 /src/bin | |
parent | 272921b2adf6136448dda9011425f8304c9d508d (diff) | |
download | luarocks-fix-1041.tar.gz luarocks-fix-1041.tar.bz2 luarocks-fix-1041.zip |
when picking a default dependency dir, look for lib/ firstfix-1041
When a rockspec specifies `external_dependencies` but those don't define
a `library` entry, we don't have a way to check for the various
possible `external_deps_subdirs` to find the one that contains the library.
(But people really should specify a `library` entry there if they're
linking the library!)
Previously, we were just picking the first one from the list.
On Windows, this meant that sometimes setting `MY_DEPENDENCY_DIR` would
not be sufficient if the library was under `$MY_DEPENDENCY_DIR/lib`,
because "" was picked first. We now improve the heuristic by putting "lib"
first on the list and checking if it exists.
I'm still keeping "bin" in the end of the list, because I think this
is less common that a flat directory structure on Windows, so "lib"
covers the Unix-like trees and "" covers flat trees (I don't remember
why have "bin" as a library subdir on Windows, but if it's there then
we must have seen it in the wild!) This means that "bin" will never
get auto-picked by this heuristic, but it will be available for the
cases where `library` _is_ set.
While I'm at it, I also flipped the order of some Unix entries, so that
this heuristic for these kind of rockspecs gets a nicer behavior on
Unix systems that have things like `/usr/lib64` and `/usr/lib/<platform>`
as well.
Fixes #1041.
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions