From 6503b1b827a1e22e31c09f83a692a2d3053c0c07 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Mon, 2 Oct 2023 17:11:43 -0400 Subject: [PATCH] fix folly (#3496) * fix folly * wip * wip * instead of moving the build directory, let's just sanitize facebook's regexes * lols in apfs --------- Co-authored-by: Jacob Heider --- projects/facebook.com/folly/package.yml | 29 +++++++++++++++---------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/projects/facebook.com/folly/package.yml b/projects/facebook.com/folly/package.yml index a9ed39fb..b5bb5612 100644 --- a/projects/facebook.com/folly/package.yml +++ b/projects/facebook.com/folly/package.yml @@ -26,23 +26,28 @@ build: dependencies: cmake.org: ^3.0.2 freedesktop.org/pkg-config: ^0.29 - working-directory: - /tmp/xyz.tea.folly - # ^^ facebook use a shitty custom regex function to remove sources that - # shouldn’t be compiled from the library target. They start with *all sources* - # our default build directory has a `+` in it which breaks facebook’s - # piss awful code. - #TODO don’t use exotic characters in our build directories script: - - test -d xyz.tea.srcs && rm -rf xyz.tea.srcs - - mv $SRCROOT xyz.tea.srcs - - cmake $ARGS -DBUILD_SHARED_LIBS=ON -S xyz.tea.srcs -B shared + # folly uses the path to build as part of a regex, but out paths have "+"s in them. + # don't mess up the intentional newline + - run: | + sed -i.bak -E -f $PROP CMakeLists.txt + rm CMakeLists.txt.bak + prop: | + /^REMOVE_MATCHES_FROM_LISTS\(files hfiles/ { + i\\ + string(REPLACE "+" "\\\\\\\\+" ESCAPED_FOLLY_DIR "\\\${FOLLY_DIR}") + } + + s/\^\\\$\{FOLLY_DIR\}/^\\\$\{ESCAPED_FOLLY_DIR\}/g + + - cmake $ARGS -DBUILD_SHARED_LIBS=ON -S . -B shared - cmake --build shared - cmake --install shared - - cmake $ARGS -DBUILD_SHARED_LIBS=OFF -S xyz.tea.srcs -B static + - cmake $ARGS -DBUILD_SHARED_LIBS=OFF -S . -B static - cmake --build static - - run: cp /tmp/xyz.tea.folly/static/libfolly.a libfollybenchmark.a + + - run: cp $SRCROOT/static/libfolly.a libfollybenchmark.a working-directory: ${{prefix}}/static/folly - run: |