Skip to content

Commit 3d577cd

Browse files
committed
Split debug - publish debug info
- Publish debug info - Add a linker flag to ensure build ID is added (even on musl)
1 parent 98d0a12 commit 3d577cd

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

ddprof-lib/build.gradle

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,12 @@ def setupDebugExtraction(config, linkTask) {
165165
// Create an extra folder for the debug symbols
166166
copyTask.dependsOn copyDebugTask
167167
}
168+
169+
// Wire up the debug info JAR to depend on debug files being copied
170+
def debugInfoJarTask = tasks.findByName("debugInfoJar")
171+
if (debugInfoJarTask != null) {
172+
debugInfoJarTask.dependsOn copyDebugTask
173+
}
168174
}
169175
}
170176

@@ -598,6 +604,15 @@ tasks.register('javadocJar', Jar) {
598604
from javadoc.destinationDir
599605
}
600606

607+
tasks.register('debugInfoJar', Jar) {
608+
archiveBaseName = libraryName
609+
archiveClassifier = 'debugInfo'
610+
archiveVersion = component_version
611+
from files(libraryTargetBase('release-debug')) {
612+
include "**/*"
613+
}
614+
}
615+
601616
tasks.register('scanBuild', Exec) {
602617
workingDir "${projectDir}/src/test/make"
603618
commandLine 'scan-build'
@@ -667,6 +682,7 @@ publishing {
667682
}
668683
publication.artifact sourcesJar
669684
publication.artifact javadocJar
685+
publication.artifact debugInfoJar
670686

671687
publication.groupId = 'com.datadoghq'
672688
publication.artifactId = 'ddprof'

gradle/configurations.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def commonLinuxCompilerArgs = [
119119
"-DCOUNTERS"
120120
]
121121

122-
def commonLinuxLinkerArgs = ["-ldl", "-Wl,-z,defs", "--verbose", "-lpthread", "-lm", "-lrt", "-v"]
122+
def commonLinuxLinkerArgs = ["-ldl", "-Wl,-z,defs", "--verbose", "-lpthread", "-lm", "-lrt", "-v", "-Wl,--build-id"]
123123

124124
def commonMacosCompilerArgs = commonLinuxCompilerArgs + ["-D_XOPEN_SOURCE", "-D_DARWIN_C_SOURCE"]
125125

0 commit comments

Comments
 (0)