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

mingw: delete support for legacy mingw.org toolchain #11625

Closed
wants to merge 15 commits into from

Conversation

vszakats
Copy link
Member

@vszakats vszakats commented Aug 8, 2023

Drop support for "old" / "legacy" / "classic" / "v1" / "mingw32" MinGW:
https://en.wikipedia.org/wiki/MinGW, https://osdn.net/projects/mingw/
Its homepage used to be http://mingw.org/ [no HTTPS], and broken now.
It supported the x86 CPU only and used a old Windows API header and
implib set, often causing issues. It also misses most modern Windows
features, offering old versions of both binutils and gcc (no llvm/clang
support). It was last updated 2 years ago.

curl now relies on toolchains based on the mingw-w64 project:
https://www.mingw-w64.org/ https://sourceforge.net/projects/mingw-w64/
https://www.msys2.org/ https://github.com/msys2/msys2
https://github.com/mstorsjo/llvm-mingw
(Also available via Linux and macOS package managers.)

Closes #11625

@github-actions github-actions bot added the CI Continuous Integration label Aug 8, 2023
@vszakats
Copy link
Member Author

vszakats commented Aug 8, 2023

I may have missed some bits, feel free to update, or report.

Also, I'm uncertain if we announced this for 8.3.0 (released in September), or after 8.3.0. If the latter, feel free to flag it "next-feature-window".

@vszakats vszakats added build Windows Windows-specific labels Aug 8, 2023
@vszakats vszakats changed the title mingw: delete support for old/classic/legacy toolchain version mingw: delete support for old/classic/legacy toolchain edition Aug 8, 2023
@vszakats vszakats changed the title mingw: delete support for old/classic/legacy toolchain edition mingw: delete support for old/classic/legacy toolchain version Aug 8, 2023
@bagder
Copy link
Member

bagder commented Aug 8, 2023

The checks for __MINGW32__ that we have in the code, is that define set by any other versions than mingw v1? If so, we could remove all those.

The predef details seems to suggest that's only set by v1?

@bagder bagder added the feature-window A merge of this requires an open feature window label Aug 8, 2023
@bagder
Copy link
Member

bagder commented Aug 8, 2023

I think we have said we will remove this in September, so it misses the August feature window.

@vszakats
Copy link
Member Author

vszakats commented Aug 8, 2023

__MINGW32__ should cover both old and new mingws, and mingw-w64 definitely keeps defining it. We also use __MINGW64_VERSION_MAJOR when we specifically look for mingw-w64, vs. the old one. Now that we don't have the old one, I think we are safe to fall back to __MINGW32__ for these cases.

Either way, good idea to check these. I'll review them.

@vszakats
Copy link
Member Author

vszakats commented Aug 8, 2023

This KNOWN_BUG might need a re-evaluation: #3125

@vszakats vszakats changed the title mingw: delete support for old/classic/legacy toolchain version mingw: delete support for legacy mingw.org toolchain Aug 9, 2023
@vszakats vszakats force-pushed the del-old-mingw branch 2 times, most recently from 139414a to 5bac934 Compare August 10, 2023 15:27
@jay
Copy link
Member

jay commented Aug 10, 2023

note __MINGW64_VERSION_MAJOR is not a compiler predefine, it is defined by _mingw.h so if we have to evaluate it in the future then we'll need that include

@vszakats
Copy link
Member Author

I'm aware. This patch deletes all uses of __MINGW64_VERSION_MAJOR. We can reinstate _mingw.h once we need to check for a specific mingw-w64 version. This is fairly rarely needed in my experience. We might also leave it there to mark its position and disable it with #if 0, but I'd avoid including headers we don't actually use.

@jay
Copy link
Member

jay commented Aug 11, 2023

I just landed #10056 which has a legacy mingw workaround so when you rebase on master you'll want to remove these lines:
889c071#diff-ee813638cd7ec84110df50039b34c74fab8c79ef2b916858fdb6f19f5121a6abR63-R97

@vszakats vszakats force-pushed the del-old-mingw branch 2 times, most recently from 1b7f309 to b7a50f6 Compare August 11, 2023 19:42
@vszakats
Copy link
Member Author

Thanks @jay, it's done now.

@vszakats
Copy link
Member Author

vszakats commented Aug 15, 2023

I deleted a list of compatibility constants, that were not marked "old mingw"-specific in the source.

Part of them had this information in the commit message of 3d3a3f9. With the rest I took a chance and assumed that if those constants were already defined by mingw-w64 1.0 (2011-09-26), they were also present in the official SDK released with supported MSVC versions (2010 and later).

curl also seems to support Pelles C. I have no idea about what's available there and CI doesn't test it. AFAIR Pelles C used to have fairly decent Windows headers. Tried to download it but even binaries are only offered via cleartext HTTP and even that was a 404. The compiler feels abandoned. We can restore any necessary compatibility macro as we go.

Also, there may be more compatibility macros that were added for old-mingw, but not marked as such.

We might also exclude such updates from this PR if this feels risky.

@vszakats vszakats force-pushed the del-old-mingw branch 2 times, most recently from a00680b to 20940b1 Compare August 21, 2023 21:11
vszakats added a commit to vszakats/curl that referenced this pull request Aug 31, 2023
Drop support for "old" / "legacy" / "classic" MinGW or "mingw32":
https://en.wikipedia.org/wiki/MinGW, https://osdn.net/projects/mingw/
Its homepage used to be http://mingw.org/ [no HTTPS], and broken now.
It supported the x86 CPU only and used a old Windows API header and
implib set, often causing issues. It also misses most modern Windows
features, offering old versions of both binutils and gcc (no
llvm/clang support). It was last updated 2 years ago.

