| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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.
| config.gypi: configure | ||
| $(error Missing or stale $@, please run ./$<) | ||
| @if [ -x config.status ]; then \ | ||
| ./config.status; \ |
There was a problem hiding this comment.
I'd rather have:
$(PYTHON) configure $(something that reads .configure_args as args)So it will be easier to implement for Windows
Sorry, something went wrong.
There was a problem hiding this comment.
btw shouldn't this be dependant on ls -R *.gyp? as well?
Sorry, something went wrong.
There was a problem hiding this comment.
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
Sorry, something went wrong.
There was a problem hiding this comment.
Now I understand why your pattern makes perfect sense for autotools, since it only assumes a POSIX compatible shell...
Sorry, something went wrong.
There was a problem hiding this comment.
Yeah … I heard escaping parameters for cmd is fun :)
Otherwise we should be able to follow the same format here if we like
Sorry, something went wrong.
There was a problem hiding this comment.
shouldn't this be dependant on ls -R *.gyp?
Ideally, yes, but can be done in a separate PR.
Sorry, something went wrong.
|
|
||
| /config.mk | ||
| /config.gypi | ||
| /config.status |
There was a problem hiding this comment.
Suggesting a .configure_args approach, and .* files are ignored by default.
Sorry, something went wrong.
|
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. |
Sorry, something went wrong.
|
@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. |
Sorry, something went wrong.
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 '') |
Sorry, something went wrong.
|
@refack How would this work on Windows? vcbuild.bat runs configure unconditionally anyway, right? |
Sorry, something went wrong.
|
#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). |
Sorry, something went wrong.
| write('config.gypi', do_not_edit + | ||
| pprint.pformat(output, indent=2) + '\n') | ||
|
|
||
| write('config.status', '#!/bin/sh\nset -ex\n./configure ' + |
There was a problem hiding this comment.
nit: How about exec ./configure …? This should allow getting rid of the set -e.
Sorry, something went wrong.
There was a problem hiding this comment.
Done!
Sorry, something went wrong.
| 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') |
There was a problem hiding this comment.
Use pipes.quote(arg) for this (officially deprecated but shlex.quote doesn't exist in python 2.7.)
Sorry, something went wrong.
There was a problem hiding this comment.
Done!
Sorry, something went wrong.
| config.gypi: configure | ||
| $(error Missing or stale $@, please run ./$<) | ||
| @if [ -x config.status ]; then \ | ||
| ./config.status; \ |
There was a problem hiding this comment.
shouldn't this be dependant on ls -R *.gyp?
Ideally, yes, but can be done in a separate PR.
Sorry, something went wrong.
Sorry, something went wrong.
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>
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>
| Back | FazBrowse Home | New Git URL |
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