Skip to content

Conversation

compnerd
Copy link
Member

When configuring libdispatch as part of the swift build on Linux with SourceKit
enabled, we would default to a release build. However, that results in known
leaks being reported with LSAN when building with a debug standard library.
Pass along the LIBDISPATCH_BUILD_TYPE into the CMake build and map that to the
CMAKE_BUILD_TYPE for the project.

Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.

Resolves SR-NNNN.

@compnerd
Copy link
Member Author

@gottesmm @aschwaighofer - this might be an expedient way to get that mapped in via the build configuration

@gottesmm
Copy link
Contributor

@shahmishal is it possible to run the LSAN job via a PR?

@aschwaighofer
Copy link
Contributor

I just ran the LSAN bot configuration locally with this PR and

diff --git a/utils/build-presets.ini b/utils/build-presets.ini
index a5d34d0..3c0366e 100644
--- a/utils/build-presets.ini
+++ b/utils/build-presets.ini
@@ -961,6 +961,7 @@ release-debuginfo
 assertions
 enable-lsan
 debug-swift-stdlib
+debug-libdispatch
 
 dash-dash

It ran without errors.

@aschwaighofer
Copy link
Contributor

@swift-ci Please test

@shahmishal
Copy link
Member

@gottesmm You can use test with preset for LSAN testing.

@gottesmm
Copy link
Contributor

@shahmishal Thanks.

@gottesmm
Copy link
Contributor

@shahmishal That doesn't exist for Linux. Only for macOS.

@shahmishal
Copy link
Member

@gottesmm I will add the support for it in the future.

@gottesmm
Copy link
Contributor

I talked with Arnold/Compnerd. The change from Arnold's diff (the one posted in this PR) is needed to fix this. Compnerd is going to add that to the patch.

@gottesmm
Copy link
Contributor

When configuring libdispatch as part of the swift build on Linux with SourceKit
enabled, we would default to a release build.  However, that results in known
leaks being reported with LSAN when building with a debug standard library.
Pass along the `LIBDISPATCH_BUILD_TYPE` into the CMake build and map that to the
CMAKE_BUILD_TYPE for the project.
@compnerd
Copy link
Member Author

@swift-ci please test and merge

@gottesmm gottesmm self-assigned this Aug 22, 2018
@compnerd
Copy link
Member Author

@swift-ci please test and merge

@swift-ci swift-ci merged commit c22bd9b into swiftlang:master Aug 22, 2018
@compnerd compnerd deleted the libdispatch-type branch August 28, 2018 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants