-
Notifications
You must be signed in to change notification settings - Fork 260
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
Standalone toolchain batch scripts broken on Windows #616
Comments
Sounds like something worth fixing for r17. |
I suggest replacing AFAICT, when I run a batch file using the PATH, I did see something odd in the bug report, though -- the PATH setting uses quotes:
(Maybe the reporter isn't actually using quotes, just like they're not literally using a C:\path\to\standalone directory.) In cmd syntax, these quotes actually end up in the PATH variable, and they could break some programs. For example, they break
|
I think the problem here is that |
So I corrected the quotes in my path:
And I still get this:
|
If you could get Boost to leave off the quotes around clang++, I think it would work. e.g. Change this:
to:
It does seem like something we should fix. |
I'm honestly not sure where in the bjam system of boost those quotes are inserted. It's an incredibly complex build system. It might be something that bjam.exe is doing, worst case. I don't think it's something I could easily test, unless you have an idea for me. |
I left a message on the boost dev mailing list and I got this response:
So per his recommendation, I removed the quotes and now it builds fine. Honestly I'm not sure what the solution is here. Would it be possible for the NDK team to work with the Boost developers to come to an agreement on a solution here? |
I think we can fix this problem in the standalone toolchain's batch file wrappers. |
I believe your mistake is modifying %PATH%. Boost has a cleaner way to specify where your compiler is located, see http://www.boost.org/build/tutorial.html#best_practices. You can create a
and so on |
This is not better, just different. I don't want to do it this way.
…On Sun, Jan 14, 2018, 2:07 PM Alex Cohn ***@***.***> wrote:
I believe your mistake is modifying %PATH%. Boost has a cleaner way to
specify where your compiler is located, see
http://www.boost.org/build/tutorial.html#best_practices.
You can create a user-config.jam file in your %HOME% directory, where you
can write
using clang++ : arm : <root>C:/path/to/standalone/bin
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#616 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABr6dgpqXVsT0oplUPXZlkXpKhxOWe5Yks5tKl59gaJpZM4RbdOh>
.
|
This is a general problem with CMD. I found two other projects that hit the problem:
It's not clear to me that either issue was fixed. AFACT, the The This syntax can be used with FOR loop variables and also with arguments ( CMD needs to break For example, suppose @echo [%~d0] [%~p0] [%~n0] [%~x0] These work:
With the exception of the last command, CMD tends to choke on an
CMD has another special behavior with
@echo off
call :fix
exit /b
:fix
echo [%0] [%~d0] [%~p0] [%~n0] [%~x0]
exit /b It always prints, I'm not sure this behavior is documented anywhere, and it doesn't work with Wine CMD. Wine CMD already does the right thing without the workaround, but always fails (i.e. prints the current working directory) with the workaround. It's probably OK to break Wine CMD. (Maybe it's easy to keep it working, though, by checking the |
Working with Windows at the cost of breaking with Wine sounds like the right trade-off to me. |
Yeah, it'll be easy to fix if we want to later. |
Fixed here: https://android-review.googlesource.com/c/platform/ndk/+/589724. The fix should be in r17. |
I filed a Wine bug: https://bugs.winehq.org/show_bug.cgi?id=44369. |
It will allow the batch files to be executed using quotes and found using the PATH: "clang" "clang.cmd" "clang".cmd "<triple>-clang" Regarding the local/temp variable: * I'm hoping the _ prefix makes the variable unique. * setlocal ensures that the batch file won't affect the caller's environment. * `set "_BIN_DIR="` prevents the variable from being inherited in the clang subprocess. The quotes are necessary because `set _BIN_DIR= && ...` would set _BIN_DIR to a single space. Bug: android/ndk#616 Test: manual Test: python.exe run_tests.py --rebuild ... Change-Id: Iff37183de269931b96a6a8842578dd50d366ae31
So I'm trying to build boost using a standalone toolchain. I created the standalone toolchain from NDK r16b and then invoked my boost build like so:
At some point, boost starts compiling and invokes clang like so:
This causes a failure because
%0
inC:\path\to\standalone\bin\clang++.cmd
resolves to"clang++"
for some reason. To make sure, I added a log statement inclang++.cmd
:And I got this as output:
Because the path to
%0
is incorrect,%~dp0
ends up resolving the path toclang50++.exe
asE:\code\_external\boost_1_66_0\\clang50++.exe
. Note thatE:\code\_external\boost_1_66_0\
happens to be my working directory, same thing you'd get from%CD%
. Not sure what Windows is doing here.The text was updated successfully, but these errors were encountered: