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

Moved git state from version.dd to version.m2 #3404

Merged
merged 4 commits into from
Aug 14, 2024

Conversation

mahrud
Copy link
Member

@mahrud mahrud commented Aug 12, 2024

Finally closes #3250, which has been such a pain ...

The main difficulty was rearranging startup.m2 to:

  1. set prefixDirectory
  2. set currentLayout
  3. and based on those find the Core directory where version.m2 lives

all before the version is printed.

If version.m2 is not found, for whatever reason, we get:

Macaulay2, version 1.24.05-bin (version.m2 not found)

The "-bin" indicates that this is the version stored in the binary only.

@mahrud mahrud requested a review from d-torrance August 12, 2024 01:39
@mahrud mahrud linked an issue Aug 12, 2024 that may be closed by this pull request
@mahrud
Copy link
Member Author

mahrud commented Aug 12, 2024

I hope the last commit fixed the autotools issue, but if it didn't work, @d-torrance do you mind looking into what's missing?

They're now autoconf substitution variables that are included in a
generated .m2 file rather than #define's intended for version.dd.
@d-torrance
Copy link
Member

Figured it out! We need to use AC_SUBST instead of AC_DEFINE now.

@mahrud
Copy link
Member Author

mahrud commented Aug 12, 2024

Apparently neither cmake nor autotools have been detecting the git description and branch correctly on development when building on GitHub. I don't know where this started, but on autotools we've just been getting:

configure: configuring Macaulay2 version 1.24.05
...
configure: with  GIT_DESCRIPTION   = release-1.24.05
configure: with  GIT_BRANCH        = 

And on cmake:

     M2 version        = 1.24.05
     Git description   = 
     Git branch        = 

@mahrud
Copy link
Member Author

mahrud commented Aug 12, 2024

It seems like it's because github uses a shallow checkout, which doesn't pull tags. This makes sense and I don't necessarily think we should change it (though for future reference, here is how one would change it: https://github.com/actions/checkout#fetch-all-history-for-all-tags-and-branches)

@d-torrance d-torrance merged commit 7875547 into Macaulay2:development Aug 14, 2024
5 checks passed
@mahrud mahrud deleted the quickfix/version branch August 14, 2024 17:28
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.

version-tmp.cc recompiles after every commit
2 participants