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

pylibfdt/meson.build: fix Python library being rebuilt during install #136

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion pylibfdt/Makefile.pylibfdt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ endif

$(PYMODULE): $(PYLIBFDT_srcs) $(LIBFDT_archive) $(SETUP)
@$(VECHO) PYMOD $@
$(PYTHON) $(SETUP) $(SETUPFLAGS) build_ext --build-lib=$(PYLIBFDT_dir)
$(PYTHON) $(SETUP) $(SETUPFLAGS) build_ext

install_pylibfdt: $(PYMODULE)
@$(VECHO) INSTALL-PYLIB
Expand Down
2 changes: 1 addition & 1 deletion pylibfdt/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pylibfdt = custom_target(
input: 'libfdt.i',
depends: libfdt,
output: '_libfdt.so',
command: [setup_py, 'build_ext', '--build-lib=' + meson.current_build_dir()],
Copy link
Owner

Choose a reason for hiding this comment

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

So you remove --build-lib here, but it's still used in the Makefile build. Is that intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, I forgot to check the Makefiles. It has the same issue with rebuilding between a make all -> make install. Removing --build-lib fixes it there too. Pushed a second commit to fix Makefile.

command: [setup_py, 'build_ext'],
build_by_default: true,
)

Expand Down
14 changes: 13 additions & 1 deletion tests/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ if [ -n "$NO_PYTHON" ]; then
no_python=false
fi
else
if [ -f ../pylibfdt/_libfdt.so ] || [ -f ../pylibfdt/_libfdt.cpython-3*.so ]; then
if [ -f ../pylibfdt/_libfdt.so ] \
|| [ -f ../pylibfdt/_libfdt.cpython-3*.so ] \
|| [ -f ../build/lib.*/_libfdt.cpython-3*.so ]; then
no_python=false
else
no_python=true
Expand Down Expand Up @@ -57,6 +59,16 @@ if [ -z "$TEST_LIBDIR" ]; then
fi
export LD_LIBRARY_PATH="$TEST_LIBDIR"

# Find the python module that distutils builds under a machine-specific path
PYLIBFDT_BUILD=$(echo ../build/lib.*)
if [ -e "$PYLIBFDT_BUILD" ]; then
if [ -n "$PYTHONPATH" ]; then
export PYTHONPATH="$PYTHONPATH:$PYLIBFDT_BUILD"
else
export PYTHONPATH="$PYLIBFDT_BUILD"
fi
fi

export QUIET_TEST=1
STOP_ON_FAIL=0

Expand Down
Loading