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

Always generate commit ID component of version as big endian #638

Merged
merged 4 commits into from
Aug 8, 2021
Merged

Conversation

AArnott
Copy link
Collaborator

@AArnott AArnott commented Aug 8, 2021

Fixes #637

This because the test class focuses only on libgit2.
… endian

This fixes a non-deterministic version computation that varied based on endianness of the processor. Most computers use little-endian, which produced a decimal version that when converted back to hex with a typical calculator would have the first two commit ID bytes in swapped positions.
Now with this change, we "fix" the endianness. We choose big endian since it won't swap the first two bytes like little endian did.

But this presents another problem: all the generated versions now have a different value for the 4th integer component, and `nbgv get-commits` will no longer match a commit when it built using the little-endian version of NB.GV. I'll fix this in a subsequent commit so that this CLI tool will match on commits allowing the order to be swapped.

Fixes #637
@AArnott AArnott added this to the v3.5 milestone Aug 8, 2021
@AArnott AArnott enabled auto-merge August 8, 2021 02:35
@AArnott AArnott merged commit ce56a06 into master Aug 8, 2021
@AArnott AArnott deleted the fix637 branch August 8, 2021 03:10
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.

Inconsistent file version generation between big and little endian CPU architectures
1 participant