Skip to content
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

(maint) Add option in agent builds to enable debug sym #323

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions configs/components/boost.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
execute = "./"
addtl_flags = ""
gpp = "#{settings[:tools_root]}/bin/g++"
b2flags = ""
b2flags = []
link_option = settings[:boost_link_option]
b2location = "#{settings[:prefix]}/bin/b2"
bjamlocation = "#{settings[:prefix]}/bin/bjam"
Expand All @@ -60,9 +60,9 @@
elsif platform.is_solaris?
pkg.environment 'PATH', '/opt/pl-build-tools/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/ccs/bin:/usr/sfw/bin:/usr/csw/bin'
linkflags = "-Wl,-rpath=#{settings[:libdir]},-L/opt/pl-build-tools/#{settings[:platform_triple]}/lib,-L/usr/lib"
b2flags = "define=_XOPEN_SOURCE=600"
b2flags << "define=_XOPEN_SOURCE=600"
if platform.architecture == "sparc"
b2flags = "#{b2flags} instruction-set=v9"
b2flags << "instruction-set=v9"
end
gpp = "/opt/pl-build-tools/bin/#{settings[:platform_triple]}-g++"
elsif platform.is_windows?
Expand All @@ -87,10 +87,7 @@
# We want it to be Vista/Server 2008
#
# Set layout to system to avoid nasty version numbers and arches in filenames
b2flags = "address-model=#{arch} \
define=WINVER=0x0600 \
define=_WIN32_WINNT=0x0600 \
--layout=system"
b2flags += ["address-model=#{arch}", 'define=WINVER=0x0600', 'define=_WIN32_WINNT=0x0600', '--layout=system']

# We don't have iconv available on windows yet
install_only_flags = "boost.locale.iconv=off"
Expand All @@ -117,6 +114,12 @@
end
end

if settings[:debug_symbols]
b2flags += ['debug-symbols=on', 'variant=debug']
else
b2flags << 'variant=release'
end

# Build Commands

# On some platforms, we have multiple means of specifying paths. Sometimes, we need to use either one
Expand All @@ -131,10 +134,9 @@
"#{execute}bootstrap#{bootstrap_suffix} #{with_toolset}",
"./b2 \
install \
variant=release \
#{link_option} \
toolset=#{toolset} \
#{b2flags} \
#{b2flags.join(' ')} \
-d+2 \
--prefix=#{settings[:prefix]} \
--debug-configuration"
Expand All @@ -145,10 +147,9 @@
[
"#{b2location} \
install \
variant=release \
#{link_option} \
toolset=#{toolset} \
#{b2flags} \
#{b2flags.join(' ')} \
-d+2 \
--debug-configuration \
--prefix=#{settings[:prefix]} \
Expand Down
4 changes: 4 additions & 0 deletions configs/components/curl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
configure_options << "--disable-dependency-tracking"
end

if settings[:debug_symbols]
configure_options << '--enable-debug'
end

pkg.configure do
["CPPFLAGS='#{settings[:cppflags]}' \
LDFLAGS='#{settings[:ldflags]}' \
Expand Down
4 changes: 4 additions & 0 deletions configs/components/openssl-1.0.2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@

configure_flags += ['fips', "--with-fipsdir=#{settings[:prefix]}/usr/local/ssl/fips-2.0"] if platform.name =~ /windowsfips-2012r2/

if settings[:debug_symbols]
configure_flags += ['-g3', '-O0', '-fno-omit-frame-pointer', '-fno-inline-functions']
end

# Individual projects may provide their own openssl configure flags:
project_flags = settings[:openssl_extra_configure_flags] || []
configure_flags << project_flags << cflags << ldflags
Expand Down
4 changes: 4 additions & 0 deletions configs/components/openssl-1.1.1.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@
'no-ssl3'
]

if settings[:debug_symbols]
configure_flags += ['-g3', '-O0', '-fno-omit-frame-pointer', '-fno-inline-functions']
end

# Individual projects may provide their own openssl configure flags:
project_flags = settings[:openssl_extra_configure_flags] || []
perl_exec = ''
Expand Down
4 changes: 4 additions & 0 deletions configs/components/openssl-lib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@

configure_flags += ['fips', "--with-fipsdir=#{settings[:prefix]}/usr/local/ssl/fips-2.0"] if platform.name =~ /windowsfips-2012r2/

if settings[:debug_symbols]
configure_flags += ['-g3', '-O0', '-fno-omit-frame-pointer', '-fno-inline-functions']
end

# Individual projects may provide their own openssl configure flags:
project_flags = settings[:openssl_extra_configure_flags] || []
configure_flags << project_flags << cflags << ldflags
Expand Down
4 changes: 4 additions & 0 deletions configs/projects/_shared-agent-settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
# Export the settings for the current project and platform as yaml during builds
proj.publish_yaml_settings

if ENV['CPP_COMPONENT_DEBUG_SYM']
proj.setting(:debug_symbols, true)
end

# Use sparingly in component configurations to conditionally include
# dependencies that should not be in other projects that use puppet-runtime
proj.setting(:runtime_project, 'agent')
Expand Down