Open ltjax opened 1 year ago
Thanks for your report @ltjax
The current implementation is relatively simple:
def install(self, args=None, target="install"):
args = args if args else []
str_args = " ".join(args)
if "DESTDIR=" not in str_args:
args.insert(0, "DESTDIR={}".format(unix_path(self._conanfile, self._conanfile.package_folder)))
self.make(target=target, args=args)
Would it be a documentation bug? or is there some gap in the behavior/code too?
To be honest, this default really botched one of my conan 1 -> conan 2 ports, because the underlying project apparently didn't like DESTDIR
be set (the final package folder was something like join(build_folder, package_folder)
). It took me a long time to figure out that was the cause for the screwed-up package paths.
First the documentation says it's just an "alias" of ``self.make(target="install")
(It's not, it sets DESTDIR
), then I read on and saw the comment on DESTDIR
, where the it just doesn't do what it says.
Ideally, the method would be renamed to install_with_default_destdir()
, or something along those lines, making it really obvious what it does. Alternatively, I think the behavior in the docs is better, and it should just set DESTDIR
when args
is None
.
So:
args = args if args is not None else ["DESTDIR={}".format(unix_path(self._conanfile, self._conanfile.package_folder))]
Right now, I have to pass args=["DESTDIR="]
to work around this.
Environment details
Steps to reproduce
The documentation for conan.tools.gnu.Autotools.install states: "By default an argument
DESTDIR=unix_path(self.package_folder)
is added to the call if the passed value isNone
." Yet DESTDIR is always added unless DESTDIR= appears in the joined args.Logs
No response