mozilla-services / syncserver

Run-Your-Own Firefox Sync Server
Mozilla Public License 2.0
1.87k stars 145 forks source link

Missing dependency in README #235

Closed murchu27 closed 4 years ago

murchu27 commented 4 years ago

Just tried to make build the latest commit, and got the following error.

ERROR: Command errored out with exit status 1:
     command: /home/me/syncserver/local/bin/python2 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-psv_sW/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-psv_sW/mysqlclient/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-6sF7Ve
         cwd: /tmp/pip-install-psv_sW/mysqlclient/
    Complete output (12 lines):
    sh: 1: mysql_config: not found
    sh: 1: mariadb_config: not found
    sh: 1: mysql_config: not found
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-psv_sW/mysqlclient/setup.py", line 16, in <module>
        metadata, options = get_config()
      File "setup_posix.py", line 61, in get_config
        libs = mysql_config("libs")
      File "setup_posix.py", line 29, in mysql_config
        raise EnvironmentError("%s not found" % (_mysql_config_path,))
    EnvironmentError: mysql_config not found
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

After some digging, I found that installing the default-libmysqlclient-dev package seemed to fix the issue. Should this be added to README.md?

I'm running on Raspbian 10, in case that makes a difference.

(Let me know if I've submitted this in the wrong place.)

jrconlin commented 4 years ago

I've added the various libraries we're installing from the Dockerfile. FWIW, I've found that's a good resource whenever I hit problems installing locally, but you're right that we should make sure the README is up-to-date as well.

MichaIng commented 4 years ago

I guess there is no chance to avoid the need for MySQL/MariaDB related dependencies right? I can't remember this being the case ~a month ago.

Just found it coming from the tokenserver dependency update a few days ago:

Since on Raspbian/Debian, this installs half of MariaDB server, probably a reason to migrate even smaller instances from SQLite to MySQL/MariaDB backend 😄.

rfk commented 4 years ago

Aye, sadly I think this is required because of how we pull in the dependencies of tokenserver, which as of the switch from python2.7 to pypy, is using a different MySQL module that requires the native support libs.

I'd be happy to review a patch that disables this requirement if anyone has to time to poke at it, but I don't think I'll have the bandwidth to investigate it myself. It would probably look like making the mysql dependency in tokenserver into an optional dependency.

MichaIng commented 4 years ago

Great to hear that you are basically open for it. But yes I think the motivation and reason to invest time is quite low, especially since medium-to-large instances likely use MySQL as backend anyway, or one is present for a different purpose which then would be a shame to not use in favour of SQLite.

ryanburnette commented 3 years ago

Required step for installing on Ubuntu 18.04. Thanks

apt install default-libmysqlclient-dev -y
MichaIng commented 3 years ago

Or the actual non-meta package it pulls: libmysqlclient-dev or, when using MariaDB: libmariadb-dev I think "mysql-dev" + "(or similar, depending on your operating system)" from the readme covers the multiple options and names this can have 🙂.