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

bpo-23404: make touch becomes make regen-all #1405

Merged
merged 1 commit into from May 3, 2017

Conversation

Projects
None yet
3 participants
@vstinner
Copy link
Member

commented May 2, 2017

Don't rebuild generated files based on file modification time
anymore. The action is now explicit.

Changes:

  • Remove "make touch", Tools/hg/hgtouch.py and .hgtouch

  • Add a new "make rebuild-all" command to rebuild all generated files

  • Add subcommands to only generate specific files:

    • rebuild-ast: Include/Python-ast.h and Python/Python-ast.c
    • rebuild-grammar: Include/graminit.h and Python/graminit.c
    • rebuild-importlib: Python/importlib_external.h and Python/importlib.h
    • rebuild-opcode: Include/opcode.h
    • rebuild-opcode-targets: Python/opcode_targets.h
    • rebuild-typeslots: Objects/typeslots.inc
  • pgen is now only built by by "make rebuild-grammar"

  • Add $(srcdir)/ prefix to paths to source files to handle correctly
    compilation outside the source directory

Note: $(PYTHON_FOR_GEN) is no more used nor needed by "make" (default
target, build Python).

@vstinner vstinner requested a review from vadmium May 2, 2017

@vstinner

This comment has been minimized.

Copy link
Member Author

commented May 3, 2017

I tested custom builds on buildbot and I confirm that the change fixes the bootstrap/make touch issues. Tests are running on the two following buildbots, whereas without my change tests fail on trying to rebuild Python (try to rebuild Include/opcode.h).

@zware

zware approved these changes May 3, 2017

Copy link
Member

left a comment

LGTM, but I haven't fully parsed how the old mess worked. We should also have CI (either Travis or buildbot) confirming that make rebuild-all doesn't leave any checked-in files modified.

@vstinner

This comment has been minimized.

Copy link
Member Author

commented May 3, 2017

I ran the following tests, all my tests passed.

!Warning! The "git clean -fdx" command removes all untracked files!

Build: it works.

git clean -fdx
./configure --with-pydebug
make

Rebuild: no error.

git clean -fdx
./configure --with-pydebug
make rebuild-all

Rebuild in a different directory. rebuild-all doesn't create any new file in ~/build_cpython/ (except of pgen and .o files), only replace files in the source directory (as expected).

git clean -fdx
mkdir ~/build_cpython
cd ~/build_cpython
~/prog/python/master/configure --with-pydebug
make rebuild-all

Build in a different directory: it works.

git clean -fdx
mkdir ~/build_cpython
cd ~/build_cpython
~/prog/python/master/configure --with-pydebug
make
bpo-23404: make touch becomes make regen-all
Don't rebuild generated files based on file modification time
anymore, the action is now explicit. Replace "make touch"
with "make regen-all".

Changes:

* Remove "make touch", Tools/hg/hgtouch.py and .hgtouch
* Add a new "make regen-all" command to rebuild all generated files
* Add subcommands to only generate specific files:

  - regen-ast: Include/Python-ast.h and Python/Python-ast.c
  - regen-grammar: Include/graminit.h and Python/graminit.c
  - regen-importlib: Python/importlib_external.h and Python/importlib.h
  - regen-opcode: Include/opcode.h
  - regen-opcode-targets: Python/opcode_targets.h
  - regen-typeslots: Objects/typeslots.inc

* Rename PYTHON_FOR_GEN to PYTHON_FOR_REGEN
* pgen is now only built by by "make regen-grammar"
* Add $(srcdir)/ prefix to paths to source files to handle correctly
  compilation outside the source directory

Note: $(PYTHON_FOR_REGEN) is no more used nor needed by "make"
default target building Python.

@vstinner vstinner force-pushed the vstinner:rebuild branch from 22b304f to 12ad6d2 May 3, 2017

@vstinner vstinner changed the title bpo-23404: make touch becomes make rebuild-all bpo-23404: make touch becomes make regen-all May 3, 2017

@vstinner vstinner merged commit a5c62a8 into python:master May 3, 2017

3 checks passed

bedevere/issue-number Issue number 23404 found.
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@vstinner vstinner deleted the vstinner:rebuild branch May 3, 2017

vstinner added a commit to vstinner/cpython that referenced this pull request May 4, 2017

