-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[lldb] Support tests with nested make invocations on Windows 1/2 #112342
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
[lldb] Support tests with nested make invocations on Windows 1/2 #112342
Conversation
@llvm/pr-subscribers-lldb Author: Stefan Gränitz (weliveindetail) ChangesIn recent PR #111531 for Windows support, we enabled tests that require the Full diff: https://github.com/llvm/llvm-project/pull/112342.diff 1 Files Affected:
diff --git a/lldb/test/API/functionalities/completion/Makefile b/lldb/test/API/functionalities/completion/Makefile
index f46742243bd96d..e457693f62ca44 100644
--- a/lldb/test/API/functionalities/completion/Makefile
+++ b/lldb/test/API/functionalities/completion/Makefile
@@ -4,7 +4,7 @@ USE_LIBDL := 1
a.out: lib_shared
lib_shared:
- $(MAKE) -f $(MAKEFILE_RULES) \
+ "$(MAKE)" -f $(MAKEFILE_RULES) \
DYLIB_ONLY=YES DYLIB_CXX_SOURCES=shared.cpp DYLIB_NAME=shared
include Makefile.rules
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems ok to me.
I checked our bot and make
is in a path without spaces, that's why we didn't see this problem there.
Thanks for the quick feedback! Yes, the buildbot in https://lab.llvm.org/buildbot/#/builders/141 isn't affected. Debug output (in swiftlang lldb) is:
Some more context:
|
If this approach is accepted, I'd like to roll it out to 32 more affected tests (upstream). I listed them here: https://gist.github.com/weliveindetail/9a3cfcfc698f8814f5924ead7ba68bf3 I only tested this on Windows so far, but I expect it be fine on all other platforms. Should we merge only this single instance and see if the bots play well before I roll it out? Or can I add all the others as well immediately? What do you think? |
Being cautious costs nothing so I'd land one then come back with the rest if it works out. |
The alternatives:
|
Yes, agree I think that both symlinking and Makefile templating make things worse, because they get even more complicated. We shortly discussed the dotest escape approach in #111531 (comment), but back then I couldn't reproduce the issue. Would be fine for me, but it seems less obvious why this is necessary for make and not for the other paths that we deal with in dotest. |
See what @labath says since they commented there too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
For better or worse, I can reproduce the same behavior on linux when I put make in a path with spaces.
@slydiman has recently proposed (and I pushed back) overriding some variables (including $(MAKE)
) to include the quotes. I like this better (despite some drawbacks) as we're not overriding a predefined variable, and is in line with the recommendation in https://stackoverflow.com/questions/23330243/gnu-makefile-how-to-and-when-to-quote-strings
Great, thanks. I will give this a try and if |
…m#112342) In recent PR llvm#111531 for Windows support, we enabled tests that require the `make` tool. On Windows, default install directories likely contain spaces, in this case e.g. `C:\Program Files (x86)\GnuWin32\bin\make.exe`. It's typically handled well by CMake, so that today invocations from `dotest.py` don't cause issues. However, we also have nested invocations from a number of Makefiles themselves. These still failed if the path to the `make` tool contains spaces. This patch attempts to fix the functionalities/completion test by adding quotes in the respective Makefile. If it keeps passing on the bots, we can roll out the fix to all affected tests.
…m#112342) In recent PR llvm#111531 for Windows support, we enabled tests that require the `make` tool. On Windows, default install directories likely contain spaces, in this case e.g. `C:\Program Files (x86)\GnuWin32\bin\make.exe`. It's typically handled well by CMake, so that today invocations from `dotest.py` don't cause issues. However, we also have nested invocations from a number of Makefiles themselves. These still failed if the path to the `make` tool contains spaces. This patch attempts to fix the functionalities/completion test by adding quotes in the respective Makefile. If it keeps passing on the bots, we can roll out the fix to all affected tests.
…m#112360) Following up from llvm#112342, we roll out the fix and quote nested `make` invocations in all API tests.
…m#112342) In recent PR llvm#111531 for Windows support, we enabled tests that require the `make` tool. On Windows, default install directories likely contain spaces, in this case e.g. `C:\Program Files (x86)\GnuWin32\bin\make.exe`. It's typically handled well by CMake, so that today invocations from `dotest.py` don't cause issues. However, we also have nested invocations from a number of Makefiles themselves. These still failed if the path to the `make` tool contains spaces. This patch attempts to fix the functionalities/completion test by adding quotes in the respective Makefile. If it keeps passing on the bots, we can roll out the fix to all affected tests.
…m#112360) Following up from llvm#112342, we roll out the fix and quote nested `make` invocations in all API tests.
…m#112342) In recent PR llvm#111531 for Windows support, we enabled tests that require the `make` tool. On Windows, default install directories likely contain spaces, in this case e.g. `C:\Program Files (x86)\GnuWin32\bin\make.exe`. It's typically handled well by CMake, so that today invocations from `dotest.py` don't cause issues. However, we also have nested invocations from a number of Makefiles themselves. These still failed if the path to the `make` tool contains spaces. This patch attempts to fix the functionalities/completion test by adding quotes in the respective Makefile. If it keeps passing on the bots, we can roll out the fix to all affected tests.
…m#112360) Following up from llvm#112342, we roll out the fix and quote nested `make` invocations in all API tests.
…m#112342) In recent PR llvm#111531 for Windows support, we enabled tests that require the `make` tool. On Windows, default install directories likely contain spaces, in this case e.g. `C:\Program Files (x86)\GnuWin32\bin\make.exe`. It's typically handled well by CMake, so that today invocations from `dotest.py` don't cause issues. However, we also have nested invocations from a number of Makefiles themselves. These still failed if the path to the `make` tool contains spaces. This patch attempts to fix the functionalities/completion test by adding quotes in the respective Makefile. If it keeps passing on the bots, we can roll out the fix to all affected tests.
…m#112360) Following up from llvm#112342, we roll out the fix and quote nested `make` invocations in all API tests.
In recent PR #111531 for Windows support, we enabled tests that require the
make
tool. On Windows default install directories likely contain spaces, in this case e.g.C:\Program Files (x86)\GnuWin32\bin\make.exe
. It's typically handled well by CMake, so that today invocations fromdotest.py
don't cause issues. However, we also have nested invocations from a number of Makefiles themselves. These still fail if the path to themake
tool contains spaces.