[PATCH] Fix test-release.sh to use DESTDIR

Hans Wennborg hans at chromium.org
Wed Jul 1 07:37:29 PDT 2015


Hi Dan,

Sorry for the slow reply. I'm on vacation and just checking in on work
mail occasionally.

On Fri, Jun 26, 2015 at 6:22 PM, Dan Liew <dan at su-root.co.uk> wrote:
> This patch tries to fix the test-release.sh script which looks like
> it's used for creating the final release binaries.

Yes, that's the script for creating the release binaries.

> The problem is that --prefix was set to a temporary build directory
> which then shows up in the final binaries and build files. In
> particular the installed LLVMConfig.cmake and LLVMExports.cmake files
> contain these paths making them completely broken.
>
> You can observe this if you take a look at the contents of the binary
> tarballs (Ubuntu tarballs) on LLVM's release page for LLVM 3.5.
>
> For the LLVM 3.6.x tarballs the CMake files are completely missing
> (Ubuntu tarballs). I don't understand why, the test-release.sh script
> doesn't appear to do anything to remove these files explicitly. What
> happened here?

I'm not sure what changed between the 3.5 and 3.6 releases in this
regard. I don't think the script itself has changed, but maybe the
build system was changed to not generate the .cmake files in autoconf
builds, as they would probably be broken.

> The way this is normally handled is that --prefix is set to where it
> is intended for the files to be installed and DESTDIR is set when
> running ``make install`` to have files be installed elsewhere in
> preparation for tarballing.
>
> This patch sets ``--prefix`` to ``/usr/local`` by default (although is
> can be changed using a command line option to the script) and uses
> DESTDIR to install the files elsewhere.
>
> ``/usr/local`` seems like a sensible default to me that should avoid
> where Linux package managers typically install their packages and I
> think this is also used on OSX too.

The problem is that the package is built by doing "make install" on
the Phase 3 build, and then creating a tarball from that directory. So
when running the script, the install dir really needs to be a
temporary directory.

I think the fix we need would be to make the --prefix used when
building not affect the binaries or the .cmake files. I'm hoping to
switch to using cmake for the 3.7 release (see
http://reviews.llvm.org/D10715). Do you think the CMAKE_INSTALL_PREFIX
flag will create the same problem?

Thanks,
Hans



More information about the llvm-commits mailing list