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

feat: compiling using msys2 and mingw #1279

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Kreijstal
Copy link

@Kreijstal Kreijstal commented Jan 8, 2025

Yes, it's not as pretty as msvc, but it's open source tooling :/. I think this satisfies the immediate need, and if there are further changes I think they might be patchable.

Adding compatibility to use windmc.

@dgreatwood This is what I can muster up to. I know it's not pretty, but this is of course a short term solution. If there are big changes in the manifest, you can ping me and I'll try to adapt it, it should be less work. But here you can cross-compile from linux, that ain't bad right? LMK what you think.

I could also hook up a CI for msys2 compilation if desired.
fixes #1276

@Kreijstal
Copy link
Author

I'll try to fix CI.

@Kreijstal Kreijstal marked this pull request as draft January 8, 2025 20:55
Yes, it's not as pretty as msvc, but it's open source tooling :/. I
think this satisfies the immediate need, and if there are further
changes I think they might be patchable.

docs: Add Apache 2.0 license headers to winlog source files
@Kreijstal Kreijstal marked this pull request as ready for review January 8, 2025 21:08
@dgreatwood
Copy link
Collaborator

Hi @Kreijstal -

Firstly, thanks so much for this effort! If I may so, I think it is quite promising.

May I try and describe your strategy? Please correct me if I have misunderstood:

  1. You have produced pist_winlog.mc, which is an ".mc" version of pist_winlog.man. I guess you did this manually? Or if you used a tool, what did you use - is it something we could automate?
  2. In pist_winlog_impl.cc, you create explicit functions (e.g. EventWritePSTCH_DEBUG_NL_AssumeEnabled) which in the mc.exe case are macros in the generated header file pist_winlog.h. Again, I presume you did this more or less by hand, but again LMK if you used a tool.

Initial questions:

  1. Don't we need a header file that corresponds to pist_winlog_impl.cc, let's say pist_winlog_impl.h? Or could we make it a pure header file, pist_winlog_impl.h, inlining all the functions since they're all simple I think?
  2. And wouldn't pist_winlog_impl.h need to be included in pist_syslog.cc instead of pist_winlog.h (which mc.exe generates) in the non-mc.exe case? I believe pist_winlog.h should not be in the build if mc.exe is not used.

More generally:

  1. The script winscripts/gccsetup.ps1 will always find mc.exe and place it on the path, so perhaps we can add a "--nomcexe" option for gccsetup?
  2. We could add tests to meson.build so an error is produced if pist_winlog.man is newer than pist_winlog.mc or pist_winlog_impl.h/.cc. WDYT?

Thanks again!

@Kreijstal
Copy link
Author

Hi @Kreijstal -

Firstly, thanks so much for this effort! If I may so, I think it is quite promising.

May I try and describe your strategy? Please correct me if I have misunderstood:

  1. You have produced pist_winlog.mc, which is an ".mc" version of pist_winlog.man. I guess you did this manually? Or if you used a tool, what did you use - is it something we could automate?
  2. In pist_winlog_impl.cc, you create explicit functions (e.g. EventWritePSTCH_DEBUG_NL_AssumeEnabled) which in the mc.exe case are macros in the generated header file pist_winlog.h. Again, I presume you did this more or less by hand, but again LMK if you used a tool.

Initial questions:

  1. Don't we need a header file that corresponds to pist_winlog_impl.cc, let's say pist_winlog_impl.h? Or could we make it a pure header file, pist_winlog_impl.h, inlining all the functions since they're all simple I think?
  2. And wouldn't pist_winlog_impl.h need to be included in pist_syslog.cc instead of pist_winlog.h (which mc.exe generates) in the non-mc.exe case? I believe pist_winlog.h should not be in the build if mc.exe is not used.

More generally:

  1. The script winscripts/gccsetup.ps1 will always find mc.exe and place it on the path, so perhaps we can add a "--nomcexe" option for gccsetup?
  2. We could add tests to meson.build so an error is produced if pist_winlog.man is newer than pist_winlog.mc or pist_winlog_impl.h/.cc. WDYT?

Thanks again!

It was kind of manual, was it macros? I guess we can convert those to macros...too, what is the script gccsetup for? If you have mc.exe you should just use that no?

There is no tool that did this work automatically, but it is reasonable to think one could be written... This would aid mimgw operability! With other projects that use manifests as well! So I really like the idea, this was however something more short term..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mc.exe could be windmc.exe
3 participants