This is an archive of the discontinued LLVM Phabricator instance.

Fix darwin-debug build in cmake (OS X)
ClosedPublic

Authored by ki.stfu on Jan 21 2015, 10:53 AM.

Details

Summary

Fix build of darwin-debug in cmake on OS X. Currently it works in XCode.

This patch fixes test_launch_in_terminal test which doesn't work in OS X since the moment as it was added in r225284. The test fails because Target::Launch returns the following error: "the 'darwin-debug' executable doesn't exists at '/Users/IliaK/p/llvm/build_ninja/lib/python2.7/site-packages/lldb/darwin-debug'".

Log:
======================================================================
FAIL: test_launch_in_terminal (TestTerminal.LaunchInTerminalTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/IliaK/p/llvm/tools/lldb/test/functionalities/tty/TestTerminal.py", line 36, in test_launch_in_terminal
    self.assertTrue(error.Success(), "Make sure launch happened successfully in a terminal window")
AssertionError: False is not True : Make sure launch happened successfully in a terminal window
Config=x86_64-clang

For more information see following thread: http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20150119/014983.html

Diff Detail

Event Timeline

ki.stfu updated this revision to Diff 18536.Jan 21 2015, 10:53 AM
ki.stfu retitled this revision from to Fix darwin-debug build in cmake (OS X).
ki.stfu updated this object.
ki.stfu edited the test plan for this revision. (Show Details)
ki.stfu added a subscriber: Unknown Object (MLST).
zturner added inline comments.
scripts/Python/finishSwigPythonLLDB.py
342

Thanks for adding this to the Python script. Did you test the CMake build with both the shell script codepath and the python codepath? (e.g. by trying both values for LLDB_DEFAULT_ENABLE_PYTHON_SCRIPTS_SWIG_API_GENERATION)?

tools/darwin-debug/CMakeLists.txt
2

Should the executable be called darwin-debug instead of lldb-launcher?

ki.stfu added inline comments.Jan 21 2015, 4:32 PM
scripts/Python/finishSwigPythonLLDB.py
342

No. Only python codepath. I can't test it with shell script codepath. "export LLDB_DEFAULT_ENABLE_PYTHON_SCRIPTS_SWIG_API_GENERATION=0" didn't help

tools/darwin-debug/CMakeLists.txt
2

I don't mind. I took it from lldb.xcodeproj/project.pbxproj:

26579F67126A25920007C5CB /* darwin-debug */ = {
    isa = PBXNativeTarget;
    buildConfigurationList = 26579F6D126A25BF0007C5CB /* Build configuration list for PBXNativeTarget "darwin-debug" */;
    buildPhases = (
        26579F65126A25920007C5CB /* Sources */,
        26579F66126A25920007C5CB /* Frameworks */,
    );
    buildRules = (
    );
    dependencies = (
    );
    name = "darwin-debug";
    productName = "lldb-launcher";
    productReference = 26579F68126A25920007C5CB /* darwin-debug */;
    productType = "com.apple.product-type.tool";
};
ki.stfu updated this revision to Diff 18567.Jan 21 2015, 4:34 PM

Fix symlink source in finishSwigPythonLLDB.py

zturner accepted this revision.Jan 21 2015, 4:42 PM
zturner added a reviewer: zturner.

LGTM

tools/darwin-debug/CMakeLists.txt
2

Ahh, probably best to match the xcode project then.

This revision is now accepted and ready to land.Jan 21 2015, 4:42 PM
clayborg accepted this revision.Jan 21 2015, 5:11 PM
clayborg added a reviewer: clayborg.
clayborg added a subscriber: clayborg.

looks good.

ki.stfu updated this revision to Diff 18601.Jan 22 2015, 4:23 AM
ki.stfu edited edge metadata.

Update scripts/Python/finish-swig-Python-LLDB.sh:

  1. Fix syntax error
  2. Create symlink only on Darwin

Can anybody test that these changes don't affect to Linux and Windows:

  1. Check that build_dir/bin/lldb-launcher doesn't exist
  2. Check that build_dir/lib/python2.7/site-packages/lldb/darwin-debug doesn't exist

And test that these files are created when building by CMake using shell script codepath? Unfortunately I don't know how I can check it because LLDB_DEFAULT_ENABLE_PYTHON_SCRIPTS_SWIG_API_GENERATION didn't help me.

I can check windows later today. As for the CMake variable, I think I told
you the wrong name. Try this variable instead:

-DLLDB_ENABLE_PYTHON_SCRIPTS_SWIG_API_GENERATION=0

That should force it to use the shell script on MacOSX.

I can check windows later today. As for the CMake variable, I think I told
you the wrong name. Try this variable instead:

-DLLDB_ENABLE_PYTHON_SCRIPTS_SWIG_API_GENERATION=0

That should force it to use the shell script on MacOSX.

Yes, the both codepaths work on MacOSX. Can you commit this patch?

Yes, but please remind me on Monday so I don't forget.

Hello,

Can you commit this patch?

Thanks,
Ilia

This revision was automatically updated to reflect the committed changes.