Skip to content

gh-131556: Fix build-details.json Makefile target #131558

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

Closed
Closed
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
7 changes: 4 additions & 3 deletions Makefile.pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,8 @@ list-targets:

.PHONY: build_all
build_all: check-clean-src check-app-store-compliance $(BUILDPYTHON) platform sharedmods \
gdbhooks Programs/_testembed scripts checksharedmods rundsymutil build-details.json
gdbhooks Programs/_testembed scripts checksharedmods rundsymutil \
$(shell [ -f pybuilddir.txt ] && cat pybuilddir.txt)/build-details.json

.PHONY: build_wasm
build_wasm: check-clean-src $(BUILDPYTHON) platform sharedmods \
Expand Down Expand Up @@ -936,8 +937,8 @@ pybuilddir.txt: $(PYTHON_FOR_BUILD_DEPS)
exit 1 ; \
fi

build-details.json: pybuilddir.txt
$(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/Tools/build/generate-build-details.py `cat pybuilddir.txt`/build-details.json
$(shell [ -f pybuilddir.txt ] && cat pybuilddir.txt)/build-details.json: pybuilddir.txt
Copy link
Contributor

Choose a reason for hiding this comment

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

You cannot use $(shell and should probably forget it exists :)

It is a GNU-ism and will break on any other Make implementation, such as the default Make on BSD.

If cpython were to move to require GNU Make then there are many changes which could be made to this Makefile that would make it significantly smaller, but alas, compatibility...

$(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/Tools/build/generate-build-details.py $(shell cat pybuilddir.txt)/build-details.json

# Build static library
$(LIBRARY): $(LIBRARY_OBJS)
Expand Down
Loading