FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

build: remove requirement to re-run ./configure by addaleax · Pull Request #21371 · nodejs/node · GitHub

/ node Public

build: remove requirement to re-run ./configure - #21371

Closed
addaleax wants to merge 2 commits into
nodejs:masterfrom
addaleax:config.status
Closed

build: remove requirement to re-run ./configure#21371
addaleax wants to merge 2 commits into
nodejs:masterfrom
addaleax:config.status

Conversation

Copy link
Copy Markdown
Member

Instead of requiring ./configure to be run again after
the file changed, first try to re-run the configure script
with the arguments with which it was originally run.

Usually, those arguments will either contain no flags,
or all flags that were passed are still supported.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Instead of requiring `./configure` to be run again after
the file changed, first try to re-run the configure script
with the arguments with which it was originally run.

Usually, those arguments will either contain no flags,
or all flags that were passed are still supported.
devsnek added a commit to devsnek/zero-archive that referenced this pull request Jun 16, 2018
devsnek added the build Issues and PRs related to build files or the CI. label Jun 16, 2018
refack previously requested changes Jun 16, 2018
Comment thread Makefile
config.gypi: configure
$(error Missing or stale $@, please run ./$<)
@if [ -x config.status ]; then \
./config.status; \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I'd rather have:

$(PYTHON) configure $(something that reads .configure_args as args)

So it will be easier to implement for Windows

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

btw shouldn't this be dependant on ls -R *.gyp? as well?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

So it will be easier to implement for Windows

We could follow the same approach pretty easily, I think

btw shouldn't this be dependant on ls -R *.gyp? as well?

I don’t know, somebody else would have to answer that

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Now I understand why your pattern makes perfect sense for autotools, since it only assumes a POSIX compatible shell...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Yeah … I heard escaping parameters for cmd is fun :)

Otherwise we should be able to follow the same format here if we like

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

shouldn't this be dependant on ls -R *.gyp?

Ideally, yes, but can be done in a separate PR.

Comment thread .gitignore

/config.mk
/config.gypi
/config.status

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Suggesting a .configure_args approach, and .* files are ignored by default.

refack commented Jun 16, 2018
edited
Loading

Copy link
Copy Markdown
Contributor

tl;dr if we simply store the args as .configure_args it could be reused in #21284

Another idea, add a --args=.configure_args to configure, then no file reading is needed.

Copy link
Copy Markdown
Member Author

@refack This approach and filename match what it’s how the autotools configure script works, which is the reason it’s named configure in the first place.

refack dismissed their stale review June 17, 2018 00:06

Dismissing for autotools similarity

refack commented Jun 17, 2018
edited
Loading

Copy link
Copy Markdown
Contributor

refack This approach and filename match what it’s how the autotools configure script works, which is the reason it’s named configure in the first place.

But configure is not autotools generated, and we do need to consider cross platform and code reuse. I'm not going to block, but seems like a shame to miss out on this.

My suggestion is:

---
 configure | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 97a75b98569..c8a21c35703 100755
--- a/configure
+++ b/configure
@@ -554,7 +554,13 @@ parser.add_option('-C',
     dest='compile_commands_json',
     help=optparse.SUPPRESS_HELP)
 
-(options, args) = parser.parse_args()
+args = sys.argv[1:]
+if args[0] == '--reuse':
+  with open('.used_configure_flags') as f
+  args = f.readlines()
+else:
+  write('.used_configure_flags', '\n'.join(args)
+(options, args) = parser.parse_args(args)
 
 # Expand ~ in the install prefix now, it gets written to multiple files.
 options.prefix = os.path.expanduser(options.prefix or '')

Copy link
Copy Markdown
Member Author

@refack How would this work on Windows? vcbuild.bat runs configure unconditionally anyway, right?

refack commented Jun 17, 2018

Copy link
Copy Markdown
Contributor

#21284 is a PR to avoid that (get it to work similar to this after your change, only there it needs to do CMD batch acrobatics).

Comment thread configure Outdated
write('config.gypi', do_not_edit +
pprint.pformat(output, indent=2) + '\n')

write('config.status', '#!/bin/sh\nset -ex\n./configure ' +

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

nit: How about exec ./configure …? This should allow getting rid of the set -e.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Done!

Comment thread configure Outdated
pprint.pformat(output, indent=2) + '\n')

write('config.status', '#!/bin/sh\nset -ex\n./configure ' +
' '.join([shell_quote(arg) for arg in original_argv]) + '\n')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Use pipes.quote(arg) for this (officially deprecated but shlex.quote doesn't exist in python 2.7.)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Done!

Comment thread Makefile
config.gypi: configure
$(error Missing or stale $@, please run ./$<)
@if [ -x config.status ]; then \
./config.status; \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

shouldn't this be dependant on ls -R *.gyp?

Ideally, yes, but can be done in a separate PR.

Copy link
Copy Markdown
Member Author

addaleax added the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Jun 25, 2018
jasnell pushed a commit that referenced this pull request Jun 29, 2018
Instead of requiring `./configure` to be run again after
the file changed, first try to re-run the configure script
with the arguments with which it was originally run.

Usually, those arguments will either contain no flags,
or all flags that were passed are still supported.

PR-URL: #21371
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>

jasnell commented Jun 29, 2018

Copy link
Copy Markdown
Member

Landed in 074e7f8

jasnell closed this Jun 29, 2018
targos pushed a commit that referenced this pull request Jun 30, 2018
Instead of requiring `./configure` to be run again after
the file changed, first try to re-run the configure script
with the arguments with which it was originally run.

Usually, those arguments will either contain no flags,
or all flags that were passed are still supported.

PR-URL: #21371
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
targos mentioned this pull request Jul 3, 2018
nodejs-github-bot pushed a commit that referenced this pull request Jun 12, 2025
PR-URL: #58603
Refs: #21371
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
targos pushed a commit that referenced this pull request Jun 16, 2025
PR-URL: #58603
Refs: #21371
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
aduh95 pushed a commit that referenced this pull request Jul 21, 2025
PR-URL: #58603
Refs: #21371
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
aduh95 pushed a commit that referenced this pull request Jul 24, 2025
PR-URL: #58603
Refs: #21371
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. build Issues and PRs related to build files or the CI.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants


Back | FazBrowse Home | New Git URL