hhvm
hhvm copied to clipboard
Use fmt_8 from nixpkgs instead of building it from source
Currently we build fmt from source unconditionally, and our CMake file to build fmt is not compatible with nix's clang environment. An error about cannot find -lc++: No such file or directory would be reported when trying to build the bundled fmt with clang in #9129. See https://github.com/facebook/hhvm/actions/runs/3095588732/jobs/5017341496 for the build log.
This diff modifies third-party/CMakeLists.txt, using find_package to detect fmt from the build environment, or building the bundled fmt from source if no fmt from the build environment is found.
This PR also specifies fmt_8 nix package, given that fmt in nixpkgs unstable is version 7 while we previously build HHVM with a bundled version 8 of fmt.
Test Plan:
Rebase #9129 onto this diff, and there will be no error about cannot find -lc++: No such file or directory
@Atry has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
@Atry has updated the pull request. You must reimport the pull request before landing.
@Atry has updated the pull request. You must reimport the pull request before landing.
@Atry has updated the pull request. You must reimport the pull request before landing.
@Atry has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
@Atry has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
@Atry has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
@Atry has updated the pull request. You must reimport the pull request before landing.
@Atry has updated the pull request. You must reimport the pull request before landing.
@Atry has updated the pull request. You must reimport the pull request before landing.
@Atry has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.