From 4658e965df3847d073caeea660ef39e3d13c22c6 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Mar 13 2019 13:52:37 +0000 Subject: import rh-dotnetcore11-dotnetcore-1.1.12-1.el7 --- diff --git a/.gitignore b/.gitignore index 30c8765..3cd7a2a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -SOURCES/cli-1.0.0-preview2-1-003331-2.tar.gz -SOURCES/dotnet-dev-rhel-x64.1.0.0-preview2-1-003331.tar.gz -SOURCES/manpages.1.0.0-preview2-1-003331.tar.gz +SOURCES/cli-1.0.0-preview2-1-003371.tar.gz +SOURCES/dotnet-dev-rhel-x64.1.0.0-preview2-1-003371.tar.gz +SOURCES/manpages.1.0.0-preview2-1-003371.tar.gz diff --git a/.rh-dotnetcore11-dotnetcore.metadata b/.rh-dotnetcore11-dotnetcore.metadata index 8ea40a4..f99fa65 100644 --- a/.rh-dotnetcore11-dotnetcore.metadata +++ b/.rh-dotnetcore11-dotnetcore.metadata @@ -1,3 +1,3 @@ -c3ef215601b26f56981902c26daa658bd51a6224 SOURCES/cli-1.0.0-preview2-1-003331-2.tar.gz -c3e876da2841acc7a157daa3864e2325adb388ae SOURCES/dotnet-dev-rhel-x64.1.0.0-preview2-1-003331.tar.gz -5360ccba625b236d96385b3348e74ee15dcdc5c8 SOURCES/manpages.1.0.0-preview2-1-003331.tar.gz +c23f03b12627340846505d970670e9e2c67f6f20 SOURCES/cli-1.0.0-preview2-1-003371.tar.gz +6087129c253ce942f573167c3934a79cae02c20b SOURCES/dotnet-dev-rhel-x64.1.0.0-preview2-1-003371.tar.gz +e3656b2544b8ce5844aff0671e73e9e180a888c3 SOURCES/manpages.1.0.0-preview2-1-003371.tar.gz diff --git a/SOURCES/check-debug-symbols.py b/SOURCES/check-debug-symbols.py new file mode 100755 index 0000000..7eb06f9 --- /dev/null +++ b/SOURCES/check-debug-symbols.py @@ -0,0 +1,134 @@ +#!/usr/bin/python2 + +""" +Check debug symbols are present in shared object and can identify +code. + +It starts scanning from a directory and recursively scans all ELF +files found in it for various symbols to ensure all debuginfo is +present and nothing has been stripped. + +Usage: + +./check-debug-symbols /path/of/dir/to/scan/ + + +Example: + +./check-debug-symbols /usr/lib64 +""" + +# This technique was explained to me by Mark Wielaard (mjw). + +import collections +import os +import re +import subprocess +import sys + +ScanResult = collections.namedtuple('ScanResult', + 'file_name debug_info debug_abbrev file_symbols gnu_debuglink') + + +def scan_file(file): + "Scan the provided file and return a ScanResult containing results of the scan." + + # Test for .debug_* sections in the shared object. This is the main test. + # Stripped objects will not contain these. + readelf_S_result = subprocess.check_output(['eu-readelf', '-S', file]) + has_debug_info = any(line for line in readelf_S_result.split('\n') if '] .debug_info' in line) + + has_debug_abbrev = any(line for line in readelf_S_result.split('\n') if '] .debug_abbrev' in line) + + # Test FILE symbols. These will most likely be removed by anyting that + # manipulates symbol tables because it's generally useless. So a nice test + # that nothing has messed with symbols. + def contains_file_symbols(line): + parts = line.split() + if len(parts) < 8: + return False + return \ + parts[2] == '0' and parts[3] == 'FILE' and parts[4] == 'LOCAL' and parts[5] == 'DEFAULT' and \ + parts[6] == 'ABS' and re.match(r'((.*/)?[-_a-zA-Z0-9]+\.(c|cc|cpp|cxx))?', parts[7]) + + readelf_s_result = subprocess.check_output(["eu-readelf", '-s', file]) + has_file_symbols = any(line for line in readelf_s_result.split('\n') if contains_file_symbols(line)) + + # Test that there are no .gnu_debuglink sections pointing to another + # debuginfo file. There shouldn't be any debuginfo files, so the link makes + # no sense either. + has_gnu_debuglink = any(line for line in readelf_s_result.split('\n') if '] .gnu_debuglink' in line) + + return ScanResult(file, has_debug_info, has_debug_abbrev, has_file_symbols, has_gnu_debuglink) + +def is_elf(file): + result = subprocess.check_output(['file', file]) + return re.search('ELF 64-bit LSB (?:executable|shared object)', result) + +def scan_file_if_sensible(file): + if is_elf(file): + # print(file) + return scan_file(file) + return None + +def scan_dir(dir): + results = [] + for root, _, files in os.walk(dir): + for name in files: + result = scan_file_if_sensible(os.path.join(root, name)) + if result: + results.append(result) + return results + +def scan(file): + file = os.path.abspath(file) + if os.path.isdir(file): + return scan_dir(file) + elif os.path.isfile(file): + return scan_file_if_sensible(file) + +def is_bad_result(result): + return not result.debug_info or not result.debug_abbrev or not result.file_symbols or result.gnu_debuglink + +def print_scan_results(results, verbose): + # print(results) + for result in results: + file_name = result.file_name + found_issue = False + if not result.debug_info: + found_issue = True + print('error: missing .debug_info section in ' + file_name) + if not result.debug_abbrev: + found_issue = True + print('error: missing .debug_abbrev section in ' + file_name) + if not result.file_symbols: + found_issue = True + print('error: missing FILE symbols in ' + file_name) + if result.gnu_debuglink: + found_issue = True + print('error: unexpected .gnu_debuglink section in ' + file_name) + if verbose and not found_issue: + print('OK: ', file_name) + +def main(args): + verbose = False + files = [] + for arg in args: + if arg == '--verbose' or arg == '-v': + verbose = True + else: + files.append(arg) + + results = [] + for file in files: + results.extend(scan(file) or []) + + print_scan_results(results, verbose) + + if any(is_bad_result(result) for result in results): + return 1 + return 0 + + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/SPECS/dotnetcore.spec b/SPECS/dotnetcore.spec index 6a70d6f..a59b2c2 100644 --- a/SPECS/dotnetcore.spec +++ b/SPECS/dotnetcore.spec @@ -9,8 +9,8 @@ %undefine _include_minidebuginfo %global _find_debuginfo_dwz_opts %{nil} -%global cli_version 1.0.0-preview2-1-003331 -%global runtime_version 1.1.10 +%global cli_version 1.0.0-preview2-1-003371 +%global runtime_version 1.1.12 # Do not provide internal .so as standard libraries %global __provides_exclude_from ^(%{_libdir}/dotnetcore/.*\\.so|%{_libdir}/dotnetcore/sdk/%{cli_version}/.*\\.so|%{_libdir}/dotnetcore/shared/Microsoft.NETCore.App/%{runtime_version}/.*)$ @@ -29,7 +29,7 @@ Group: Development/Languages License: ASL 2.0 and MIT URL: https://www.microsoft.com/net/core -Source0: cli-%{cli_version}-2.tar.gz +Source0: cli-%{cli_version}.tar.gz # Built on a developer's laptop, from source Source1: dotnet-dev-rhel-x64.%{cli_version}.tar.gz @@ -40,9 +40,12 @@ Source2: manpages.%{cli_version}.tar.gz Source3: https://raw.githubusercontent.com/dotnet/core-setup/release/1.1.0/LICENSE +Source4: check-debug-symbols.py ExclusiveArch: x86_64 +BuildRequires: python2 + Requires: %{?scl_prefix}libcurl%{?_isa} Requires: %{?scl_prefix}libuv%{?_isa} @@ -90,6 +93,12 @@ ln -s %{_libdir}/%{pkg_name}/dotnet $RPM_BUILD_ROOT/%{_bindir}/ mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man1/ find -type f -iname 'dotnet*\.1' -exec cp {} $RPM_BUILD_ROOT/%{_mandir}/man1/ \; +# Check debug symbols in all elf objects. This is not in %%check +# because native binaries are stripped by rpm-build after %%install. +# So we need to do this check earlier. +echo "Testing build results for debug symbols..." +%{SOURCE4} -v %{buildroot}%{_libdir}/%{pkg_name}/ + %files %doc LICENSE %doc ThirdPartyNotices.txt @@ -98,6 +107,19 @@ find -type f -iname 'dotnet*\.1' -exec cp {} $RPM_BUILD_ROOT/%{_mandir}/man1/ \; %{_mandir}/man1/dotnet*.1* %changelog +* Thu Mar 07 2019 Omair Majid - 1.1.12-1 +- Update to .NET Core 1.1.12 +- Resolves: RHBZ#1686624 + +* Fri Feb 01 2019 Omair Majid - 1.1.11-2 +- Fix debuginfo in native binaries +- Add a script to test debuginfo after build +- Resolves: RHBZ#1669702 + +* Sat Jan 26 2019 Omair Majid - 1.1.11-1 +- Update to .NET Core 1.1.11 +- Resolves: RHBZ#1669702 + * Tue Oct 02 2018 Omair Majid - 1.1.10-1 - Switch to a smaller tarball to work around source size issues - Resolves: rhbz#1634072