Skip to contentSkip to conversation

python-watchdog: add support for uClibc

PATCH New yegorslists at googlemail.com 3 participants 8 messages Feb 16, 2018 – May 1, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 python-watchdog: add support for uClibc

From: Yegor Yefremov <[email protected]>

This patch fixes uClibc detection.

---
 ...dd-a-workaround-to-support-uClibc-library.patch | 43 ++++++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 package/python-watchdog/0001-Add-a-workaround-to-support-uClibc-library.patch
package/python-watchdog/0001-Add-a-workaround-to-support-uClibc-library.patch new file +43 -0
new file mode 100644
index 0000000..c21e6cd
@@ -0,0 +1,43 @@
+From c3b3c4581b25d7e62f5c2ce1484133229d5e657a Mon Sep 17 00:00:00 2001
+From: Yegor Yefremov <[email protected]>
+Date: Fri, 16 Feb 2018 13:26:23 +0100
+Subject: [PATCH] Add a workaround to support uClibc library
+
+uClibc based systems provide only libc.so.0 and libc.so.1
+symlinks.
+
+So try to find libc.so.0 if neither libc.so nor libc.so.6
+could be found.
+
+Signed-off-by: Yegor Yefremov <[email protected]>
+---
+ src/watchdog/observers/inotify_c.py | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/src/watchdog/observers/inotify_c.py b/src/watchdog/observers/inotify_c.py
+index 5f208b6..0dc7b50 100644
+--- a/src/watchdog/observers/inotify_c.py
++++ b/src/watchdog/observers/inotify_c.py
+@@ -45,7 +45,19 @@ def _load_libc():
+     try:
+         return ctypes.CDLL('libc.so')
+     except (OSError, IOError):
++        pass
++
++    try:
+         return ctypes.CDLL('libc.so.6')
++    except (OSError, IOError):
++        pass
++
++    # uClibc
++    try:
++        return ctypes.CDLL('libc.so.0')
++    except (OSError, IOError) as err:
++        raise err
++
+ 
+ libc = _load_libc()
+ 
+-- 
+2.1.4
+
Signature · 1 line
2.1.4
#1 lore raw

PATCH 2/2 python-watchdog: add missing runtime dependency

From: Yegor Yefremov <[email protected]>

Script watchmedo requires python-setuptools.

---
 package/python-watchdog/Config.in | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
package/python-watchdog/Config.in +4 -3
index e529089..18f569e 100644
@@ -1,8 +1,9 @@
 config BR2_PACKAGE_PYTHON_WATCHDOG
 	bool "python-watchdog"
-	select BR2_PACKAGE_PYTHON_PYYAML
-	select BR2_PACKAGE_PYTHON_ARGH
-	select BR2_PACKAGE_PYTHON_PATHTOOLS
+	select BR2_PACKAGE_PYTHON_ARGH # runtime
+	select BR2_PACKAGE_PYTHON_PATHTOOLS # runtime
+	select BR2_PACKAGE_PYTHON_PYYAML # runtime
+	select BR2_PACKAGE_PYTHON_SETUPTOOLS # runtime
 	help
 	  Python API and shell utilities to monitor file system events.
 
Signature · 1 line
2.1.4
#2 lore raw

PATCH 2/2 python-watchdog: add missing runtime dependency

Hello,

Quoted 14 lines · yegorslists at googlemail.com

From: Yegor Yefremov <[email protected]>

Script watchmedo requires python-setuptools.

---
 package/python-watchdog/Config.in | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
package/python-watchdog/Config.in +0 -0
index e529089..18f569e 100644

package/python-watchdog/Config.in line 6

Quoted 9 lines
package/python-watchdog/Config.in +4 -3
@@ -1,8 +1,9 @@
 config BR2_PACKAGE_PYTHON_WATCHDOG
 	bool "python-watchdog"
-	select BR2_PACKAGE_PYTHON_PYYAML
-	select BR2_PACKAGE_PYTHON_ARGH
-	select BR2_PACKAGE_PYTHON_PATHTOOLS
+	select BR2_PACKAGE_PYTHON_ARGH # runtime
+	select BR2_PACKAGE_PYTHON_PATHTOOLS # runtime
+	select BR2_PACKAGE_PYTHON_PYYAML # runtime
+	select BR2_PACKAGE_PYTHON_SETUPTOOLS # runtime

I applied, but since this dependency is only needed for the watchmedo.py script, does it make sense to make this a mandatory dependency ?

Also, skimming through the watchmedo.py script, I couldn't see what was bringing this dependecny on setuptools. Could you enlighten me (it's mainly for my own curiosity, I trust you when you said it was needed).

Applied, thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

PATCH 2/2 python-watchdog: add missing runtime dependency

Quoted 22 lines · Thomas Petazzoni

Hello,

Quoted 19 lines · yegorslists at googlemail.com

From: Yegor Yefremov <[email protected]>

Script watchmedo requires python-setuptools.

---
 package/python-watchdog/Config.in | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
package/python-watchdog/Config.in +0 -3
index e529089..18f569e 100644
@@ -1,8 +1,9 @@
 config BR2_PACKAGE_PYTHON_WATCHDOG
      bool "python-watchdog"
-     select BR2_PACKAGE_PYTHON_PYYAML
-     select BR2_PACKAGE_PYTHON_ARGH
-     select BR2_PACKAGE_PYTHON_PATHTOOLS
Quoted 8 lines

package/python-watchdog/Config.in line 6

Quoted 4 lines
package/python-watchdog/Config.in +4 -0
+     select BR2_PACKAGE_PYTHON_ARGH # runtime
+     select BR2_PACKAGE_PYTHON_PATHTOOLS # runtime
+     select BR2_PACKAGE_PYTHON_PYYAML # runtime
+     select BR2_PACKAGE_PYTHON_SETUPTOOLS # runtime

I applied, but since this dependency is only needed for the watchmedo.py script, does it make sense to make this a mandatory dependency ?

We make it already for some other packages like crossbar for example.

Quoted 3 lines

Also, skimming through the watchmedo.py script, I couldn't see what was bringing this dependecny on setuptools. Could you enlighten me (it's mainly for my own curiosity, I trust you when you said it was needed).

The whole entry_points mechanism is described here:
https://stackoverflow.com/a/9615473/1113139
That's why setuptools package is needed on target.

Yegor

Quoted 7 lines

Applied, thanks!

Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering
https://bootlin.com

#5 lore raw

PATCH 1/2 python-watchdog: add support for uClibc

In reply to yegorslists at googlemail.com

Hello,

Quoted 9 lines · yegorslists at googlemail.com

From: Yegor Yefremov <[email protected]>

This patch fixes uClibc detection.

---
 ...dd-a-workaround-to-support-uClibc-library.patch | 43 ++++++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 package/python-watchdog/0001-Add-a-workaround-to-support-uClibc-library.patch

Applied to master, thanks. Did you submit this patch upstream ?

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
#6 lore raw

PATCH 1/2 python-watchdog: add support for uClibc

Quoted 7 lines · Thomas Petazzoni

Hello,

Quoted 4 lines · yegorslists at googlemail.com

From: Yegor Yefremov <[email protected]>

This patch fixes uClibc detection.

Quoted 7 lines
Quoted 5 lines
---
 ...dd-a-workaround-to-support-uClibc-library.patch | 43 ++++++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 package/python-watchdog/0001-Add-a-workaround-to-support-uClibc-library.patch

Applied to master, thanks. Did you submit this patch upstream ?

I'll do this, but the project seems to be abandoned :-(

Yegor

Quoted 5 lines

Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering
https://bootlin.com