This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Superfluous messages when running make
Type: enhancement Stage: resolved
Components: Build Versions: Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: martin.panter, ned.deily, python-dev, xiang.zhang
Priority: normal Keywords: patch

Created on 2016-09-03 17:18 by xiang.zhang, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue27950.patch xiang.zhang, 2016-09-03 18:08 review
issue27950_v2.patch xiang.zhang, 2016-09-04 13:55 review
Selection_012.png xiang.zhang, 2016-09-05 02:46
Messages (11)
msg274316 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2016-09-03 17:18
Every time running make I can get such messages:

# Substitution happens here, as the completely-expanded BINDIR
# is not available in configure
sed -e "s,@EXENAME@,/usr/local/bin/python3.6m," < ./Misc/python-config.in >python-config.py
# Replace makefile compat. variable references with shell script compat. ones;  -> 
sed -e 's,\$(\([A-Za-z0-9_]*\)),\$\{\1\},g' < Misc/python-config.sh >python-config
# On Darwin, always use the python version of the script, the shell
# version doesn't use the compiler customizations that are provided
# in python (_osx_support.py).
if test `uname -s` = Darwin; then \
	cp python-config.py python-config; \
fi

and 

./python -E -S -m sysconfig --generate-posix-vars ;\
if test $? -ne 0 ; then \
	echo "generate-posix-vars failed" ; \
	rm -f ./pybuilddir.txt ; \
	exit 1 ; \
fi

I think the comment and if part has no need to prompt to users.

Also running some recipes regarding coverage like run_profile_task will prompt 

: # FIXME: can't run for a cross build

Need to get a fix for this?
msg274330 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-09-04 01:30
I never noticed this because unless I am debugging a build problem I use “make -s”, which hides all the commands lines, and lets you see compiler warnings etc much easier.

Very briefly testing with Gnu Make and BSD Make, your patch doesn’t seem to do anything too disastrous. BTW BSD Make seems to treat the existing python-config target comments as Make comments without any output, while Gnu Make treats them as shell comments and outputs them.

However it seems that other Make implementations might take your comments in the middle of a list of commands as a sign to end the list of commands. See <http://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html>:

“An empty or blank line, or a line beginning with '#', may begin a new entry.”

Maybe it would be best to move these comments to before the target rules, with clarification, e.g. “Substitution happens [in the first sed command] . . . [The second sed command] replaces . . .”
msg274338 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2016-09-04 04:56
> However it seems that other Make implementations might take your comments in the middle of a list of commands as a sign to end the list of commands.

If this is true then it seems we have to move the comments before the rules. Another way that might work is adding @ to silence the comment before the comments. But this is really unfriendly to editor highlight.
msg274339 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2016-09-04 04:59
Ooh, sorry. This "Another way that might work is adding @ to silence the comment before the comments" should also fall in "However it seems that other Make implementations might take your comments in the middle of a list of commands as a sign to end the list of commands". I'll search more and if there is no other methods, write a patch applying your suggestion.
msg274340 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-09-04 05:32
I think putting @ in front would be safe. Nobody has complained that “<Tab># . . .” didn’t work. I expect changing them to “<Tab>@# . . .” would be no worse. I think the Posix page was only talking about comment lines that _don’t_ begin with a tab.

At least in Gnu and BSD Makes, the @# option seems to work as desired.
msg274342 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2016-09-04 06:17
That is not ideal. @# can silence the comment but actually it is still not a comment. The "# ..." part still will be evaluated by shell.
msg274362 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2016-09-04 13:55
After more study, I think we can do just as what I have pointed out as the problem, ': #...". This can make us have an indent comment that won't be evaluated by the shell. And we only need to add @ before it so it won't be echoed.

As for the part you comment, Martin, if we have to rely on the exit status, I'm afraid there is nothing we can do.
msg274381 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-09-05 01:05
I think

<Tab>@# Comment

would be just as good as (and slightly clearer than)

<Tab>@: # Comment

They would both invoke the shell. The first has no command and just a shell comment; the second has a no-op command (:) with a comment. Let me know if you agree @# would be okay.

I can’t think of a simple solution for the pybuilddir.txt rule. (Other than using make -s :)
msg274385 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2016-09-05 02:46
Ohh, it's reasonable. I forgot # means also comments in shell. What a shame. :(

But can we make it '<tab>@ #...'? Note there is a space. In my editor(Emacs), '<tab>@#' will break highlight and highlight it as a command, which is a hurt during reading. You can see it in the screenshot I upload.
msg277217 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-09-22 10:56
New changeset 6911917f1f02 by Martin Panter in branch 'default':
Issue #27950: Silence long makefile commands and comments
https://hg.python.org/cpython/rev/6911917f1f02
msg277222 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-09-22 13:14
The version I committed has the space separating @ #
History
Date User Action Args
2022-04-11 14:58:35adminsetgithub: 72137
2016-09-22 13:16:00martin.pantersetversions: + Python 3.7, - Python 3.6
2016-09-22 13:14:39martin.pantersetstatus: open -> closed
resolution: fixed
messages: + msg277222

stage: patch review -> resolved
2016-09-22 10:56:39python-devsetnosy: + python-dev
messages: + msg277217
2016-09-05 02:46:43xiang.zhangsetfiles: + Selection_012.png

messages: + msg274385
2016-09-05 01:05:16martin.pantersetmessages: + msg274381
2016-09-04 13:55:00xiang.zhangsetfiles: + issue27950_v2.patch

messages: + msg274362
2016-09-04 06:17:18xiang.zhangsetmessages: + msg274342
2016-09-04 05:33:29martin.pantersettitle: Superflous messages when running make -> Superfluous messages when running make
2016-09-04 05:32:00martin.pantersetmessages: + msg274340
2016-09-04 04:59:27xiang.zhangsetmessages: + msg274339
2016-09-04 04:56:15xiang.zhangsetmessages: + msg274338
2016-09-04 01:30:53martin.pantersetnosy: + martin.panter

messages: + msg274330
stage: patch review
2016-09-03 18:08:17xiang.zhangsetfiles: + issue27950.patch
keywords: + patch
2016-09-03 17:18:13xiang.zhangcreate