Skip to contentSkip to conversation

bindings: python: fix library path for python test builds

PATCH In review Phil Howard 2 participants 5 messages Nov 7, 2023 – Nov 9, 2023 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 bindings: python: fix library path for python test builds

Correct top_srcdir to top_builddir for out of tree builds.

---
 bindings/python/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
bindings/python/Makefile.am +1 -1
index 079ceb1..b2f2779 100644
@@ -15,7 +15,7 @@ all-local:
 	GPIOD_WITH_TESTS=$(BUILD_TESTS) \
 	$(PYTHON) setup.py build_ext --inplace \
 		--include-dirs=$(top_srcdir)/include/:$(top_srcdir)/tests/gpiosim/ \
-		--library-dirs=$(top_builddir)/lib/.libs/:$(top_srcdir)/tests/gpiosim/.libs/
+		--library-dirs=$(top_builddir)/lib/.libs/:$(top_builddir)/tests/gpiosim/.libs/
 
 install-exec-local:
 	GPIOD_WITH_TESTS= \
Signature · 1 line
2.34.1
#1 lore raw

PATCH 2/2 bindings: python: use absolute paths for python test builds

Change the paths used to build test C extensions in place to their abs counterparts. Avoids issues locating files if the build behaviour changes.

---
 bindings/python/Makefile.am | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
bindings/python/Makefile.am +2 -2
index b2f2779..95edfff 100644
@@ -14,8 +14,8 @@ endif
 all-local:
 	GPIOD_WITH_TESTS=$(BUILD_TESTS) \
 	$(PYTHON) setup.py build_ext --inplace \
-		--include-dirs=$(top_srcdir)/include/:$(top_srcdir)/tests/gpiosim/ \
-		--library-dirs=$(top_builddir)/lib/.libs/:$(top_builddir)/tests/gpiosim/.libs/
+		--include-dirs=$(abs_top_srcdir)/include/:$(abs_top_srcdir)/tests/gpiosim/ \
+		--library-dirs=$(abs_top_builddir)/lib/.libs/:$(abs_top_builddir)/tests/gpiosim/.libs/
 
 install-exec-local:
 	GPIOD_WITH_TESTS= \
Signature · 1 line
2.34.1
#2 lore raw
In reply to Phil Howard
Quoted 22 lines · Phil Howard

Correct top_srcdir to top_builddir for out of tree builds.

---
 bindings/python/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
bindings/python/Makefile.am +1 -2
index 079ceb1..b2f2779 100644
@@ -15,7 +15,7 @@ all-local:
        GPIOD_WITH_TESTS=$(BUILD_TESTS) \
        $(PYTHON) setup.py build_ext --inplace \
                --include-dirs=$(top_srcdir)/include/:$(top_srcdir)/tests/gpiosim/ \
-               --library-dirs=$(top_builddir)/lib/.libs/:$(top_srcdir)/tests/gpiosim/.libs/
+               --library-dirs=$(top_builddir)/lib/.libs/:$(top_builddir)/tests/gpiosim/.libs/
 
 install-exec-local:
        GPIOD_WITH_TESTS= \
--
Quoted 2 lines

2.34.1

Phil, please squash these two patches together as you're modifying a line in the first one just to change it again in the second.

Bart

#3 lore raw
Quoted 30 lines · Bartosz Golaszewski
Quoted 22 lines · Phil Howard

Correct top_srcdir to top_builddir for out of tree builds.

---
 bindings/python/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
bindings/python/Makefile.am +1 -2
index 079ceb1..b2f2779 100644
@@ -15,7 +15,7 @@ all-local:
        GPIOD_WITH_TESTS=$(BUILD_TESTS) \
        $(PYTHON) setup.py build_ext --inplace \
                --include-dirs=$(top_srcdir)/include/:$(top_srcdir)/tests/gpiosim/ \
-               --library-dirs=$(top_builddir)/lib/.libs/:$(top_srcdir)/tests/gpiosim/.libs/
+               --library-dirs=$(top_builddir)/lib/.libs/:$(top_builddir)/tests/gpiosim/.libs/
 
 install-exec-local:
        GPIOD_WITH_TESTS= \
--
Quoted 2 lines

2.34.1

Phil, please squash these two patches together as you're modifying a line in the first one just to change it again in the second.

Quoted 1 line

Bart

Nevermind, I squashed it myself.

Bart

#4 lore raw
Quoted 32 lines · Bartosz Golaszewski
Quoted 30 lines · Bartosz Golaszewski
Quoted 22 lines · Phil Howard

Correct top_srcdir to top_builddir for out of tree builds.

---
 bindings/python/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
bindings/python/Makefile.am +1 -2
index 079ceb1..b2f2779 100644
@@ -15,7 +15,7 @@ all-local:
        GPIOD_WITH_TESTS=$(BUILD_TESTS) \
        $(PYTHON) setup.py build_ext --inplace \
                --include-dirs=$(top_srcdir)/include/:$(top_srcdir)/tests/gpiosim/ \
-               --library-dirs=$(top_builddir)/lib/.libs/:$(top_srcdir)/tests/gpiosim/.libs/
+               --library-dirs=$(top_builddir)/lib/.libs/:$(top_builddir)/tests/gpiosim/.libs/
 
 install-exec-local:
        GPIOD_WITH_TESTS= \
--
Quoted 2 lines

2.34.1

Phil, please squash these two patches together as you're modifying a line in the first one just to change it again in the second.

Quoted 5 lines
Quoted 1 line

Bart

Nevermind, I squashed it myself.

Bart

Thanks, I sent them split since the latter speculative fix hides the previous actual bugfix but perhaps a better commit message could have worked.

Signature · 1 line
Phil