From 181d778a88e90824d01e460ac4d0246071c0f154 Mon Sep 17 00:00:00 2001 From: Adam Goforth Date: Fri, 17 May 2019 17:15:28 -0400 Subject: [PATCH] Linux: Pin NodeJS to 8.x, fix watchman install Summary: - On newer versions of Ubuntu, NodeJS 10.x is in the official packages, so apt will upgrade the PPA-installed 8.x version to 10.x the next time upgrades are run. This change adds an apt preferences file that pins the `nodejs` package at version 8.x. - The watchman installation was previously broken on new installs, because the `ka-clone` executable doesn't get installed until after the Linux-specific installation is done. This commit changes the previous call to `kaclone_repo` to bare git commands, so it will work at all times. - The watchman build previously didn't work on some Ubuntu machines, because there were two missing dependencies. This commit adds them to the `apt-get install` command run before building. - Newer versions of GCC turn certain warnings into fatal errors, and watchman hasn't yet been updated to avoid those errors. As a workaround, we pass `--enable-lenient` to the configure command, so those warnings won't break the compile. Test Plan: - The scripts were executed on fresh Ubuntu 18.04 and 19.04 installations, as well as my previously-configured Ubuntu 19.04 machine. - MacOS was not tested, because the changes are local to `linux-setup.sh`. Reviewers: benkraft, colin, kevinb Reviewed By: benkraft Subscribers: csilvers Differential Revision: https://phabricator.khanacademy.org/D54498 --- linux-setup.sh | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/linux-setup.sh b/linux-setup.sh index 56b3e51..2b7b198 100755 --- a/linux-setup.sh +++ b/linux-setup.sh @@ -65,6 +65,14 @@ deb https://deb.nodesource.com/node_8.x `lsb_release -c -s` main deb-src https://deb.nodesource.com/node_8.x `lsb_release -c -s` main EOF sudo chmod a+rX /etc/apt/sources.list.d/nodesource.list + + # Pin nodejs to 8.x, otherwise apt will update it to 10.x on newer + # Ubuntu versions + cat <