Skip to content

Avoid overwriting config.h with generated header #84

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

Merged
merged 1 commit into from
Jun 18, 2016

Conversation

dgrove-oss
Copy link
Contributor

config.h is generated by the autotools build process.
Having it stored in git causes useless diffs and the
need for git checkout operations when rebasing because
the generated version differs from the version in git.

@dgrove-oss
Copy link
Contributor Author

If this doesn't cause problems with the XCode build, it would be nice to not have config.h in git. If it does cause a problem, it is ok to just reject this pull request.

It is just a minor annoyance (that I hit 10 times this morning when changing branches, rebasing, etc...).

@MadCoder
Copy link
Contributor

MadCoder commented Jun 16, 2016

the problem is that it will cause issues with the xcode based internal port at Apple, but we may be able to carry with that file removed from the git repository (IOW not backport this to Darwin).

@das is that ok with you? (if yes please merge)

@das
Copy link
Contributor

das commented Jun 16, 2016

as long as we have the Xcode project in the repo, we should also keep the config.h so that you can build on Darwin with Xcode. If we were to remove the config.h we should also remove the project and its associated xcconfig files etc (as it would be broken anyway)

FWIW I've always kept this as part of the opensource drop to document how we build libdispatch on Darwin (and enable others to potentially replicate that), so I'm not a fan such a removal.

IIRC there is a way to ask autoheader to use a different filename than config.h, ISTM that would be a better way to solve this (and use __has_include() to switch between config.h and that header).

We could also rename the config.h used by the Xcode build (but that name has history associated at this point)

@das das assigned dgrove-oss and unassigned das and dgrove-oss Jun 16, 2016
@MadCoder
Copy link
Contributor

yeah I was assuming that you would say something like that and do that trick.

the other way is also to play with include paths and have the ./configure generated one shadow the config/config.h one

@dgrove-oss can you try to play tricks in that direction instead please?

@MadCoder
Copy link
Contributor

by "that direction" I mean either using include paths based hiding or using a __has_header() kind of thing which is probably cleaner.

@dgrove-oss
Copy link
Contributor Author

sure. I'll take a look tomorrow.

Change name of generated header file to config_ac.h
and use __has_include to prefer the generated file if
it is present.  Avoids stomping on the config.h used by
XCode when building using autotools.
@dgrove-oss dgrove-oss force-pushed the gitignore_config.h branch from 237742d to 3d22f52 Compare June 17, 2016 15:43
@dgrove-oss
Copy link
Contributor Author

Thanks for the alternate suggestion; changing the name of the generated file and using has_include was very easy. Pull request updated.

@dgrove-oss dgrove-oss changed the title Remove generated file config/config.h from git Avoid overwriting config.h with generated header Jun 17, 2016
@MadCoder MadCoder merged commit 9f1e778 into swiftlang:master Jun 18, 2016
@dgrove-oss dgrove-oss deleted the gitignore_config.h branch June 18, 2016 11:51
das pushed a commit that referenced this pull request Aug 11, 2016
Avoid overwriting config.h with generated header

Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants