Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] AutotoolsToolchain cannot change install prefix #12338

Closed
madebr opened this issue Oct 19, 2022 · 3 comments · Fixed by #12620
Closed

[bug] AutotoolsToolchain cannot change install prefix #12338

madebr opened this issue Oct 19, 2022 · 3 comments · Fixed by #12620
Assignees
Milestone

Comments

@madebr
Copy link
Contributor

madebr commented Oct 19, 2022

#11264 switches from using --prefix={self._conanfile.package_folder} to --prefix=/ + make install DESTDIR={self._conanfile.package_folder}.

When doing the following to change the prefix, it still installs to /.

    def generate(self):
        autotools = AutotoolsToolchain(self)
        autotools.configure_args.extend([
            "--prefix={}".format(unix_path(self, self.package_folder)),
        ])

    def build(self):
        autotools = Autotools(self)
        autotools.configure()
        autotools.make()

    def package(self):
        autotools = Autotools(self)
        autotools.install(args=[])
        

Environment Details (include every applicable attribute)

  • Operating System+version: Windows 10
  • Compiler+version: Visual Studio 2019
  • Conan version: 1.53.0
  • Python version: 3.10.7

Steps to reproduce (Include if Applicable)

Logs (Executed commands with output) (Include/Attach if Applicable)

Applying conan v2 AutotoolsToolchain to conan-io/conan-center-index#13564 and building mingw on Windows:

configure command: notice how --prefix is passed twice

> "C:\Users\maarten\.conan\data\libmicrohttpd\0.9.75\_\_\build\3072adedaf59693260b5c468de68fd932dcaf9f0\msys2_mode.bat" && C:\.conan\36de63\1\bin\msys64\usr\bin\bash.exe -c ^". \^"C:\Users\maarten\.conan\data\libmicrohttpd\0.9.75\_\_\build\3072adedaf59693260b5c468de68fd932dcaf9f0\conanbuild.sh\^" ^&^& \^"/c/users/maarten/.conan/data/libmicrohttpd/0.9.75/_/_/build/3072adedaf59693260b5c468de68fd932dcaf9f0/configure\^" --enable-shared --disable-static --prefix=/ --bindir=${prefix}/bin --sbindir=${prefix}/bin --libdir=${prefix}/lib --includedir=${prefix}/include --oldincludedir=${prefix}/include --enable-shared=yes --enable-static=no --enable-https=no --enable-messages=yes --enable-postprocessor=yes --enable-dauth=yes --enable-epoll=no --disable-doc --disable-examples --disable-curl --prefix=/c/users/maarten/.conan/data/libmicrohttpd/0.9.75/_/_/package/3072adedaf59693260b5c468de68fd932dcaf9f0 ^"

install log excerpt:

...

 /usr/bin/install -c -m 644 microhttpd.h '/include'

...

 /bin/sh ../../libtool   --mode=install /usr/bin/install -c   libmicrohttpd.la '/lib'

Notice how the files are installed to /include and /lib instead of the conan prefix.

@czoido
Copy link
Contributor

czoido commented Oct 19, 2022

Hi @madebr,

Thanks for reporting. I wanted to ask if the underlying issue is related to this? #12193 if this is solved it would be not necessary to redefine the --prefix right?
There would be workarounds like removing "--prefix=/" prefix from the list of configure_args and then adding that --prefix, but anyway I'm marking this for the next release to be considered as I think it's something that should be solved inside the AutotoolsToolchain.

@madebr
Copy link
Contributor Author

madebr commented Oct 19, 2022

Yes, #12193 is the other issue I encountered while packaging libmicrohttpd.

Having the possibility to change the prefix is still useful, imho.
I have encountered proejcts where I had to install to a temporary folder and extract "the good parts" to a prefix.
When building toolchains, you even have to perform autotools.install() multiple times (hence Autotools has a namespace).

I think it would be useful to add a package_folder (or something similar) to AutotoolsToolchain.

@memsharded
Copy link
Member

Closed in #12620, will be in 1.55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants