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: Fix build with patch from Liu Hao #3164

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

CohenArthur
Copy link
Member

@CohenArthur CohenArthur commented Sep 16, 2024

This commit adds Liu Hao's patch from
https://github.com/lhmouse/MINGW-packages/blob/5859d27b2b6101204a08ad9702cb2937f8797be9/mingw-w64-gcc/0100-rust-fix.patch

gcc/rust/ChangeLog:

* checks/errors/borrowck/rust-borrow-checker.cc (mkdir_wrapped): Remove.
(BorrowChecker::go): Use `mkdir` instead.
* expand/rust-proc-macro.cc (register_callback): Use Windows APIs to
open dynamic proc macro library.
(load_macros_array): Likewise.
* parse/rust-parse.cc (defined): Replace separators in paths using
std::replace.

This adds the patch from lhmouse/MINGW-packages@16dad6b but reworked for our new changes.

@lhmouse could you check it looks okay and builds on your side?

Sidenote, this might not build on Linux either - I don't have access to my build machine atm so I'm using the CI to test this patch.

@CohenArthur CohenArthur force-pushed the fix-windows-build branch 3 times, most recently from 2358403 to 51fea9c Compare September 16, 2024 13:28
This commit adds Liu Hao's patch from
https://github.com/lhmouse/MINGW-packages/blob/5859d27b2b6101204a08ad9702cb2937f8797be9/mingw-w64-gcc/0100-rust-fix.patch

gcc/rust/ChangeLog:

	* checks/errors/borrowck/rust-borrow-checker.cc (mkdir_wrapped): Remove.
	(BorrowChecker::go): Use `mkdir` instead.
	* expand/rust-proc-macro.cc (register_callback): Use Windows APIs to
	open dynamic proc macro library.
	(load_macros_array): Likewise.
	* parse/rust-parse.cc (defined): Replace separators in paths using
	std::replace.
@P-E-P P-E-P self-requested a review September 17, 2024 09:53
@lhmouse
Copy link
Contributor

lhmouse commented Sep 17, 2024

You may just take the patch and assume it builds. The patch is also available in MSYS2 (https://github.com/msys2/MINGW-packages/blob/e9b8bb22e94a577fd94ac1ded8519778a02499a5/mingw-w64-gcc/2001-fix-building-rust-on-mingw-w64.patch).

@P-E-P P-E-P added this pull request to the merge queue Sep 23, 2024
Merged via the queue into Rust-GCC:master with commit b282387 Sep 23, 2024
11 of 12 checks passed
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.

3 participants