facebook-clang-plugins icon indicating copy to clipboard operation
facebook-clang-plugins copied to clipboard

Should `facebook-clang-plugins` allow for CMake `CMAKE_BUILD_TYPE` to be configurable?

Open aytey opened this issue 4 years ago • 4 comments

At a very quick glance, there are quite a few issues that are related to not being able to build Infer due to running out of space:

  • https://github.com/facebook/infer/issues/1259

  • https://github.com/facebook/infer/issues/1082

  • https://github.com/facebook/infer/issues/944

Despite having 70 GiB free on one my VMs, I can't install facebook-clang-plugins (i.e., the build succeeds, but copying the artefacts in to the destination folder fails).

I "fixed" this by using MinSizeRel over Release for CMAKE_BUILD_TYPE.

Is this something that's reasonable to allow to be configurable? Should ./clang/setup.sh take a parameter (e.g., --cmake-build-type <string>) that allows you to select a particular build type?

Happy to do this work, but I only want to "polish" it if it is something that (as an idea) is acceptable to merge.

aytey avatar Jun 16 '20 09:06 aytey

From what I can find on the web, MinSizeRel is the same as Release but passing -Os instead of -O3. I don't think that is desirable or that it will help hugely with the space issue. What we would need is a way to strip binaries and libraries as we go. I remember that at some point we were able to do that by passing some option to the compiler directly but that only worked on Linux (see eg a340f3d315529aab9ad43b3bab03710553f401b1).

jvillard avatar Jun 17 '20 11:06 jvillard

All I can say is that, for me, when I only had 70 GiB free (🤣), changing from Release to MinSizeRel was the difference between able to install and not being able to install!

aytey avatar Jun 17 '20 12:06 aytey

Do you know what MinSizeRel does?

jvillard avatar Jun 17 '20 12:06 jvillard

Yeah, does -Os as you suggested, so I would guess the resulting .os/.as/.sos are already smaller before doing the install.

aytey avatar Jun 17 '20 13:06 aytey