Page MenuHome

CMake/Deps: fix build of nasm when asciidoc and xmlto are unavailable
ClosedPublic

Authored by Sybren A. Stüvel (sybren) on Feb 11 2021, 12:12 PM.

Details

Summary

Installing nasm requires that its manual pages are built. This requires local packages asciidoc and xmlto to be installed.

Not only does asciidoc pull in 110 MB of packages (itself + dependencies), there is also no need for these manual pages. nasm is just used for building other dependencies, and not even part of our precompiled libraries in SVN.

This patch effectively creates zero-byte manual page files nasm.1 and ndisasm.1 such that the make install step succeeds. Personally I prefer this approach over installing more packages on the CentOS VM.

I've added @Sebastián Barschkis (sebbas) as reviewer because this also impacts macOS, and @Ray Molenkamp (LazyDodo) because we talked about this approach and I want to keep him in the loop.

Diff Detail

Repository
rB Blender

Event Timeline

Sybren A. Stüvel (sybren) requested review of this revision.Feb 11 2021, 12:12 PM
build_files/build_environment/cmake/nasm.cmake
31

nasm.cmake is already in a UNIX guard at the top level CMakeLists.txt so you can remove it here if you want.

nasm is a build time requirement we do not ship in the libs, so i treat it no different than for instance cmake or the compiler, (ie you're on your own to obtain it) that's why there's no windows support for building it.

It seems the question is why do we build nasm in the first place if it's not needed in the libs we ship?
For Linux and macOS, I found these commits: rB1e3c0b4b03e1 and rB157cd6c6e89c. Those changes were made as the nasm version at that time (2.15.02) needed to be patched.

I tested with the latest nasm (2.15.05) and at least the patch for macOS isn't needed anymore. So we could go back to using a precompiled nasm and get rid of the build setup.
For Linux, I am not sure - this would have to be investigated.

So for macOS I think it would be better to get rid of the nasm build.

The latest nasm available on CentOS 7 is 2.10 (source).

I'd be happy to revisit the choice to build nasm ourselves, after all the library upgrades for 2.93 are behind us. For now, this patch is the shortest route for me to actually build all the libs from scratch on my CentOS VM.

Sounds good. This can go in and I will remove the nasm build for macOS afterwards.

This revision is now accepted and ready to land.Feb 12 2021, 1:43 PM