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

Weird intermittent compilation error related to _pgmptr #5016

Closed
1 task done
glandium opened this issue Jun 20, 2024 · 10 comments · Fixed by #5017
Closed
1 task done

Weird intermittent compilation error related to _pgmptr #5016

glandium opened this issue Jun 20, 2024 · 10 comments · Fixed by #5017

Comments

@glandium
Copy link

  • I was not able to find an open or closed issue matching what I'm seeing

I'm building parts of git-for-windows as part of git-cinnabar and am currently getting the following error intermittently:

    In file included from D:/a/git-cinnabar/git-cinnabar/src/mingw.c:11:
    D:/a/git-cinnabar/git-cinnabar/git-core/compat/mingw.c: In function 'open_in_gdb':
    D:/a/git-cinnabar/git-cinnabar/git-core/compat/mingw.c:35:9: error: function declaration isn't a prototype [-Werror=strict-prototypes]
       35 |         extern char *_pgmptr;
          |         ^~~~~~
    In file included from C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/14.1.0/include/mm_malloc.h:27,
                     from C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/14.1.0/include/xmmintrin.h:34,
                     from C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/14.1.0/include/immintrin.h:31,
                     from C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/14.1.0/include/x86intrin.h:32,
                     from C:/msys64/mingw64/include/winnt.h:1658,
                     from C:/msys64/mingw64/include/minwindef.h:163,
                     from C:/msys64/mingw64/include/windef.h:9,
                     from C:/msys64/mingw64/include/windows.h:69,
                     from C:/msys64/mingw64/include/winsock2.h:23,
                     from D:/a/git-cinnabar/git-cinnabar/git-core/git-compat-util.h:215,
                     from D:/a/git-cinnabar/git-cinnabar/git-core/compat/mingw.c:1:
    D:/a/git-cinnabar/git-cinnabar/git-core/compat/mingw.c:35:22: error: '__p__pgmptr' redeclared without dllimport attribute: previous dllimport ignored [-Werror=attributes]
       35 |         extern char *_pgmptr;
          |                      ^~~~~~~
    cc1.exe: all warnings being treated as errors
    make: *** [D:\a\git-cinnabar\git-cinnabar\src\build.mk:143: mingw.o] Error 1
    make: *** Waiting for unfinished jobs....

The intermittence may or may not come from github actions caching, but the error is plain weird.

This is using a fresh-ish msys2 environment, and I suspect something changed recently in some of the mingw headers that causes problems with _pgmptr.

On the other hand, it doesn't even seem to be used at all? So I'm wondering what it's doing there in the first place?

@dscho
Copy link
Member

dscho commented Jun 20, 2024

I opened a PR at gitgitgadget#1752 but did not hear back about it on the Git mailing list. @glandium would you be willing to test the patch and if it works as intended, provide feedback for the patch on the Git mailing list?

@glandium
Copy link
Author

Done. I should have checked the mailing list.

I'm still baffled this is not happening consistently for me... in fact, I disabled github actions cache, and... it reliably doesn't happen in that case.

@dscho
Copy link
Member

dscho commented Jun 20, 2024

in fact, I disabled github actions cache, and... it reliably doesn't happen in that case.

The reason for that might be that the GitHub Action git-for-windows/setup-git-for-windows-sdk (in default mode) searches for the latest successful run of the ci-artifacts workflow and uses the corresponding revision of the git-sdk-64. You will notice that the latest run failed with the precise error message you reported.

The same logic is not true when using a different mode, e.g. full or build-installers. This may explain your observation.

@glandium
Copy link
Author

I'm not using the git-sdk, I'm using my own copy of msys2.

@dscho
Copy link
Member

dscho commented Jun 21, 2024

I'm using my own copy of msys2.

Right, that would trigger the compile error.

@glandium
Copy link
Author

glandium commented Jun 21, 2024

Sure, but I would expect it to happen reliably. Now that I think about it, the discrepancy might have been coming from https://github.com/msys2/setup-msys2?tab=readme-ov-file#cache. I hadn't thought about /that/ cache.

Copy link
Member

dscho commented Jun 21, 2024

Ah, that sounds highly plausible.

dscho added a commit that referenced this issue Jun 21, 2024
git-for-windows-ci pushed a commit that referenced this issue Jun 21, 2024
git-for-windows-ci pushed a commit that referenced this issue Jun 21, 2024
git-for-windows-ci pushed a commit that referenced this issue Jun 21, 2024
git-for-windows-ci pushed a commit that referenced this issue Jun 21, 2024
@dscho
Copy link
Member

dscho commented Jun 21, 2024

@glandium can you please verify that after merging #5017 it now works?

@glandium
Copy link
Author

I had applied the patch locally already and haven't had an error since.

@dscho
Copy link
Member

dscho commented Jun 21, 2024

I had applied the patch locally already and haven't had an error since.

Excellent, let's close this issue, then.

@dscho dscho closed this as completed Jun 21, 2024
@dscho dscho linked a pull request Jun 21, 2024 that will close this issue
git-for-windows-ci pushed a commit that referenced this issue Jun 22, 2024
git-for-windows-ci pushed a commit that referenced this issue Jun 22, 2024
git-for-windows-ci pushed a commit that referenced this issue Jun 23, 2024
git-for-windows-ci pushed a commit that referenced this issue Jun 25, 2024
git-for-windows-ci pushed a commit that referenced this issue Jun 25, 2024
git-for-windows-ci pushed a commit that referenced this issue Jun 25, 2024
git-for-windows-ci pushed a commit that referenced this issue Jun 25, 2024
git-for-windows-ci pushed a commit that referenced this issue Jun 26, 2024
git-for-windows-ci pushed a commit that referenced this issue Jun 26, 2024
git-for-windows-ci pushed a commit that referenced this issue Jun 26, 2024
git-for-windows-ci pushed a commit that referenced this issue Jun 26, 2024
git-for-windows-ci pushed a commit that referenced this issue Jun 27, 2024
git-for-windows-ci pushed a commit that referenced this issue Jun 27, 2024
git-for-windows-ci pushed a commit that referenced this issue Jun 27, 2024
git-for-windows-ci pushed a commit that referenced this issue Jun 29, 2024
git-for-windows-ci pushed a commit that referenced this issue Jun 29, 2024
git-for-windows-ci pushed a commit that referenced this issue Jul 2, 2024
git-for-windows-ci pushed a commit that referenced this issue Jul 2, 2024
git-for-windows-ci pushed a commit that referenced this issue Jul 2, 2024
dscho added a commit that referenced this issue Jul 2, 2024
git-for-windows-ci pushed a commit that referenced this issue Jul 4, 2024
git-for-windows-ci pushed a commit that referenced this issue Jul 4, 2024
git-for-windows-ci pushed a commit that referenced this issue Jul 10, 2024
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 a pull request may close this issue.

2 participants