{"action":"created","issue":{"url":"https://api.github.com/repos/systemd/systemd/issues/35","labels_url":"https://api.github.com/repos/systemd/systemd/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/systemd/systemd/issues/35/comments","events_url":"https://api.github.com/repos/systemd/systemd/issues/35/events","html_url":"https://github.com/systemd/systemd/pull/35","id":72704940,"number":35,"title":"Use python-systemd with virtualenv or pyvenv","user":{"login":"GMLudo","id":243823,"avatar_url":"https://avatars.githubusercontent.com/u/243823?v=3","gravatar_id":"","url":"https://api.github.com/users/GMLudo","html_url":"https://github.com/GMLudo","followers_url":"https://api.github.com/users/GMLudo/followers","following_url":"https://api.github.com/users/GMLudo/following{/other_user}","gists_url":"https://api.github.com/users/GMLudo/gists{/gist_id}","starred_url":"https://api.github.com/users/GMLudo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GMLudo/subscriptions","organizations_url":"https://api.github.com/users/GMLudo/orgs","repos_url":"https://api.github.com/users/GMLudo/repos","events_url":"https://api.github.com/users/GMLudo/events{/privacy}","received_events_url":"https://api.github.com/users/GMLudo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-02T21:57:06Z","updated_at":"2015-05-03T05:26:52Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/systemd/systemd/pulls/35","html_url":"https://github.com/systemd/systemd/pull/35","diff_url":"https://github.com/systemd/systemd/pull/35.diff","patch_url":"https://github.com/systemd/systemd/pull/35.patch"},"body":"Hi,\r\n\r\nFor now, python-systemd works like a charm at system level, at least via the `python3-systemd` package from Debian Jessie.\r\n\r\nUnfortunately, to deploy our daemons, we use [pyvenv](https://docs.python.org/3/library/venv.html) to avoid to pollute Python system.\r\n\r\nUsually, in the Python world, you have a `setup.py` to install easily via `pip`, and you can use to install a library in pyvenv.\r\nThis pull request is an attempt to add a `setup.py`, based on an old version of [python-systemd](https://github.com/systemd/python-systemd/blob/master/setup.py).\r\n\r\nBut, it doesn't work, I've theses errors, if you have a clue, I'm interested in:\r\n\r\n    (pyvenv) root@XXXXXXX:~/tests/systemd/src/python# pip install -e .\r\n    Obtaining file:///root/tests/systemd/src/python\r\n    Running setup.py (path:/root/tests/systemd/src/python/setup.py) egg_info for package from file:///root/tests/systemd/src/python\r\n        \r\n    Installing collected packages: systemd\r\n    Running setup.py develop for systemd\r\n        \r\n        building 'systemd/_daemon' extension\r\n        x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -DPACKAGE_VERSION=219 -I../../src/shared -I../../src/systemd -I/root/tests/systemd/src/python/pyvenv/include -I/usr/include/python3.4m -c systemd/_daemon.c -o build/temp.linux-x86_64-3.4/systemd/_daemon.o\r\n        systemd/_daemon.c: In function ‘PyInit__daemon’:\r\n        <command-line>:0:17: warning: passing argument 3 of ‘PyModule_AddStringConstant’ makes pointer from integer without a cast\r\n        systemd/_daemon.c:322:58: note: in expansion of macro ‘PACKAGE_VERSION’\r\n                    PyModule_AddStringConstant(m, \"__version__\", PACKAGE_VERSION)) {\r\n                                                                ^\r\n        In file included from /usr/include/python3.4m/Python.h:113:0,\r\n                        from systemd/_daemon.c:25:\r\n        /usr/include/python3.4m/modsupport.h:49:17: note: expected ‘const char *’ but argument is of type ‘int’\r\n        PyAPI_FUNC(int) PyModule_AddStringConstant(PyObject *, const char *, const char *);\r\n                        ^\r\n        x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -DPACKAGE_VERSION=219 -I../../src/shared -I../../src/systemd -I/root/tests/systemd/src/python/pyvenv/include -I/usr/include/python3.4m -c systemd/_journal.c -o build/temp.linux-x86_64-3.4/systemd/_journal.o\r\n        In file included from ../../src/shared/util.h:47:0,\r\n                        from systemd/_journal.c:25:\r\n        ../../src/shared/missing.h:524:8: error: redefinition of ‘struct file_handle’\r\n        struct file_handle {\r\n                ^\r\n        In file included from /usr/include/x86_64-linux-gnu/bits/fcntl.h:61:0,\r\n                        from /usr/include/fcntl.h:35,\r\n                        from ../../src/shared/util.h:25,\r\n                        from systemd/_journal.c:25:\r\n        /usr/include/x86_64-linux-gnu/bits/fcntl-linux.h:311:8: note: originally defined here\r\n        struct file_handle\r\n                ^\r\n        In file included from ../../src/shared/util.h:47:0,\r\n                        from systemd/_journal.c:25:\r\n        ../../src/shared/missing.h:530:19: error: conflicting types for ‘name_to_handle_at’\r\n        static inline int name_to_handle_at(int fd, const char *name, struct file_handle *handle, int *mnt_id, int flags) {\r\n                        ^\r\n        In file included from /usr/include/x86_64-linux-gnu/bits/fcntl.h:61:0,\r\n                        from /usr/include/fcntl.h:35,\r\n                        from ../../src/shared/util.h:25,\r\n                        from systemd/_journal.c:25:\r\n        /usr/include/x86_64-linux-gnu/bits/fcntl-linux.h:402:12: note: previous declaration of ‘name_to_handle_at’ was here\r\n        extern int name_to_handle_at (int __dfd, const char *__name,\r\n                    ^\r\n        In file included from ../../src/shared/util.h:47:0,\r\n                        from systemd/_journal.c:25:\r\n        ../../src/shared/missing.h:539:6: error: #error \"neither secure_getenv nor __secure_getenv are available\"\r\n        #    error \"neither secure_getenv nor __secure_getenv are available\"\r\n            ^\r\n        ../../src/shared/missing.h:594:19: error: static declaration of ‘setns’ follows non-static declaration\r\n        static inline int setns(int fd, int nstype) {\r\n                        ^\r\n        In file included from /usr/include/sched.h:41:0,\r\n                        from ../../src/shared/util.h:33,\r\n                        from systemd/_journal.c:25:\r\n        /usr/include/x86_64-linux-gnu/bits/sched.h:91:12: note: previous declaration of ‘setns’ was here\r\n        extern int setns (int __fd, int __nstype) __THROW;\r\n                    ^\r\n        In file included from ../../src/shared/util.h:49:0,\r\n                        from systemd/_journal.c:25:\r\n        ../../src/shared/formats-util.h:38:4: error: #error Unknown uid_t size\r\n        #  error Unknown uid_t size\r\n            ^\r\n        ../../src/shared/formats-util.h:46:4: error: #error Unknown gid_t size\r\n        #  error Unknown gid_t size\r\n            ^\r\n        ../../src/shared/formats-util.h:62:4: error: #error Unknown rlim_t size\r\n        #  error Unknown rlim_t size\r\n            ^\r\n        systemd/_journal.c: In function ‘PyInit__journal’:\r\n        <command-line>:0:17: warning: passing argument 3 of ‘PyModule_AddStringConstant’ makes pointer from integer without a cast\r\n        systemd/_journal.c:148:58: note: in expansion of macro ‘PACKAGE_VERSION’\r\n                if (PyModule_AddStringConstant(m, \"__version__\", PACKAGE_VERSION)) {\r\n                                                                ^\r\n        In file included from /usr/include/python3.4m/Python.h:113:0,\r\n                        from systemd/_journal.c:22:\r\n        /usr/include/python3.4m/modsupport.h:49:17: note: expected ‘const char *’ but argument is of type ‘int’\r\n        PyAPI_FUNC(int) PyModule_AddStringConstant(PyObject *, const char *, const char *);\r\n                        ^\r\n        error: command 'x86_64-linux-gnu-gcc' failed with exit status 1\r\n        Complete output from command /root/tests/systemd/src/python/pyvenv/bin/python3.4 -c \"import setuptools, tokenize; __file__='/root/tests/systemd/src/python/setup.py'; exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec'))\" develop --no-deps:\r\n        running develop\r\n\r\n    running egg_info\r\n\r\n    writing top-level names to systemd.egg-info/top_level.txt\r\n\r\n    writing systemd.egg-info/PKG-INFO\r\n\r\n    writing dependency_links to systemd.egg-info/dependency_links.txt\r\n\r\n    warning: manifest_maker: standard file '-c' not found\r\n\r\n\r\n\r\n    reading manifest file 'systemd.egg-info/SOURCES.txt'\r\n\r\n    writing manifest file 'systemd.egg-info/SOURCES.txt'\r\n\r\n    running build_ext\r\n\r\n    building 'systemd/_daemon' extension\r\n\r\n    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -DPACKAGE_VERSION=219 -I../../src/shared -I../../src/systemd -I/root/tests/systemd/src/python/pyvenv/include -I/usr/include/python3.4m -c systemd/_daemon.c -o build/temp.linux-x86_64-3.4/systemd/_daemon.o\r\n\r\n    systemd/_daemon.c: In function ‘PyInit__daemon’:\r\n\r\n    <command-line>:0:17: warning: passing argument 3 of ‘PyModule_AddStringConstant’ makes pointer from integer without a cast\r\n\r\n    systemd/_daemon.c:322:58: note: in expansion of macro ‘PACKAGE_VERSION’\r\n\r\n                PyModule_AddStringConstant(m, \"__version__\", PACKAGE_VERSION)) {\r\n\r\n                                                            ^\r\n\r\n    In file included from /usr/include/python3.4m/Python.h:113:0,\r\n\r\n                    from systemd/_daemon.c:25:\r\n\r\n    /usr/include/python3.4m/modsupport.h:49:17: note: expected ‘const char *’ but argument is of type ‘int’\r\n\r\n    PyAPI_FUNC(int) PyModule_AddStringConstant(PyObject *, const char *, const char *);\r\n\r\n                    ^\r\n\r\n    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -DPACKAGE_VERSION=219 -I../../src/shared -I../../src/systemd -I/root/tests/systemd/src/python/pyvenv/include -I/usr/include/python3.4m -c systemd/_journal.c -o build/temp.linux-x86_64-3.4/systemd/_journal.o\r\n\r\n    In file included from ../../src/shared/util.h:47:0,\r\n\r\n                    from systemd/_journal.c:25:\r\n\r\n    ../../src/shared/missing.h:524:8: error: redefinition of ‘struct file_handle’\r\n\r\n    struct file_handle {\r\n\r\n            ^\r\n\r\n    In file included from /usr/include/x86_64-linux-gnu/bits/fcntl.h:61:0,\r\n\r\n                    from /usr/include/fcntl.h:35,\r\n\r\n                    from ../../src/shared/util.h:25,\r\n\r\n                    from systemd/_journal.c:25:\r\n\r\n    /usr/include/x86_64-linux-gnu/bits/fcntl-linux.h:311:8: note: originally defined here\r\n\r\n    struct file_handle\r\n\r\n            ^\r\n\r\n    In file included from ../../src/shared/util.h:47:0,\r\n\r\n                    from systemd/_journal.c:25:\r\n\r\n    ../../src/shared/missing.h:530:19: error: conflicting types for ‘name_to_handle_at’\r\n\r\n    static inline int name_to_handle_at(int fd, const char *name, struct file_handle *handle, int *mnt_id, int flags) {\r\n\r\n                    ^\r\n\r\n    In file included from /usr/include/x86_64-linux-gnu/bits/fcntl.h:61:0,\r\n\r\n                    from /usr/include/fcntl.h:35,\r\n\r\n                    from ../../src/shared/util.h:25,\r\n\r\n                    from systemd/_journal.c:25:\r\n\r\n    /usr/include/x86_64-linux-gnu/bits/fcntl-linux.h:402:12: note: previous declaration of ‘name_to_handle_at’ was here\r\n\r\n    extern int name_to_handle_at (int __dfd, const char *__name,\r\n\r\n                ^\r\n\r\n    In file included from ../../src/shared/util.h:47:0,\r\n\r\n                    from systemd/_journal.c:25:\r\n\r\n    ../../src/shared/missing.h:539:6: error: #error \"neither secure_getenv nor __secure_getenv are available\"\r\n\r\n    #    error \"neither secure_getenv nor __secure_getenv are available\"\r\n\r\n        ^\r\n\r\n    ../../src/shared/missing.h:594:19: error: static declaration of ‘setns’ follows non-static declaration\r\n\r\n    static inline int setns(int fd, int nstype) {\r\n\r\n                    ^\r\n\r\n    In file included from /usr/include/sched.h:41:0,\r\n\r\n                    from ../../src/shared/util.h:33,\r\n\r\n                    from systemd/_journal.c:25:\r\n\r\n    /usr/include/x86_64-linux-gnu/bits/sched.h:91:12: note: previous declaration of ‘setns’ was here\r\n\r\n    extern int setns (int __fd, int __nstype) __THROW;\r\n\r\n                ^\r\n\r\n    In file included from ../../src/shared/util.h:49:0,\r\n\r\n                    from systemd/_journal.c:25:\r\n\r\n    ../../src/shared/formats-util.h:38:4: error: #error Unknown uid_t size\r\n\r\n    #  error Unknown uid_t size\r\n\r\n        ^\r\n\r\n    ../../src/shared/formats-util.h:46:4: error: #error Unknown gid_t size\r\n\r\n    #  error Unknown gid_t size\r\n\r\n        ^\r\n\r\n    ../../src/shared/formats-util.h:62:4: error: #error Unknown rlim_t size\r\n\r\n    #  error Unknown rlim_t size\r\n\r\n        ^\r\n\r\n    systemd/_journal.c: In function ‘PyInit__journal’:\r\n\r\n    <command-line>:0:17: warning: passing argument 3 of ‘PyModule_AddStringConstant’ makes pointer from integer without a cast\r\n\r\n    systemd/_journal.c:148:58: note: in expansion of macro ‘PACKAGE_VERSION’\r\n\r\n            if (PyModule_AddStringConstant(m, \"__version__\", PACKAGE_VERSION)) {\r\n\r\n                                                            ^\r\n\r\n    In file included from /usr/include/python3.4m/Python.h:113:0,\r\n\r\n                    from systemd/_journal.c:22:\r\n\r\n    /usr/include/python3.4m/modsupport.h:49:17: note: expected ‘const char *’ but argument is of type ‘int’\r\n\r\n    PyAPI_FUNC(int) PyModule_AddStringConstant(PyObject *, const char *, const char *);\r\n\r\n                    ^\r\n\r\n    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1\r\n\r\n    ----------------------------------------\r\n    Cleaning up...\r\n    Command /root/tests/systemd/src/python/pyvenv/bin/python3.4 -c \"import setuptools, tokenize; __file__='/root/tests/systemd/src/python/setup.py'; exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec'))\" develop --no-deps failed with error code 1 in /root/tests/systemd/src/python\r\n    Storing debug log for failure in /root/.pip/pip.log\r\n"},"comment":{"url":"https://api.github.com/repos/systemd/systemd/issues/comments/98438018","html_url":"https://github.com/systemd/systemd/pull/35#issuecomment-98438018","issue_url":"https://api.github.com/repos/systemd/systemd/issues/35","id":98438018,"user":{"login":"GMLudo","id":243823,"avatar_url":"https://avatars.githubusercontent.com/u/243823?v=3","gravatar_id":"","url":"https://api.github.com/users/GMLudo","html_url":"https://github.com/GMLudo","followers_url":"https://api.github.com/users/GMLudo/followers","following_url":"https://api.github.com/users/GMLudo/following{/other_user}","gists_url":"https://api.github.com/users/GMLudo/gists{/gist_id}","starred_url":"https://api.github.com/users/GMLudo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GMLudo/subscriptions","organizations_url":"https://api.github.com/users/GMLudo/orgs","repos_url":"https://api.github.com/users/GMLudo/repos","events_url":"https://api.github.com/users/GMLudo/events{/privacy}","received_events_url":"https://api.github.com/users/GMLudo/received_events","type":"User","site_admin":false},"created_at":"2015-05-03T05:26:52Z","updated_at":"2015-05-03T05:26:52Z","body":"@joshumax I've published an e-mail on mailing-list about that.\r\nFor now, this pull request doesn't work, I'll send a patch when I'll have a functional version."}}