curl now relies on toolchains based on the mingw-w64 project:

https://www.mingw-w64.org/  https://sourceforge.net/projects/mingw-w64/
https://www.msys2.org/  https://github.com/msys2/msys2
https://github.com/mstorsjo/llvm-mingw

Also available via Linux and macOS package managers.

Closes curl#11625
@vszakats vszakats removed the feature-window A merge of this requires an open feature window label Sep 21, 2023
Drop support for "old" / "legacy" / "classic" MinGW or "mingw32":
https://en.wikipedia.org/wiki/MinGW, https://osdn.net/projects/mingw/
Its homepage used to be http://mingw.org/ [no HTTPS], and broken now.
It supported the x86 CPU only and used a old Windows API header and
implib set, often causing issues. It also misses most modern Windows
features, offering old versions of both binutils and gcc (no
llvm/clang support). It was last updated 2 years ago.

curl now relies on toolchains based on the mingw-w64 project:

https://www.mingw-w64.org/  https://sourceforge.net/projects/mingw-w64/
https://www.msys2.org/  https://github.com/msys2/msys2
https://github.com/mstorsjo/llvm-mingw

Also available via Linux and macOS package managers.

Closes curl#11625
We now require mingw-w64, so `__MINGW64_VERSION_MAJOR` is always defined
when `__MINGW32__` is defined. Update conditions to use the shorter,
simpler macro. Then delete always-true conditions and delete code guarded
by always-false conditions.
The comment and PR history doesn't tell more or mention
mingw version, so take a chance on this and assume it
affected old mingw.

My fresh copy of mingw-w64 does have an `ARRAYSIZE()`
macro defined by Windows headers.

Originally added in 8beff43 curl#8419
instead of adding `const` to the cast, drop the cast altogther as the
type is already a `const` and `unsigned char` and `BYTE` are equivalent.
@vszakats vszakats added curl-8.4 feature-window A merge of this requires an open feature window and removed curl-8.4 labels Sep 22, 2023
Copy link
Member

@bagder bagder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge! 😁

@vszakats vszakats closed this in 3802910 Sep 23, 2023
@vszakats vszakats deleted the del-old-mingw branch September 23, 2023 09:14
ptitSeb pushed a commit to wasix-org/curl that referenced this pull request Sep 25, 2023
Drop support for "old" / "legacy" / "classic" / "v1" / "mingw32" MinGW:
  https://en.wikipedia.org/wiki/MinGW, https://osdn.net/projects/mingw/
Its homepage used to be http://mingw.org/ [no HTTPS], and broken now.
It supported the x86 CPU only and used a old Windows API header and
implib set, often causing issues. It also misses most modern Windows
features, offering old versions of both binutils and gcc (no llvm/clang
support). It was last updated 2 years ago.

curl now relies on toolchains based on the mingw-w64 project:
https://www.mingw-w64.org/  https://sourceforge.net/projects/mingw-w64/
https://www.msys2.org/  https://github.com/msys2/msys2
https://github.com/mstorsjo/llvm-mingw
(Also available via Linux and macOS package managers.)

Closes curl#11625
vszakats added a commit to vszakats/curl that referenced this pull request Oct 27, 2023
In 8.4.0 we deleted `_mingw.h` as part of purging old-mingw support.
Turns out `_mingw.h` had the side-effect of setting a default
`_WIN32_WINNT` value expected by `lib/config-win32.h` to enable
`getaddinfo` support in `Makefile.mk` mingw-w64 builds. This caused
disabling support for this unless specifying the value manually.

Restore this header and update its comment to tell why we continue
to need it.

Regression from 3802910 curl#11625

Reported-by: zhengqwe on github
Helped-by: Nico Rieck
Fixes curl#12134
Fixes curl#12136
Closes #xxxxx
vszakats added a commit that referenced this pull request Oct 28, 2023
In 8.4.0 we deleted `_mingw.h` as part of purging old-mingw support.
Turns out `_mingw.h` had the side-effect of setting a default
`_WIN32_WINNT` value expected by `lib/config-win32.h` to enable
`getaddrinfo` support in `Makefile.mk` mingw-w64 builds. This caused
disabling support for this unless specifying the value manually.

Restore this header and update its comment to tell why we continue
to need it.

This triggered a regression in official Windows curl builds starting
with 8.4.0_1. Fixed in 8.4.0_6. (8.5.0 will be using CMake.)

Regression from 3802910 #11625

Reported-by: zhengqwe on github
Helped-by: Nico Rieck
Fixes #12134
Fixes #12136
Closes #12217
vszakats added a commit to vszakats/curl that referenced this pull request Dec 13, 2023
mingw-w64 1.0 comes with w32api v3.12, thus doesn't need this.

Follow-up to 3802910 curl#11625

Closes #xxxxx
vszakats added a commit that referenced this pull request Dec 13, 2023
mingw-w64 1.0 comes with w32api v3.12, thus doesn't need this.

Follow-up to 3802910 #11625

Reviewed-by: Jay Satiro
Closes #12510
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build CI Continuous Integration feature-window A merge of this requires an open feature window tests Windows Windows-specific
Development

Successfully merging this pull request may close these issues.

None yet

3 participants