#1 Initial build of .NET Core SDK 2.1.301 and Runtime 2.1.1
Merged 5 years ago by omajid. Opened 5 years ago by omajid.
dotnet-sig/ omajid/dotnet-2-1 master  into  master

file modified
+103 -4
@@ -1,6 +1,105 @@ 

- # .NET Core 2.1

- This repository contains the source files for .NET Core packages on [dotnet-sig copr](https://copr.fedorainfracloud.org/coprs/g/dotnet-sig/dotnet/) maintained by the DotNet Special Interest Group. For more information visit our [wiki page](https://fedoraproject.org/wiki/SIGs/DotNet).

+ # fedora-dotnet

+ .NET Core Fedora RPM packages

  

+ This repository contains the spec files for building .NET Core RPM's.

+ 

+ These are the base for what will hopefully become the official .NET

+ Core packages in Fedora.

+ 

+ # Fedora dotnet SIG

+ 

+ These packages are maintained by the Fedora DotNet SIG (Special

+ Interest Group). You can find out more about the DotNet SIG at:

+ 

+ - https://fedoraproject.org/wiki/SIGs/DotNet

+ - https://fedoraproject.org/wiki/DotNet

+ - https://lists.fedoraproject.org/archives/list/dotnet-sig@lists.fedoraproject.org/

+ 

+ # Getting builds from COPR

+ 

+ Packages from this repository are available the DotNet SIG copr at

+ https://copr.fedorainfracloud.org/coprs/g/dotnet-sig/dotnet/

+ 

+ Please see the copr repository for steps on how to install the

+ packages and use them.

+ 

+ Please report any issues [here](https://pagure.io/dotnet-sig/packaging-issues/new_issue).

+ 

+ # Specification

+ 

+ - Follows [package naming and contents suggested by upstream](https://github.com/dotnet/core-setup/issues/1599)

+ - Installs dotnet to `/usr/lib64/dotnet`

+ 

+ # Building

+ 

+ 1. You will need credentials and permissions to build in copr.

+ 

+     - You need [a valid Fedora

+       account](https://admin.fedoraproject.org/accounts/) to be able to

+       use any Fedora infrastructure, including copr.

+     - You will need a token for `copr-cli` commands. See

+        https://copr.fedorainfracloud.org/api/ for how to get a token.

+     - To build in dotnet-sig copr, ask an admin of dotnet-sig for

+       permissions.

+ 

+ 2. Fork [the dotnet-sig repo](https://pagure.io/dotnet-sig/dotnet-2-1) via

+    copr. You should now have a repo with the web url

+    https://pagure.io/fork/$USER/dotnet-2-1

+ 

+ 3. Checkout the forked repository

+ 

+     - `git clone ssh://git@pagure.io/forks/$USER/dotnet-2-1.git`

+     - `cd dotnet-2-1`

+ 

+ 4. Bump version/release in the spec file. Add a Changelog. Make sure

+    the `Source` tag corresponds to the new tarball name, if there is a

+    new tarball.

+ 

+ 5. Do  local builds

+ 

+     - `fedpkg --dist $YOUR_FEDORA_VERSION local`

+ 

+     Where the version can be, for example, f27. Fix any errors that

+     come up and rebuild until it works locally.

+ 

+ 6. Upload the new tarball to a public URL, if there is a new tarball.

+    I use:

+ 

+     - `scp dotnet-2.1.301.tar.gz omajid.fedorapeople.org:public_html/dotnet/ `

+ 

+     Make sure `spectool -g /path/to/dotnet.spec` can download this

+     tarball from the public URL.

+ 

+ 7. Commit the changes to the git repo and do a build on copr.

+ 

+     - `git add # any new files, such as new patches`

+     - `git remove # old files, such as old patches`

+     - `git commit -a`

+     - `git push`

+     - `fedpkg dotnet srpm`

+     - `copr-cli build @dotnet-sig/dotnet <path-to-srpm>`

+ 

+ 8. If it fails, update spec file/patches and rebuild with the same set

+    of steps.

+ 

+ # Testing

+ 

+ 1. Pull down the packages from copr, and install them:

+ 

+     - `dnf copr enable @dotnet-sig/dotnet`

+     - `dnf install dotnet-sdk-2.1`

+ 

+     OR, if you already have the packages installed:

+ 

+     -  `dnf upgrade 'dotnet*'`

+ 

+     Make sure it installs the version you just built. Sometimes it

+     takes a few minutes to an hour for the latest version to show up

+     in the copr repos.

+ 

+ 2. Run some smoke tests

+ 

+     - `dotnet new console -o ConsoleApplication`

+     - `dotnet run`

+     - `dotnet publish -c Release -r linux-x64`

  

- ### IRC

- `#fedora-dotnet` on Freenode ([webchat](https://webchat.freenode.net/?channels=#fedora-dotnet))

file added
+136
@@ -0,0 +1,136 @@ 

+ #!/usr/bin/python3

+ 

+ """

+ 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.run(['eu-readelf', '-S', file],

+                                       stdout=subprocess.PIPE, encoding='utf-8', check=True)

+     has_debug_info = any(line for line in readelf_S_result.stdout.split('\n') if '] .debug_info' in line)

+ 

+     has_debug_abbrev = any(line for line in readelf_S_result.stdout.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.run(["eu-readelf", '-s', file],

+                                       stdout=subprocess.PIPE, encoding='utf-8', check=True)

+     has_file_symbols = any(line for line in readelf_s_result.stdout.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.stdout.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.run(['file', file], stdout=subprocess.PIPE, encoding='utf-8', check=True)

+     return re.search('ELF 64-bit LSB (?:executable|shared object)', result.stdout)

+ 

+ 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))

+ 

+     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:]))

file added
+299
@@ -0,0 +1,299 @@ 

+ # Avoid provides/requires from private libraries

+ %global privlibs             libhostfxr

+ %global privlibs %{privlibs}|libclrjit

+ %global privlibs %{privlibs}|libcoreclr

+ %global privlibs %{privlibs}|libcoreclrtraceptprovider

+ %global privlibs %{privlibs}|libdbgshim

+ %global privlibs %{privlibs}|libhostpolicy

+ %global privlibs %{privlibs}|libmscordaccore

+ %global privlibs %{privlibs}|libmscordbi

+ %global privlibs %{privlibs}|libsos

+ %global privlibs %{privlibs}|libsosplugin

+ %global __provides_exclude ^(%{privlibs})\\.so

+ %global __requires_exclude ^(%{privlibs})\\.so

+ 

+ %global sdk_version 2.1.301

+ %global runtime_version 2.1.1

+ 

+ Name:           dotnet

+ Version:        %{sdk_version}

+ Release:        2%{?dist}

+ Summary:        .NET Core CLI tools and runtime

+ License:        MIT and ASL 2.0 and BSD

+ URL:            https://github.com/dotnet/

+ 

+ # The source is generated on a Fedora box via:

+ # - git clone https://github.com/dotnet/source-build

+ # - git checkout v%%{sdk_version}

+ # - set environment variables + tweak sources to build

+ # - ./build-source-tarball.sh dotnet-%%{sdk_version}

+ # - tar cvzf dotnet-%%{sdk_version}.tar.gz dotnet-%%{sdk_version}

+ 

+ Source0:        https://omajid.fedorapeople.org/dotnet/dotnet-%{sdk_version}.tar.gz

+ Source1:        check-debug-symbols.py

+ 

+ ExclusiveArch:  x86_64

+ 

+ BuildRequires:  clang

+ BuildRequires:  cmake

+ BuildRequires:  git

+ BuildRequires:  hostname

+ BuildRequires:  krb5-devel

+ BuildRequires:  libcurl-devel

+ BuildRequires:  libicu-devel

+ BuildRequires:  libunwind-devel

+ BuildRequires:  libuuid-devel

+ BuildRequires:  lldb-devel

+ BuildRequires:  llvm

+ BuildRequires:  lttng-ust-devel

+ BuildRequires:  python

+ BuildRequires:  strace

+ BuildRequires:  zlib-devel

+ %if             0%{fedora} >= 26

+ BuildRequires:  compat-openssl10-devel

+ %else

+ BuildRequires:  openssl-devel

+ %endif

+ 

+ Requires:       %{name}-sdk-2.1%{?_isa}

+ 

+ %description

+ .NET Core is a fast, lightweight and modular platform for creating

+ cross platform applications that work on Linux, macOS and Windows.

+ 

+ It particularly focuses on creating console applications, web

+ applications and micro-services.

+ 

+ .NET Core contains a runtime conforming to .NET Standards a set of

+ framework libraries, an SDK containing compilers and a 'dotnet'

+ application to drive everything.

+ 

+ %package host

+ 

+ Version:        %{runtime_version}

+ Summary:        .NET command line launcher

+ 

+ %description host

+ The .NET Core host is a command line program that runs a standalone

+ .NET core application or launches the SDK.

+ 

+ .NET Core is a fast, lightweight and modular platform for creating

+ cross platform applications that work on Linux, Mac and Windows.

+ 

+ It particularly focuses on creating console applications, web

+ applications and micro-services.

+ 

+ %package runtime-2.1

+ 

+ Version:        %{runtime_version}

+ Summary:        NET Core 2.1 runtime

+ 

+ # Theoretically any version of the host should work

+ Requires:       %{name}-host%{?_isa}

+ 

+ # libicu is dlopen()ed

+ Requires:       libicu

+ 

+ 

+ %description runtime-2.1

+ The .NET Core runtime contains everything needed to run .NET Core applications.

+ It includes a high performance Virtual Machine as well as the framework

+ libraries used by .NET Core applications.

+ 

+ .NET Core is a fast, lightweight and modular platform for creating

+ cross platform applications that work on Linux, Mac and Windows.

+ 

+ It particularly focuses on creating console applications, web

+ applications and micro-services.

+ 

+ %package sdk-2.1

+ 

+ Version:        %{sdk_version}

+ Summary:        .NET Core 2.1 Software Development Kit

+ 

+ Requires:       %{name}-sdk-2.1.3xx%{?_isa}

+ 

+ %description sdk-2.1

+ The .NET Core SDK is a collection of command line applications to

+ create, build, publish and run .NET Core applications.

+ 

+ .NET Core is a fast, lightweight and modular platform for creating

+ cross platform applications that work on Linux, Mac and Windows.

+ 

+ It particularly focuses on creating console applications, web

+ applications and micro-services.

+ 

+ %package sdk-2.1.3xx

+ 

+ Version:        %{sdk_version}

+ Summary:        .NET Core 2.1.3xx Software Development Kit

+ 

+ Requires:       %{name}-runtime-2.1%{?_isa}

+ 

+ %description sdk-2.1.3xx

+ The .NET Core SDK is a collection of command line applications to

+ create, build, publish and run .NET Core applications.

+ 

+ .NET Core is a fast, lightweight and modular platform for creating

+ cross platform applications that work on Linux, Mac and Windows.

+ 

+ It particularly focuses on creating console applications, web

+ applications and micro-services.

+ 

+ %prep

+ %setup -q -n %{name}-%{sdk_version}

+ 

+ # Fix bad hardcoded path in build

+ sed -i 's|/usr/share/dotnet|%{_libdir}/%{name}|' src/core-setup/src/corehost/common/pal.unix.cpp

+ 

+ # Fix 

+ sed -i -E 's|fedora.[0-9]+(</RuntimeOS>)|fedora.%{fedora}\1|' Tools/configuration/configuration.props

+ 

+ %build

+ 

+ # strace -fo strace.log \

+ 

+ ./build.sh /v:diag /p:MinimalConsoleLogOutput=false

+ 

+ %install

+ install -d -m 0755 %{buildroot}%{_libdir}/%{name}/

+ ls bin/x64/Release

+ tar xf bin/x64/Release/dotnet-sdk-%{sdk_version}-*.tar.gz -C %{buildroot}%{_libdir}/%{name}/

+ 

+ # Fix permissions on files

+ find %{buildroot}%{_libdir}/%{name}/ -type f -name '*.props' -exec chmod -x {} \;

+ find %{buildroot}%{_libdir}/%{name}/ -type f -name '*.targets' -exec chmod -x {} \;

+ find %{buildroot}%{_libdir}/%{name}/ -type f -name '*.dll' -exec chmod -x {} \;

+ find %{buildroot}%{_libdir}/%{name}/ -type f -name '*.pubxml' -exec chmod -x {} \;

+ 

+ install -dm 755 %{buildroot}/%{_datadir}/bash-completion/completions

+ # dynamic completion needs the file to be named the same as the base command

+ install src/cli/scripts/register-completions.bash %{buildroot}/%{_datadir}/bash-completion/completions/dotnet

+ 

+ # TODO: the zsh completion script needs to be ported to use #compdef

+ #install -dm 755 %%{buildroot}/%%{_datadir}/zsh/site-functions

+ #install src/cli/scripts/register-completions.zsh %%{buildroot}/%%{_datadir}/zsh/site-functions/_dotnet

+ 

+ install -d -m 0755 %{buildroot}%{_bindir}

+ ln -s %{_libdir}/%{name}/dotnet %{buildroot}%{_bindir}/

+ 

+ install -d -m 0755 %{buildroot}%{_mandir}/man1/

+ find -iname 'dotnet*.1' -type f -exec cp {} %{buildroot}%{_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..."

+ %{SOURCE1} -v %{buildroot}%{_libdir}/%{name}/

+ 

+ %check

+ %{buildroot}%{_libdir}/%{name}/dotnet --info

+ 

+ %files

+ # empty package useful for dependencies

+ 

+ %files host

+ %dir %{_libdir}/%{name}

+ %{_libdir}/%{name}/dotnet

+ %{_libdir}/%{name}/host

+ %{_bindir}/dotnet

+ %license %{_libdir}/%{name}/LICENSE.txt

+ %license %{_libdir}/%{name}/ThirdPartyNotices.txt

+ %doc %{_mandir}/man1/dotnet*.1.gz

+ %dir %{_datadir}/bash-completion

+ %dir %{_datadir}/bash-completion/completions

+ %{_datadir}/bash-completion/completions/dotnet

+ 

+ %files runtime-2.1

+ %dir %{_libdir}/%{name}/shared

+ %dir %{_libdir}/%{name}/shared/Microsoft.NETCore.App

+ %{_libdir}/%{name}/shared/Microsoft.NETCore.App/%{runtime_version}

+ 

+ %files sdk-2.1

+ # empty package useful for dependencies

+ 

+ %files sdk-2.1.3xx

+ %dir %{_libdir}/%{name}/sdk

+ %{_libdir}/%{name}/sdk/%{sdk_version}

+ 

+ %changelog

+ * Fri Jul 20 2018 Omair Majid <omajid@redhat.com> - 2.1.301-1

+ - Update to .NET Core 2.1

+ 

+ * Thu May 03 2018 Omair Majid <omajid@redhat.com> - 2.0.7-1

+ - Update to .NET Core 2.0.7

+ 

+ * Wed Mar 28 2018 Omair Majid <omajid@redhat.com> - 2.0.6-2

+ - Enable bash completion for dotnet

+ - Remove redundant buildrequires and requires

+ 

+ * Wed Mar 14 2018 Omair Majid <omajid@redhat.com> - 2.0.6-1

+ - Update to .NET Core 2.0.6

+ 

+ * Fri Feb 23 2018 Omair Majid <omajid@redhat.com> - 2.0.5-1

+ - Update to .NET Core 2.0.5

+ 

+ * Wed Jan 24 2018 Omair Majid <omajid@redhat.com> - 2.0.3-5

+ - Don't apply corefx clang warnings fix on clang < 5

+ 

+ * Fri Jan 19 2018 Omair Majid <omajid@redhat.com> - 2.0.3-4

+ - Add a test script to sanity check debug and symbol info.

+ - Build with clang 5.0

+ - Make main package real instead of using a virtual provides (see RHBZ 1519325)

+ 

+ * Wed Nov 29 2017 Omair Majid <omajid@redhat.com> - 2.0.3-3

+ - Add a Provides for 'dotnet'

+ - Fix conditional macro

+ 

+ * Tue Nov 28 2017 Omair Majid <omajid@redhat.com> - 2.0.3-2

+ - Fix build on Fedora 27

+ 

+ * Fri Nov 17 2017 Omair Majid <omajid@redhat.com> - 2.0.3-1

+ - Update to .NET Core 2.0.3

+ 

+ * Thu Oct 19 2017 Omair Majid <omajid@redhat.com> - 2.0.0-4

+ - Add a hack to let omnisharp work

+ 

+ * Wed Aug 30 2017 Omair Majid <omajid@redhat.com> - 2.0.0-3

+ - Add a patch for building coreclr and core-setup correctly on Fedora >= 27

+ 

+ * Fri Aug 25 2017 Omair Majid <omajid@redhat.com> - 2.0.0-2

+ - Move libicu/libcurl/libunwind requires to runtime package

+ - Make sdk depend on the exact version of the runtime package

+ 

+ * Thu Aug 24 2017 Omair Majid <omajid@redhat.com> - 2.0.0-1

+ - Update to 2.0.0 final release

+ 

+ * Wed Jul 26 2017 Omair Majid <omajid@redhat.com> - 2.0.0-0.3.preview2

+ - Add man pages

+ 

+ * Tue Jul 25 2017 Omair Majid <omajid@redhat.com> - 2.0.0-0.2.preview2

+ - Add Requires on libicu

+ - Split into multiple packages

+ - Do not repeat first-run message

+ 

+ * Fri Jul 21 2017 Omair Majid <omajid@redhat.com> - 2.0.0-0.1.preview2

+ - Update to .NET Core 2.0 Preview 2

+ 

+ * Thu Mar 16 2017 Nemanja Milošević <nmilosevnm@gmail.com> - 1.1.0-7

+ - rebuilt with latest libldb

+ * Wed Feb 22 2017 Nemanja Milosevic <nmilosev@fedoraproject.org> - 1.1.0-6

+ - compat-openssl 1.0 for F26 for now

+ * Sun Feb 19 2017 Nemanja Milosevic <nmilosev@fedoraproject.org> - 1.1.0-5

+ - Fix wrong commit id's

+ * Sat Feb 18 2017 Nemanja Milosevic <nmilosev@fedoraproject.org> - 1.1.0-4

+ - Use commit id's instead of branch names

+ * Sat Feb 18 2017 Nemanja Milosevic <nmilosev@fedoraproject.org> - 1.1.0-3

+ - Improper patch5 fix

+ * Sat Feb 18 2017 Nemanja Milosevic <nmilosev@fedoraproject.org> - 1.1.0-2

+ - SPEC cleanup

+ - git removal (using all tarballs for reproducible builds)

+ - more reasonable versioning

+ * Thu Feb 09 2017 Nemanja Milosevic <nmilosev@fedoraproject.org> - 1.1.0-1

+ - Fixed debuginfo going to separate package (Patch1)

+ - Added F25/F26 RIL and fixed the version info (Patch2)

+ - Added F25/F26 RIL in Microsoft.NETCore.App suported runtime graph (Patch3)

+ - SPEC file cleanup

+ * Wed Jan 11 2017 Nemanja Milosevic <nmilosev@fedoraproject.org> - 1.1.0-0

+ - Initial RPM for Fedora 25/26.

+ 

Should the version here be something more like 2.1?

Should there be something about 2.1 here? Also, is it normal to keep the changes form other versions here?

1 new commit added

  • Update README
5 years ago

Also, is it normal to keep the changes form other versions here?

I think this really depends. I don't know of any rule or preference about this. I generally keep history around, similar to how this merge-request includes the git history from the older repository.

1 new commit added

  • Add missing changelog entry
5 years ago

Pull-Request has been merged by omajid

5 years ago