Skip to content

Commit

Permalink
gh-37127: Rerun configure less often
Browse files Browse the repository at this point in the history
    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes #1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->

<!-- Why is this change required? What problem does it solve? -->
There's no need to re-run `configure` if only template files such as
`build/make/Makefile.in` (see `AC_CONFIG_FILES` in `configure.ac`)
change: It suffices to run `config.status` in this case.

<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes #12345". -->
Fixes #32119
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- #12345: short description why this is a dependency
- #34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: #37127
Reported by: Matthias Köppe
Reviewer(s): Kwankyu Lee, Matthias Köppe
  • Loading branch information
Release Manager committed Mar 21, 2024
2 parents 397fd3f + 663c222 commit ba8393e
Showing 1 changed file with 37 additions and 7 deletions.
44 changes: 37 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,25 @@ SAGE_ROOT_LOGS = logs
# except for build/make/Makefile-auto, which is unused by the build system
CONFIG_FILES = build/make/Makefile src/bin/sage-env-config build/bin/sage-build-env-config pkgs/sage-conf/_sage_conf/_conf.py

# SPKG_COLLECT_FILES contains all files that influence the SAGE_SPKG_COLLECT macro
SPKG_COLLECT_FILES = build/pkgs/*/type build/pkgs/*/package-version.txt build/pkgs/*/dependencies build/pkgs/*/requirements.txt build/pkgs/*/checksums.ini build/pkgs/*/spkg-install

# If configure was run before, rerun it with the old arguments.
# Otherwise, run configure with argument $PREREQ_OPTIONS.
# SPKG_COLLECT_FILES contains the files that influence the *runtime* of the
# portions of the 'configure' script generated by the SAGE_SPKG_COLLECT macro
SPKG_COLLECT_FILES = build/pkgs/*/package-version.txt build/pkgs/*/dependencies*

# If configure was not run before, complain.
# If configure is newer than the files it generated (we test build/make/Makefile),
# we regenerate config.status by running the "config.status --recheck".
# Either way we regenerate the generated files by calling "config.status".
build/make/Makefile: configure $(SPKG_COLLECT_FILES) $(CONFIG_FILES:%=%.in)
$(MAKE) reconfigure
@if [ -x config.status ]; then \
case '$?' in \
*configure*|*package-version*|*dependencies*) \
$(MAKE) reconfigure;; \
*) \
./config.status;; \
esac; \
else \
$(MAKE) reconfigure; \
fi

reconfigure:
rm -f config.log
Expand Down Expand Up @@ -324,7 +336,25 @@ ptestoptionallong-nodoc:

###############################################################################

configure: bootstrap src/doc/bootstrap configure.ac src/bin/sage-version.sh m4/*.m4 build/pkgs/*/spkg-configure.m4 build/pkgs/*/type build/pkgs/*/install-requires.txt build/pkgs/*/package-version.txt build/pkgs/*/distros/*.txt
# The 'configure' script is just one of the files generated by 'bootstrap'.
# CONFIGURE_DEPENDENCIES is the list of files that influence the generation of 'configure'.
CONFIGURE_DEPENDENCIES = \
configure.ac src/bin/sage-version.sh m4/*.m4 \
build/pkgs/*/spkg-configure.m4 \
build/pkgs/*/type build/pkgs/*/SPKG.rst \
build/pkgs/*/checksums.ini build/pkgs/*/requirements.txt \
build/pkgs/*/install-requires.txt build/pkgs/*/package-version.txt \
build/pkgs/*/spkg-install build/pkgs/*/spkg-install.in

# SPKG_INFO_DEPENDENCIES is the list of files that influence the run of 'sage-spkg-info' and hence
# the generation of the files generated in 'src/doc' by 'src/doc/bootstrap'.
SPKG_INFO_DEPENDENCIES = \
build/pkgs/*/type build/pkgs/*/SPKG.rst \
build/pkgs/*/requirements.txt \
build/pkgs/*/install-requires.txt build/pkgs/*/package-version.txt \
build/pkgs/*/distros/*.txt

configure: bootstrap src/doc/bootstrap $(CONFIGURE_DEPENDENCIES) $(SPKG_INFO_DEPENDENCIES)
./bootstrap -d

install: all
Expand Down

0 comments on commit ba8393e

Please sign in to comment.