Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lboulard/b73126c91e94476b8ba31bbac8353ab6 to your computer and use it in GitHub Desktop.
Save lboulard/b73126c91e94476b8ba31bbac8353ab6 to your computer and use it in GitHub Desktop.
Patches for building watchman 4.9.0 <https://facebook.github.io/watchman/>
From 65752efbecf15f8a24ee83126115fd578d2f86e9 Mon Sep 17 00:00:00 2001
From: Wez Furlong <[email protected]>
Date: Mon, 8 Jan 2018 21:57:43 -0800
Subject: [PATCH 1/2] fix art.t test failure on alpine linux
Summary:
Looks like we end up with root_ holding a nullptr after
the associated test is finished. This only seems to be a problem
in practice on Alpine linux's musl libc based environment, and
only when built with `-O2`. Not sure if this is a c++ standard
library implementation issue or a compiler optimization, or a
combination of both of those things.
Guard against that with a simple nullptr check.
Refs https://github.com/facebook/watchman/issues/546
Reviewed By: simpkins
Differential Revision: D6681244
fbshipit-source-id: f119b3552c0aeedc325fa83c71b12745536b1dac
---
thirdparty/libart/src/art-inl.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/thirdparty/libart/src/art-inl.h b/thirdparty/libart/src/art-inl.h
index fce055be..acc7cd67 100644
--- a/thirdparty/libart/src/art-inl.h
+++ b/thirdparty/libart/src/art-inl.h
@@ -760,7 +760,7 @@ art_tree<ValueType, KeyType>::Node::maximum() const {
template <typename ValueType, typename KeyType>
typename art_tree<ValueType, KeyType>::Leaf*
art_tree<ValueType, KeyType>::minimum() const {
- return root_->minimum();
+ return root_ ? root_->minimum() : nullptr;
}
/**
@@ -769,7 +769,7 @@ art_tree<ValueType, KeyType>::minimum() const {
template <typename ValueType, typename KeyType>
typename art_tree<ValueType, KeyType>::Leaf*
art_tree<ValueType, KeyType>::maximum() const {
- return root_->maximum();
+ return root_ ? root_->maximum() : nullptr;
}
template <typename ValueType, typename KeyType>
--
2.21.0
From 827bda4d5f1c6550cefdd6701810a438b3f2f60f Mon Sep 17 00:00:00 2001
From: Laurent Boulard <[email protected]>
Date: Mon, 8 Apr 2019 14:22:19 +0200
Subject: [PATCH 2/2] build.sh script to remember build options
---
build.sh | 12 ++++++++++++
1 file changed, 12 insertions(+)
create mode 100755 build.sh
diff --git a/build.sh b/build.sh
new file mode 100755
index 00000000..04ce9f10
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+set -eux
+./autogen.sh
+./configure --enable-lenient \
+ --localstatedir=/var \
+ --runstatedir=/run/watchman \
+ --sysconfdir=/etc \
+ --enable-statedir=/run/watchman
+make -j 4
+make check
+echo \# sudo make install
--
2.21.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment