Skip to content
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

Add reporting of build platform #866

Merged
merged 1 commit into from
Sep 1, 2016
Merged

Add reporting of build platform #866

merged 1 commit into from
Sep 1, 2016

Conversation

landstander668
Copy link

@dscho This is my attempt to add build platform information to the output of git version --build-options for Issue #846. For now it only understands x86 and x86_64, but I plan to extend the process to include other platforms as well (so that this hopefully won't end up being a Git for Windows specific item).

At present all of the 32-bit variants are collapsed into x86, which made sense to me at the time but may or may not be the most desirable approach. For example:

$ uname -m
i686

$ git version --build-options
git version 2.9.3.windows.2.826.gd486be9
sizeof-long: 4
machine: x86

@dscho
Copy link
Member

dscho commented Aug 31, 2016

Nice! Could you Sign-off on the patch, please?

@landstander668
Copy link
Author

@dscho I thought about that just after submitting the PR, but wasn't too concerned since this will almost certainly need to be rebased and force-pushed at least once before it's ready for formal inclusion. :) I'll re-push with signoff later today, and try to not to skip that step even for the interim patches going forward.

@dscho
Copy link
Member

dscho commented Aug 31, 2016

Well, I'd be comfortable merging it. Upstream Git is due this Friday, so... ;-)

Add preliminary support for detection of the build plaform, and reporting
of same with the `git version --build-options' command. This can be useful
for bug reporting, to distinguish between 32 and 64-bit builds for
example.

The current implementation can only distinguish between x86 and x86_64.
This will be extended in future patches. In addition, all 32-bit variants
(i686, i586, etc.) are collapsed into `x86'. An example of the output is:

   $ git version --build-options
   git version 2.9.3.windows.2.826.g06c0f2f
   sizeof-long: 4
   machine: x86_64

The label of `machine' was chosen so the new information will approximate
the output of `uname -m'.

Signed-off-by: Adric Norris <[email protected]>
@landstander668 landstander668 changed the title [WIP] Add reporting of build platform Add reporting of build platform Aug 31, 2016
@landstander668
Copy link
Author

@dscho In that case, you're quite welcome to it. :) I've just re-pushed the branch with sign-off included (no code changes were made).

I'll followup with support for other platforms either via another pull request, or directly with upstream Git if that's more appropriate. Mainly I just need to find a list of the various GCC platform-specific defines, so I can determine how to identify the beasties.

@dscho dscho merged commit f289a5b into git-for-windows:master Sep 1, 2016
@dscho
Copy link
Member

dscho commented Sep 1, 2016

Thanks!

As to GCC defines, I guess it would be safer to add $(uname_M) to the CFLAGS in config.mak.uname...

dscho added a commit to git-for-windows/build-extra that referenced this pull request Sep 1, 2016
`git version --build-options` now [also reports the
architecture](git-for-windows/git#866).

Signed-off-by: Johannes Schindelin <[email protected]>
@landstander668
Copy link
Author

@dscho Wouldn't that give inaccurate results in the case of cross-compiling to a different target platform? That's the main reason I was using the built-in platform defines, although I certainly could have been missing something.

@landstander668
Copy link
Author

On the plus side, I think I've found a pretty comprehensive list of the GCC platform defines here. Should be able to run with that, unless updating CFLAGS (per your previous reply) is deemed to be clearly superior.

@dscho
Copy link
Member

dscho commented Sep 2, 2016

Wouldn't that give inaccurate results in the case of cross-compiling to a different target platform?

I should have made myself clearer, sorry. I was wondering whether we could not introduce a CFLAG, say, -DBUILD_ARCHITECTURE="$(BUILD_ARCHITECTURE)" that would be passed from the Makefile. If not set explicitly, e.g. via config.mak or via the command-line, it would be set to $(uname_M), falling back to (unknown) via ifeq (,$(uname_M)).

@landstander668
Copy link
Author

@dscho Ah, now I'm with you. I'll go ahead and start looking into that... we can always revert the existing implementation if it works out better.

dscho added a commit that referenced this pull request Sep 3, 2016
dscho added a commit that referenced this pull request Sep 6, 2016
dscho added a commit that referenced this pull request Sep 6, 2016
dscho added a commit that referenced this pull request Sep 10, 2016
dscho added a commit that referenced this pull request Sep 12, 2016
dscho pushed a commit that referenced this pull request Sep 13, 2016
Add reporting of build platform
dscho added a commit that referenced this pull request Sep 16, 2016
dscho added a commit that referenced this pull request Sep 20, 2016
dscho added a commit that referenced this pull request Sep 21, 2016
git-for-windows-ci pushed a commit that referenced this pull request Sep 20, 2017
Add reporting of build platform
dscho added a commit that referenced this pull request Sep 20, 2017
git-for-windows-ci pushed a commit that referenced this pull request Sep 21, 2017
Add reporting of build platform
git-for-windows-ci pushed a commit that referenced this pull request Sep 21, 2017
Add reporting of build platform
git-for-windows-ci pushed a commit that referenced this pull request Sep 26, 2017
Add reporting of build platform
git-for-windows-ci pushed a commit that referenced this pull request Sep 26, 2017
Add reporting of build platform
dscho added a commit that referenced this pull request Sep 26, 2017
dscho added a commit that referenced this pull request Oct 17, 2017
dscho added a commit that referenced this pull request Oct 19, 2017
dscho added a commit that referenced this pull request Oct 19, 2017
dscho added a commit that referenced this pull request Oct 19, 2017
dscho added a commit that referenced this pull request Oct 19, 2017
dscho added a commit that referenced this pull request Oct 19, 2017
git-for-windows-ci pushed a commit that referenced this pull request Oct 20, 2017
Add reporting of build platform
git-for-windows-ci pushed a commit that referenced this pull request Oct 20, 2017
Add reporting of build platform
git-for-windows-ci pushed a commit that referenced this pull request Oct 20, 2017
Add reporting of build platform
dscho added a commit that referenced this pull request Oct 20, 2017
git-for-windows-ci pushed a commit that referenced this pull request Oct 21, 2017
Add reporting of build platform
dscho added a commit that referenced this pull request Oct 23, 2017
git-for-windows-ci pushed a commit that referenced this pull request Oct 24, 2017
Add reporting of build platform
dscho added a commit that referenced this pull request Oct 30, 2017
dscho added a commit that referenced this pull request Nov 1, 2017
dscho added a commit that referenced this pull request Nov 6, 2017
git-for-windows-ci pushed a commit that referenced this pull request Nov 7, 2017
Add reporting of build platform
dscho added a commit that referenced this pull request Nov 29, 2017
git-for-windows-ci pushed a commit that referenced this pull request Dec 6, 2017
Add reporting of build platform
dscho added a commit that referenced this pull request Jan 2, 2018
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.

2 participants