Skip to content

Instantly share code, notes, and snippets.

@fragmuffin
Last active December 11, 2018 15:02
Show Gist options
  • Save fragmuffin/93988ea92893dd5d1dda365ddeea1385 to your computer and use it in GitHub Desktop.
Save fragmuffin/93988ea92893dd5d1dda365ddeea1385 to your computer and use it in GitHub Desktop.
Reproduce facebook/watchman bug

gist created for issue: watchman/issues#660

Build Docker Image

$ ./build.sh

Result

$ ./run.sh
Traceback (most recent call last):
  File "/usr/local/bin/watchman-wait", line 185, in <module>
    for _, sub in subscriptions.iteritems():
AttributeError: 'dict' object has no attribute 'iteritems'
#!/usr/bin/env bash
source ./common-vars.sh
docker build \
--tag watchman-test \
--build-arg ftp_proxy=${ftp_proxy} \
--build-arg http_proxy=${http_proxy} \
--build-arg https_proxy=${https_proxy} \
--build-arg env_rel_path=${ENV_REL_PATH} \
--file Dockerfile \
.
FROM ubuntu:16.04
# build-time arguments
ARG tester_name=tester
ADD . /code
WORKDIR /code
USER root
RUN bash /code/setup.sh
# test user
RUN useradd -c 'test user' -m -d /home/${tester_name} -s /bin/bash ${tester_name}
USER ${tester_name}
ENV HOME /home/${tester_name}
# default run command
CMD bash watch.sh
#!/usr/bin/env bash
docker image rm watchman-test
#!/usr/bin/env bash
case "$1" in
"")
docker run --rm --volume ${PWD}:/code watchman-test
;;
*)
docker run --rm --volume ${PWD}:/code -it watchman-test "${@:1}"
;;
esac
#!/usr/bin/env bash
apt-get update
# watchman
# variation of: https://facebook.github.io/watchman/docs/install.html#installing-from-source
apt-get install libssl-dev autoconf automake libtool pkg-config wget \
python3.5 python3.5-dev python3-pip -y
ln -s /usr/bin/python3.5 /usr/bin/python3
watchman_ver=4.9.0
pushd /tmp
wget -nv https://github.com/facebook/watchman/archive/v${watchman_ver}.tar.gz \
-O watchman-${watchman_ver}.tar.gz
tar -xzf watchman-${watchman_ver}.tar.gz
cd watchman-${watchman_ver}
./autogen.sh
./configure
make
make install
popd
# pip upgrade
python3 -m pip install --upgrade pip
#!/usr/bin/env bash
watchman-wait . -p '*.txt'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment