Skip to content

Commit 5aace88

Browse files
author
Romain PEREIRA
committed
utils: rename generated 'version' file to 'thapi_version' (avoid shadowing C++ <version>)
1 parent ba5fd0d commit 5aace88

3 files changed

Lines changed: 10 additions & 7 deletions

File tree

‎utils/Makefile.am‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,20 @@ bin_SCRIPTS = \
5050
noinst_SCRIPTS = \
5151
test_wrapper_thapi_text_pretty.sh
5252

53-
.PHONY: version
53+
.PHONY: thapi_version
5454

55-
version:
56-
git describe --abbrev=7 --dirty --always --tags > version || echo $(PACKAGE_VERSION) > version
55+
# Must NOT be named `version`: utils/ is on the C++ include path and a file
56+
# named `version` shadows the standard <version> header (used by libstdc++/
57+
# abseil/protobuf), which breaks the xprof build.
58+
thapi_version:
59+
git describe --abbrev=7 --dirty --always --tags > thapi_version || echo $(PACKAGE_VERSION) > thapi_version
5760

5861
data_DATA = \
59-
version \
62+
thapi_version \
6063
optparse_thapi.rb
6164

6265
CLEANFILES = \
63-
version \
66+
thapi_version \
6467
optparse_thapi.rb \
6568
lttng/tracepoint_gen.h \
6669
$(BUILT_SOURCES)

‎utils/babeltrace_thapi.in‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ class BabeltraceParserThapi < OptionParserWithDefaultAndValidation
401401
on('--archive-session-found-file-path PATH')
402402
on('--[no-]muxer')
403403
on('-v', '--version', 'Print the version string') do
404-
puts File.read(File.join(DATADIR, 'version'))
404+
puts File.read(File.join(DATADIR, 'thapi_version'))
405405
exit
406406
end
407407
end

‎xprof/xprof.rb.in‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1122,7 +1122,7 @@ if $thapi_launch || __FILE__ == $PROGRAM_NAME
11221122

11231123
parser.on('--metadata', 'Display trace metadata.')
11241124
parser.on('-v', '--version', 'Print the Version String.') do
1125-
puts File.read(File.join(DATADIR, 'version'))
1125+
puts File.read(File.join(DATADIR, 'thapi_version'))
11261126
exit
11271127
end
11281128
parser.on('-h', '--help', 'Display this message.') { print_help_and_exit(parser, exit_code: 0) }

0 commit comments

Comments
 (0)