Skip to content
This repository was archived by the owner on Nov 10, 2023. It is now read-only.

Allow apple_library to be imported as a module #983

Closed
wants to merge 3 commits into from
Closed

Allow apple_library to be imported as a module #983

wants to merge 3 commits into from

Conversation

nguyentruongtho
Copy link
Contributor

@nguyentruongtho nguyentruongtho commented Nov 1, 2016

This PR will enable Swift target to be able to import apple_library. Quite a few things are imported from #842

@facebook-github-bot
Copy link
Contributor

@nguyentruongtho updated the pull request - view changes

@facebook-github-bot
Copy link
Contributor

@ryu2 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@ryu2
Copy link
Contributor

ryu2 commented Nov 1, 2016

java.lang.IllegalArgumentException: resource modulemap.st relative to com.facebook.buck.cxx.HeaderSymlinkTreeWithHeaderMap not found.

@nguyentruongtho This failure seems related, can you check?

@stowy
Copy link

stowy commented Nov 5, 2016

@nguyentruongtho this is great, thanks for doing.

I have tested interop with this here - https://github.com/stowy/buck_swift_test/tree/moduleTests - check the readme.

I have found that swift does not recognize objC files in the module, unless they are specifically included in the modules bridging header.

I have also not been able to have external modules (eg a test module) reference an exported modules swift class from objc.

Are these results expected?

@nguyentruongtho
Copy link
Contributor Author

nguyentruongtho commented Nov 7, 2016

I have found that swift does not recognize objC files in the module, unless they are specifically included in the modules bridging header.

Yes, this is how module works, your headers need to be in exported header (public headers) for other module to use it. We are currently generate umbrella header for all exported headers. In the future, I want to add the ability to use a manually created umbrella header.

I have also not been able to have external modules (eg a test module) reference an exported modules swift class from objc.

This will come in follow on PR.

@facebook-github-bot
Copy link
Contributor

@nguyentruongtho updated the pull request - view changes - changes since last import

@nguyentruongtho
Copy link
Contributor Author

My gos, problem with Windows again.

@stowy
Copy link

stowy commented Nov 7, 2016

Thanks Tho, just to clarify about the reading objC from swift though, I meant that it will not read any objC classes in swift, even if those classes are in exported headers in the generated umbrella header.

They will only be recognized if the headers are included in the objc-swift bridging header of the apple-library, which is unrelated to the module umbrella header.

Good news about the swift-objc interior, thanks.

@facebook-github-bot
Copy link
Contributor

@nguyentruongtho updated the pull request - view changes - changes since last import

@nguyentruongtho
Copy link
Contributor Author

@stowy sure, I'll test your sample project once I get a CI pass for this PR 😄

@stowy
Copy link

stowy commented Nov 7, 2016

No problems. Not a big issue with this PR, but definitely I would like to
address in future PRs.

Good luck with CI 😝
On Mon, Nov 7, 2016 at 9:20 AM Tho Nguyen notifications@github.com wrote:

@stowy https://github.com/stowy sure, I'll test your sample project
once I get a CI pass for this PR 😄


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
#983 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AFpnFDb58ytDxdRF5Zi7EYbvQZH-X9fsks5q7132gaJpZM4KmSB0
.

@ryu2
Copy link
Contributor

ryu2 commented Nov 7, 2016

I'm still getting a failure in CompilationDatabaseIntegrationTest under testCreateCompilationDatabaseForAppleBinaryWithDeps

@nguyentruongtho
Copy link
Contributor Author

@ryu2 you mean facebook internal CI or on your machine? what is the error message and traces? It is passing for me locally and also passed 2 CI checks with Travis & CircleCI. I'm in blind now, could you have a look at it?

@ryu2
Copy link
Contributor

ryu2 commented Nov 8, 2016

@nguyentruongtho On my machine and the internal CI. I'm running Xcode 8.1, how about you? This might have something to do with it.

@ryu2
Copy link
Contributor

ryu2 commented Nov 8, 2016

   [junit] Testsuite: com.facebook.buck.apple.CompilationDatabaseIntegrationTest
    [junit] Tests run: 2, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 3.761 sec
    [junit]
    [junit] Testcase: testCreateCompilationDatabaseForAppleLibraryWithNoDeps took 2.841 sec
    [junit]     FAILED
    [junit]
    [junit] Expected: <[/private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path3195316497910570628/xcode-developer-dir/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang, -fPIC, -fPIC, -isysroot, /private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path3195316497910570628/xcode-developer-dir/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk, -arch, x86_64, '-mios-simulator-version-min=8.0', '-std=gnu11', -Wno-deprecated, -Wno-conversion, -isysroot, /private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path3195316497910570628/xcode-developer-dir/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk, -arch, x86_64, '-mios-simulator-version-min=8.0', -I, buck-out/gen/Libraries/EXExample/EXExample#iphonesimulator-x86_64,private-headers.hmap, -I, buck-out/gen/Libraries/EXExample/EXExample#headers,iphonesimulator-x86_64.hmap, -I, buck-out, -F, /private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path3195316497910570628/xcode-developer-dir/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks, -Xclang, -fdebug-compilation-dir, -Xclang, .///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////, -x, objective-c, -c, -MD, -MF, /private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path3195316497910570628/dep.tmp, Libraries/EXExample/EXExample/EXExampleModel.m, -o, buck-out/gen/Libraries/EXExample/EXExample#compile-pic-EXExampleModel.m.o7063e286,iphonesimulator-x86_64/EXExample/EXExampleModel.m.o]>
    [junit]      but: was <[/private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path3195316497910570628/xcode-developer-dir/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang, -fPIC, -fPIC, -isysroot, /private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path3195316497910570628/xcode-developer-dir/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk, -arch, x86_64, '-mios-simulator-version-min=8.0', '-std=gnu11', -Wno-deprecated, -Wno-conversion, -isysroot, /private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path3195316497910570628/xcode-developer-dir/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk, -arch, x86_64, '-mios-simulator-version-min=8.0', -I, buck-out/gen/Libraries/EXExample/EXExample#iphonesimulator-x86_64,private-headers.hmap, -I, buck-out/gen/Libraries/EXExample/EXExample#headers,iphonesimulator-x86_64.hmap, -I, buck-out, -I, buck-out/gen/Libraries/EXExample/EXExample#headers,iphonesimulator-x86_64, -F, /private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path3195316497910570628/xcode-developer-dir/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks, -Xclang, -fdebug-compilation-dir, -Xclang, .///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////, -x, objective-c, -c, -MD, -MF, /private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path3195316497910570628/dep.tmp, Libraries/EXExample/EXExample/EXExampleModel.m, -o, buck-out/gen/Libraries/EXExample/EXExample#compile-pic-EXExampleModel.m.o7063e286,iphonesimulator-x86_64/EXExample/EXExampleModel.m.o]>
    [junit] junit.framework.AssertionFailedError:
    [junit] Expected: <[/private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path3195316497910570628/xcode-developer-dir/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang, -fPIC, -fPIC, -isysroot, /private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path3195316497910570628/xcode-developer-dir/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk, -arch, x86_64, '-mios-simulator-version-min=8.0', '-std=gnu11', -Wno-deprecated, -Wno-conversion, -isysroot, /private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path3195316497910570628/xcode-developer-dir/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk, -arch, x86_64, '-mios-simulator-version-min=8.0', -I, buck-out/gen/Libraries/EXExample/EXExample#iphonesimulator-x86_64,private-headers.hmap, -I, buck-out/gen/Libraries/EXExample/EXExample#headers,iphonesimulator-x86_64.hmap, -I, buck-out, -F, /private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path3195316497910570628/xcode-developer-dir/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks, -Xclang, -fdebug-compilation-dir, -Xclang, .///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////, -x, objective-c, -c, -MD, -MF, /private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path3195316497910570628/dep.tmp, Libraries/EXExample/EXExample/EXExampleModel.m, -o, buck-out/gen/Libraries/EXExample/EXExample#compile-pic-EXExampleModel.m.o7063e286,iphonesimulator-x86_64/EXExample/EXExampleModel.m.o]>
    [junit]      but: was <[/private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path3195316497910570628/xcode-developer-dir/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang, -fPIC, -fPIC, -isysroot, /private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path3195316497910570628/xcode-developer-dir/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk, -arch, x86_64, '-mios-simulator-version-min=8.0', '-std=gnu11', -Wno-deprecated, -Wno-conversion, -isysroot, /private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path3195316497910570628/xcode-developer-dir/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk, -arch, x86_64, '-mios-simulator-version-min=8.0', -I, buck-out/gen/Libraries/EXExample/EXExample#iphonesimulator-x86_64,private-headers.hmap, -I, buck-out/gen/Libraries/EXExample/EXExample#headers,iphonesimulator-x86_64.hmap, -I, buck-out, -I, buck-out/gen/Libraries/EXExample/EXExample#headers,iphonesimulator-x86_64, -F, /private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path3195316497910570628/xcode-developer-dir/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks, -Xclang, -fdebug-compilation-dir, -Xclang, .///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////, -x, objective-c, -c, -MD, -MF, /private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path3195316497910570628/dep.tmp, Libraries/EXExample/EXExample/EXExampleModel.m, -o, buck-out/gen/Libraries/EXExample/EXExample#compile-pic-EXExampleModel.m.o7063e286,iphonesimulator-x86_64/EXExample/EXExampleModel.m.o]>
    [junit]     at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:18)
    [junit]     at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:6)
    [junit]     at com.facebook.buck.apple.CompilationDatabaseIntegrationTest.assertFlags(CompilationDatabaseIntegrationTest.java:315)
    [junit]     at com.facebook.buck.apple.CompilationDatabaseIntegrationTest.testCreateCompilationDatabaseForAppleLibraryWithNoDeps(CompilationDatabaseIntegrationTest.java:117)
    [junit]
    [junit] Testcase: testCreateCompilationDatabaseForAppleBinaryWithDeps took 0.898 sec
    [junit]     FAILED
    [junit]
    [junit] Expected: <[/private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path5735745041404018234/xcode-developer-dir/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang, -isysroot, /private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path5735745041404018234/xcode-developer-dir/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk, -arch, x86_64, '-mios-simulator-version-min=8.0', '-std=gnu11', -Wno-deprecated, -Wno-conversion, -isysroot, /private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path5735745041404018234/xcode-developer-dir/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk, -arch, x86_64, '-mios-simulator-version-min=8.0', -I, buck-out/gen/Apps/Weather/Weather#iphonesimulator-x86_64,private-headers.hmap, -I, buck-out/gen/Libraries/EXExample/EXExample#headers,iphonesimulator-x86_64.hmap, -I, buck-out, -F, /private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path5735745041404018234/xcode-developer-dir/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks, -Xclang, -fdebug-compilation-dir, -Xclang, .///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////, -x, objective-c, -c, -MD, -MF, /private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path5735745041404018234/dep.tmp, Apps/Weather/Weather/EXViewController.m, -o, buck-out/gen/Apps/Weather/Weather#compile-EXViewController.m.ob61ea5f6,iphonesimulator-x86_64/Weather/EXViewController.m.o]>
    [junit]      but: was <[/private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path5735745041404018234/xcode-developer-dir/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang, -isysroot, /private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path5735745041404018234/xcode-developer-dir/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk, -arch, x86_64, '-mios-simulator-version-min=8.0', '-std=gnu11', -Wno-deprecated, -Wno-conversion, -isysroot, /private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path5735745041404018234/xcode-developer-dir/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk, -arch, x86_64, '-mios-simulator-version-min=8.0', -I, buck-out/gen/Apps/Weather/Weather#iphonesimulator-x86_64,private-headers.hmap, -I, buck-out/gen/Libraries/EXExample/EXExample#headers,iphonesimulator-x86_64.hmap, -I, buck-out, -I, buck-out/gen/Libraries/EXExample/EXExample#headers,iphonesimulator-x86_64, -F, /private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path5735745041404018234/xcode-developer-dir/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks, -Xclang, -fdebug-compilation-dir, -Xclang, .///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////, -x, objective-c, -c, -MD, -MF, /private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path5735745041404018234/dep.tmp, Apps/Weather/Weather/EXViewController.m, -o, buck-out/gen/Apps/Weather/Weather#compile-EXViewController.m.ob61ea5f6,iphonesimulator-x86_64/Weather/EXViewController.m.o]>
    [junit] junit.framework.AssertionFailedError:
    [junit] Expected: <[/private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path5735745041404018234/xcode-developer-dir/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang, -isysroot, /private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path5735745041404018234/xcode-developer-dir/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk, -arch, x86_64, '-mios-simulator-version-min=8.0', '-std=gnu11', -Wno-deprecated, -Wno-conversion, -isysroot, /private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path5735745041404018234/xcode-developer-dir/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk, -arch, x86_64, '-mios-simulator-version-min=8.0', -I, buck-out/gen/Apps/Weather/Weather#iphonesimulator-x86_64,private-headers.hmap, -I, buck-out/gen/Libraries/EXExample/EXExample#headers,iphonesimulator-x86_64.hmap, -I, buck-out, -F, /private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path5735745041404018234/xcode-developer-dir/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks, -Xclang, -fdebug-compilation-dir, -Xclang, .///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////, -x, objective-c, -c, -MD, -MF, /private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path5735745041404018234/dep.tmp, Apps/Weather/Weather/EXViewController.m, -o, buck-out/gen/Apps/Weather/Weather#compile-EXViewController.m.ob61ea5f6,iphonesimulator-x86_64/Weather/EXViewController.m.o]>
    [junit]      but: was <[/private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path5735745041404018234/xcode-developer-dir/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang, -isysroot, /private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path5735745041404018234/xcode-developer-dir/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk, -arch, x86_64, '-mios-simulator-version-min=8.0', '-std=gnu11', -Wno-deprecated, -Wno-conversion, -isysroot, /private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path5735745041404018234/xcode-developer-dir/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk, -arch, x86_64, '-mios-simulator-version-min=8.0', -I, buck-out/gen/Apps/Weather/Weather#iphonesimulator-x86_64,private-headers.hmap, -I, buck-out/gen/Libraries/EXExample/EXExample#headers,iphonesimulator-x86_64.hmap, -I, buck-out, -I, buck-out/gen/Libraries/EXExample/EXExample#headers,iphonesimulator-x86_64, -F, /private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path5735745041404018234/xcode-developer-dir/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks, -Xclang, -fdebug-compilation-dir, -Xclang, .///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////, -x, objective-c, -c, -MD, -MF, /private/var/folders/79/r8x23p3x5z962kr42g6qfnt0x713m8/T/junit-temp-path5735745041404018234/dep.tmp, Apps/Weather/Weather/EXViewController.m, -o, buck-out/gen/Apps/Weather/Weather#compile-EXViewController.m.ob61ea5f6,iphonesimulator-x86_64/Weather/EXViewController.m.o]>
    [junit]     at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:18)
    [junit]     at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:6)
    [junit]     at com.facebook.buck.apple.CompilationDatabaseIntegrationTest.assertFlags(CompilationDatabaseIntegrationTest.java:315)
    [junit]     at com.facebook.buck.apple.CompilationDatabaseIntegrationTest.testCreateCompilationDatabaseForAppleBinaryWithDeps(CompilationDatabaseIntegrationTest.java:204)
    [junit]

BUILD FAILED
/Users/markwang/devtools/buck/build.xml:612: Test com.facebook.buck.apple.CompilationDatabaseIntegrationTest failed

@nguyentruongtho
Copy link
Contributor Author

ok, we are having issue with 8.1 internally, so we can't upgrade to use it yet. I'll download it later once I get to my office today. Still, it'd be helpful to know the error message that you are getting.

@facebook-github-bot
Copy link
Contributor

@nguyentruongtho updated the pull request - view changes - changes since last import

@ryu2
Copy link
Contributor

ryu2 commented Nov 11, 2016

@facebook-github-bot shipit

facebook-github-bot pushed a commit that referenced this pull request Nov 11, 2016
Summary:
This reverts #911, with some minor fixes after merging.

The reason is here: #983 (comment)

/cc ryu2
Closes #1007

Reviewed By: ryu2

fbshipit-source-id: 98e69f5
Copy link
Contributor

@ryu2 ryu2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there -- please address the cross-cell issue.

@nguyentruongtho
Copy link
Contributor Author

any output that I can see, /cc @mzlee if you find a reproduceable steps.

@ryu2
Copy link
Contributor

ryu2 commented Nov 15, 2016

https://gist.github.com/ryu2/4727f513a5064244ef2711f4656c27e5

has the stack trace. It basically can't find a boost header accumulators.hpp which is a cross-cell target.

The issue is that perf_test_hg.py renames the repo directory temporarily, which invalidates all symlinks in header trees. Before, this test was still passing, presumably because we were using header maps for boost. For some reason this diff breaks this.

@ryu2
Copy link
Contributor

ryu2 commented Nov 15, 2016

It's an internal app, but you can try to repro it as follows with whatever app you have (not sure of the exact conditions yet needed for this error to occur):

From your repo dir (e.g. repo)

rm -rf buck-out
buck build -v 3 --config cache.mode=dir --config cache.dir=/tmp/buck-cache --deep <target>

Rename repo to something else, e.g. _repo

Then from _repo

buck clean
buck build -v 3 --config cache.mode=dir --config cache.dir=/tmp/buck-cache --deep <target>

@facebook-github-bot
Copy link
Contributor

@nguyentruongtho updated the pull request - view changes - changes since last import

Tho Nguyen added 2 commits November 18, 2016 12:48
@facebook-github-bot
Copy link
Contributor

@nguyentruongtho updated the pull request - view changes - changes since last import

@facebook-github-bot
Copy link
Contributor

@nguyentruongtho updated the pull request - view changes - changes since last import

@nguyentruongtho
Copy link
Contributor Author

Just updated with some architecture changes for creating module map, the bug caught by your internal CI has not yet been addressed.

daedric added a commit to daedric/buck that referenced this pull request Feb 10, 2017
daedric added a commit to daedric/buck that referenced this pull request Feb 19, 2017
facebook-github-bot pushed a commit that referenced this pull request Mar 13, 2017
Summary:
Split out from #983 in effort of supporting clang module.

We create `buck.modulemap` instead of `module.modulemap` for all public header symlink trees with header map. Those module maps will enable us to import a target as module later on.

The reason for this special module map naming is that, if module is enabled for a project (`-fmodules`), all `module.modulemap` files in that project's search paths will be pre-compiled and imported implicitly (see https://clang.llvm.org/docs/Modules.html, search for `-fimplicit-module-maps`), which leads to nondeterministic compilation results if we don't handle module cache carefully.
Instead of looking into how to handle module cache, we will name module map that created by buck `buck.modulemap`, so that it will not be used implicitly, and will explicitly specified them via [`-fmodule-map-file`](https://clang.llvm.org/docs/Modules.html) in compile commands when needed.
Closes #1238

Reviewed By: ryu2

fbshipit-source-id: ae6a02f
@ryu2
Copy link
Contributor

ryu2 commented Mar 14, 2017

Will be broken up into smaller PRs.

@ryu2 ryu2 closed this Mar 14, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants