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

Boost.Build needs to upstream a mingw-w64 patch for Boost.URL #95

Open
StephanTLavavej opened this issue Jan 7, 2024 · 6 comments
Open

Comments

@StephanTLavavej
Copy link
Owner

The msys2/MINGW-packages project has a patch: https://github.com/msys2/MINGW-packages/blob/ca4e304acefff6f0e145a14c6419d3fd78bcfa2e/mingw-w64-boost/0012-allow-longer-path-on-mingw-w64.patch @AndrewSav brought this to my attention in #90 (comment) and explained:

Without [this patch] libboost_url compiling fails because ar tries to use a response file, due to long command line, and backslashes in the response file come out wrong way so the compilation fails.

This should be upstreamed to Boost.Build, which will allow it to handle Boost.URL on mingw-w64. The patch's content looks reasonable to me - it discards the pre-XP codepaths (Boost.Build really doesn't need to worry about someone attempting to build Boost on such incredibly ancient systems), then it allows toolsets targeting Windows (as this is execnt.cpp) that aren't imitating MSVC (i.e. that aren't defining _MSC_VER) to use longer command lines. This seems like a reasonable heuristic to distinguish "mingw-w64 via MSYS2" from "MSVC via cmd".

Alternatively, something in Boost.Build could be fixed to properly handle backslashes when using response files on MSYS2.

Alternatively, Boost.URL could be changed to avoid constructing such horrifically long command lines (in 1.84.0, it is the only Boost library to be affected by this problem).

@AndrewSav
Copy link

Alternatively, Boost.URL could be changed to avoid constructing such horrifically long command lines

I think, this cannot be avoided really. It's just a list of object modules to link, and it has most of them...

@StephanTLavavej
Copy link
Owner Author

Perhaps - but somehow, every other Boost library hasn't triggered this problem.

@AndrewSav
Copy link

That's because of the it has most of them... part I believe. Others did not need this structure, but url for whatever reasons did. There is nothing inherently bad in structuring your source code over many files, if it's more convenient.

@StephanTLavavej
Copy link
Owner Author

I suppose that's fair, so Boost.Build should be fixed - either the command-line length hack, or a true fix to avoid backslash escaping.

StephanTLavavej added a commit that referenced this issue Jan 14, 2024
boost-fix-raw_maxline.patch works around #95.
@pdimov
Copy link

pdimov commented Jan 16, 2024

This is boostorg/url#779 and bfgroup/b2#352, which is fixed with bfgroup/b2@2474be5.

@StephanTLavavej
Copy link
Owner Author

Thank you!! 😻

adriankentsato pushed a commit to adriankentsato/mingw-distro that referenced this issue Dec 9, 2024
boost-fix-raw_maxline.patch works around StephanTLavavej#95.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants