Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

bpo-45723: Add helpers for save/restore env (GH-29637)#29637

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
tiran merged 6 commits intopython:mainfromerlend-aasland:ac-save-env
Nov 22, 2021

Conversation

erlend-aasland
Copy link
Contributor

@erlend-aaslanderlend-aasland commentedNov 19, 2021
edited by bedevere-bot
Loading

tiran reacted with eyes emoji
@erlend-aasland
Copy link
ContributorAuthor

@tiran: there might be a smoother way to do this, but this should do the trick.

@erlend-aasland
Copy link
ContributorAuthor

Another option is to patch the built-in macros, but I prefer this explicit approach.

@erlend-aasland
Copy link
ContributorAuthor

Possible improvement: minimise futureconfigure diffs further, for improved review experience.

Proposed patch
diff --git a/configure.ac b/configure.acindex 02463ae717..90507e206b 100644--- a/configure.ac+++ b/configure.ac@@ -32,21 +32,21 @@ dnl - WITH_SAVE_ENV([SCRIPT])  Runs SCRIPT wrapped with SAVE_ENV/RESTORE_ENV AC_DEFUN([_SAVE_VAR], [AS_VAR_COPY([save_][$1], [$1])])dnl AC_DEFUN([_RESTORE_VAR], [AS_VAR_COPY([$1], [save_][$1])])dnl AC_DEFUN([SAVE_ENV],-  [_SAVE_VAR([CFLAGS])]-  [_SAVE_VAR([CPPFLAGS])]-  [_SAVE_VAR([LDFLAGS])]-  [_SAVE_VAR([LIBS])]+[_SAVE_VAR([CFLAGS])]+[_SAVE_VAR([CPPFLAGS])]+[_SAVE_VAR([LDFLAGS])]+[_SAVE_VAR([LIBS])] )dnl AC_DEFUN([RESTORE_ENV],-  [_RESTORE_VAR([CFLAGS])]-  [_RESTORE_VAR([CPPFLAGS])]-  [_RESTORE_VAR([LDFLAGS])]-  [_RESTORE_VAR([LIBS])]+[_RESTORE_VAR([CFLAGS])]+[_RESTORE_VAR([CPPFLAGS])]+[_RESTORE_VAR([LDFLAGS])]+[_RESTORE_VAR([LIBS])] )dnl AC_DEFUN([WITH_SAVE_ENV],-  [SAVE_ENV]-  [$1]-  [RESTORE_ENV]+[SAVE_ENV]+m4_strip([$1])+[RESTORE_ENV] )dnl  AC_SUBST(BASECPPFLAGS)

configure.ac Outdated
Comment on lines 35 to 38
[_SAVE_VAR([CFLAGS])]
[_SAVE_VAR([CPPFLAGS])]
[_SAVE_VAR([LDFLAGS])]
[_SAVE_VAR([LIBS])]
Copy link
Member

Choose a reason for hiding this comment

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

It looks like the indention adds some extra space to the output:

save_CFLAGS=$CFLAGS  save_CPPFLAGS=$CPPFLAGS  save_LDFLAGS=$LDFLAGS  save_LIBS=$LIBS

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Yeah. We can tweak the new macros to further minimise configure diffs. I think that could be worth it, as it would be easier to review future PRs.

tiran reacted with thumbs up emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Does it look better withdcc2ba9 applied?

Copy link
Member

@tirantiran left a comment

Choose a reason for hiding this comment

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

Excellent!

erlend-aasland reacted with hooray emoji
@tirantiran changed the titlebpo-45723: Add helpers for save/restore envbpo-45723: Add helpers for save/restore env (GH-29637)Nov 22, 2021
@tirantiran merged commitdb2277a intopython:mainNov 22, 2021
@erlend-aaslanderlend-aasland deleted the ac-save-env branchNovember 22, 2021 08:17
remykarem pushed a commit to remykarem/cpython that referenced this pull requestDec 7, 2021
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@tirantirantiran approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@erlend-aasland@tiran@the-knights-who-say-ni@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp