Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix installing from a readonly copy of synapse #866

Merged
merged 2 commits into from
May 14, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 25 additions & 7 deletions scripts/synapse_sytest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# Run the sytests.

set -ex
set -e

cd "$(dirname $0)/.."

Expand All @@ -26,10 +26,10 @@ if [ -n "$MULTI_POSTGRES" ] || [ -n "$POSTGRES" ]; then
# Start the database
su -c 'eatmydata /usr/lib/postgresql/*/bin/pg_ctl -w -D $PGDATA start' postgres

su -c psql postgres <<< "show config_file"
su -c psql postgres <<< "show max_connections"
su -c psql postgres <<< "show full_page_writes"
su -c psql postgres <<< "show fsync"
#su -c psql postgres <<< "show config_file"
#su -c psql postgres <<< "show max_connections"
#su -c psql postgres <<< "show full_page_writes"
#su -c psql postgres <<< "show fsync"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove these if they're not useful?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in 0165ef9

fi

# Now create the databases
Expand Down Expand Up @@ -110,6 +110,24 @@ elif [ -n "$POSTGRES" ]; then

fi

# default value for SYNAPSE_SOURCE
: ${SYNAPSE_SOURCE:=/src}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat, did not know this about bash. (https://wiki.bash-hackers.org/syntax/pe#assign_a_default_value if anyone else doesn't know what this does)


# if we're running against a source directory, turn it into a tarball. pip
# will then unpack it to a temporary location, and build it. (As of pip 20.1,
# it will otherwise try to build it in-tree, which means writing changes to the
# source volume outside the container.
richvdh marked this conversation as resolved.
Show resolved Hide resolved
#
if [ -d "$SYNAPSE_SOURCE" ]; then
echo "Creating tarball from synapse source"
tar -C "$SYNAPSE_SOURCE" -czf /tmp/synapse.tar.gz \
synapse scripts setup.py README.rst synctl MANIFEST.in
SYNAPSE_SOURCE="/tmp/synapse.tar.gz"
elif [ ! -r "$SYNAPSE_SOURCE" ]; then
echo "Unable to read synapse source at $SYNAPSE_SOURCE" >&2
exit 1
fi

if [ -n "$OFFLINE" ]; then
# if we're in offline mode, just put synapse into the virtualenv, and
# hope that the deps are up-to-date.
Expand All @@ -118,11 +136,11 @@ if [ -n "$OFFLINE" ]; then
# (https://github.com/pypa/pip/issues/5402 possibly) where pip wants
# to reinstall any requirements for the build system, even if they are
# already installed.
/venv/bin/pip install --no-index --no-use-pep517 /src
/venv/bin/pip install --no-index --no-use-pep517 "$SYNAPSE_SOURCE"
else
# We've already created the virtualenv, but lets double check we have all
# deps.
/venv/bin/pip install -q --upgrade --no-cache-dir /src[redis]
/venv/bin/pip install -q --upgrade --no-cache-dir "$SYNAPSE_SOURCE"[redis]
/venv/bin/pip install -q --upgrade --no-cache-dir \
lxml psycopg2 coverage codecov tap.py coverage_enable_subprocess

Expand Down