msg274316 - (view) |
Author: Xiang Zhang (xiang.zhang) *  |
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) *  |
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) *  |
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) *  |
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) *  |
Date: 2016-09-04 05:32 |
I think putting @ in front would be safe. Nobody has complained that “# . . .” didn’t work. I expect changing them to “@# . . .” 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) *  |
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) *  |
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) *  |
Date: 2016-09-05 01:05 |
I think @# Comment would be just as good as (and slightly clearer than) @: # 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) *  |
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 '@ #...'? Note there is a space. In my editor(Emacs), '@#' 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)  |
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) *  |
Date: 2016-09-22 13:14 |
The version I committed has the space separating @ # |
|
|