bpo-23404: make touch becomes make regen-all (python#1405)
Don't rebuild generated files based on file modification time
anymore, the action is now explicit. Replace "make touch"
with "make regen-all".

Changes:

* Remove "make touch", Tools/hg/hgtouch.py and .hgtouch
* Add a new "make regen-all" command to rebuild all generated files
* Add subcommands to only generate specific files:

  - regen-ast: Include/Python-ast.h and Python/Python-ast.c
  - regen-grammar: Include/graminit.h and Python/graminit.c
  - regen-importlib: Python/importlib_external.h and Python/importlib.h
  - regen-opcode: Include/opcode.h
  - regen-opcode-targets: Python/opcode_targets.h
  - regen-typeslots: Objects/typeslots.inc

* Rename PYTHON_FOR_GEN to PYTHON_FOR_REGEN
* pgen is now only built by by "make regen-grammar"
* Add $(srcdir)/ prefix to paths to source files to handle correctly
  compilation outside the source directory

Note: $(PYTHON_FOR_REGEN) is no more used nor needed by "make"
default target building Python.
(cherry picked from commit a5c62a8)

vstinner added a commit that referenced this pull request May 4, 2017

[3.6] bpo-23404: make touch becomes make regen-all (#1405) (#1461)
* bpo-23404: make touch becomes make regen-all (#1405)

Don't rebuild generated files based on file modification time
anymore, the action is now explicit. Replace "make touch"
with "make regen-all".

Changes:

* Remove "make touch", Tools/hg/hgtouch.py and .hgtouch
* Add a new "make regen-all" command to rebuild all generated files
* Add subcommands to only generate specific files:

  - regen-ast: Include/Python-ast.h and Python/Python-ast.c
  - regen-grammar: Include/graminit.h and Python/graminit.c
  - regen-importlib: Python/importlib_external.h and Python/importlib.h
  - regen-opcode: Include/opcode.h
  - regen-opcode-targets: Python/opcode_targets.h
  - regen-typeslots: Objects/typeslots.inc

* Rename PYTHON_FOR_GEN to PYTHON_FOR_REGEN
* pgen is now only built by by "make regen-grammar"
* Add $(srcdir)/ prefix to paths to source files to handle correctly
  compilation outside the source directory

Note: $(PYTHON_FOR_REGEN) is no more used nor needed by "make"
default target building Python.
(cherry picked from commit a5c62a8)

* bpo-30273: Update sysconfig (#1464)

The AST_H_DIR variable was removed from Makefile.pre.in by the commit
a5c62a8 (bpo-23404).

AST_H_DIR was hardcoded to "Include", so replace the removed variable
by its content.

Remove also ASDLGEN variable from sysconfig example since this
variable was also removed.
(cherry picked from commit b109a1d)

vstinner added a commit to vstinner/cpython that referenced this pull request May 4, 2017

bpo-23404: make touch becomes make regen-all (python#1405) (python#1461)
* bpo-23404: make touch becomes make regen-all (python#1405)

Don't rebuild generated files based on file modification time
anymore, the action is now explicit. Replace "make touch"
with "make regen-all".

Changes:

* Remove "make touch", Tools/hg/hgtouch.py and .hgtouch
* Add a new "make regen-all" command to rebuild all generated files
* Add subcommands to only generate specific files:

  - regen-ast: Include/Python-ast.h and Python/Python-ast.c
  - regen-grammar: Include/graminit.h and Python/graminit.c
  - regen-importlib: Python/importlib_external.h and Python/importlib.h
  - regen-opcode: Include/opcode.h
  - regen-opcode-targets: Python/opcode_targets.h
  - regen-typeslots: Objects/typeslots.inc

* Rename PYTHON_FOR_GEN to PYTHON_FOR_REGEN
* pgen is now only built by by "make regen-grammar"
* Add $(srcdir)/ prefix to paths to source files to handle correctly
  compilation outside the source directory

Note: $(PYTHON_FOR_REGEN) is no more used nor needed by "make"
default target building Python.
(cherry picked from commit a5c62a8)

* bpo-30273: Update sysconfig (python#1464)

The AST_H_DIR variable was removed from Makefile.pre.in by the commit
a5c62a8 (bpo-23404).

AST_H_DIR was hardcoded to "Include", so replace the removed variable
by its content.

Remove also ASDLGEN variable from sysconfig example since this
variable was also removed.
(cherry picked from commit b109a1d)

(cherry picked from commit 9d02f56)

vstinner added a commit that referenced this pull request May 5, 2017

bpo-23404: make touch becomes make regen-all (#1405) (#1461) (#1465)
* bpo-23404: make touch becomes make regen-all (#1405)

Don't rebuild generated files based on file modification time
anymore, the action is now explicit. Replace "make touch"
with "make regen-all".

Changes:

* Remove "make touch", Tools/hg/hgtouch.py and .hgtouch
* Add a new "make regen-all" command to rebuild all generated files
* Add subcommands to only generate specific files:

  - regen-ast: Include/Python-ast.h and Python/Python-ast.c
  - regen-grammar: Include/graminit.h and Python/graminit.c
  - regen-importlib: Python/importlib_external.h and Python/importlib.h
  - regen-opcode: Include/opcode.h
  - regen-opcode-targets: Python/opcode_targets.h
  - regen-typeslots: Objects/typeslots.inc

* Rename PYTHON_FOR_GEN to PYTHON_FOR_REGEN
* pgen is now only built by by "make regen-grammar"
* Add $(srcdir)/ prefix to paths to source files to handle correctly
  compilation outside the source directory

Note: $(PYTHON_FOR_REGEN) is no more used nor needed by "make"
default target building Python.
(cherry picked from commit a5c62a8)

* bpo-30273: Update sysconfig (#1464)

The AST_H_DIR variable was removed from Makefile.pre.in by the commit
a5c62a8 (bpo-23404).

AST_H_DIR was hardcoded to "Include", so replace the removed variable
by its content.

Remove also ASDLGEN variable from sysconfig example since this
variable was also removed.
(cherry picked from commit b109a1d)

(cherry picked from commit 9d02f56)

schlamar added a commit to schlamar/cpython that referenced this pull request May 5, 2017

bpo-23404: make touch becomes make regen-all (python#1405)
Don't rebuild generated files based on file modification time
anymore, the action is now explicit. Replace "make touch"
with "make regen-all".

Changes:

* Remove "make touch", Tools/hg/hgtouch.py and .hgtouch
* Add a new "make regen-all" command to rebuild all generated files
* Add subcommands to only generate specific files:

  - regen-ast: Include/Python-ast.h and Python/Python-ast.c
  - regen-grammar: Include/graminit.h and Python/graminit.c
  - regen-importlib: Python/importlib_external.h and Python/importlib.h
  - regen-opcode: Include/opcode.h
  - regen-opcode-targets: Python/opcode_targets.h
  - regen-typeslots: Objects/typeslots.inc

* Rename PYTHON_FOR_GEN to PYTHON_FOR_REGEN
* pgen is now only built by by "make regen-grammar"
* Add $(srcdir)/ prefix to paths to source files to handle correctly
  compilation outside the source directory

Note: $(PYTHON_FOR_REGEN) is no more used nor needed by "make"
default target building Python.

zhangyangyu added a commit to zhangyangyu/cpython that referenced this pull request May 8, 2017

bpo-23404: make touch becomes make regen-all (python#1405)
Don't rebuild generated files based on file modification time
anymore, the action is now explicit. Replace "make touch"
with "make regen-all".

Changes:

* Remove "make touch", Tools/hg/hgtouch.py and .hgtouch
* Add a new "make regen-all" command to rebuild all generated files
* Add subcommands to only generate specific files:

  - regen-ast: Include/Python-ast.h and Python/Python-ast.c
  - regen-grammar: Include/graminit.h and Python/graminit.c
  - regen-importlib: Python/importlib_external.h and Python/importlib.h
  - regen-opcode: Include/opcode.h
  - regen-opcode-targets: Python/opcode_targets.h
  - regen-typeslots: Objects/typeslots.inc

* Rename PYTHON_FOR_GEN to PYTHON_FOR_REGEN
* pgen is now only built by by "make regen-grammar"
* Add $(srcdir)/ prefix to paths to source files to handle correctly
  compilation outside the source directory

Note: $(PYTHON_FOR_REGEN) is no more used nor needed by "make"
default target building Python.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.