#6 Fix build on Fedora 26
Closed Opened by nmilosev.

Build fails for F26 because lttng-ust-devel is missing. (package name change?). And many other bulid errors.


It's probably a bug in how the header is being looked up. There was a fix upstream for this: https://github.com/dotnet/coreclr/pull/8470/files

Ah, makes sense, thank you

Added a patch to the tree, based on the mentioned pull.

Will try to build for F26.

Build failed for F26:

https://copr.fedorainfracloud.org/coprs/nmilosev/dotnet-clean/build/510482/

Logs are there. Pretty sure we need this:

https://github.com/dotnet/coreclr/pull/8311/files

But not sure if it is needed since we will definitely move to source-build before F26.

https://patch-diff.githubusercontent.com/raw/dotnet/coreclr/pull/8311.diff

relevant

Metadata Update from @rhea:
- Issue untagged with: package

After applying this one (without even modifying it), build works on F25 but not on F26 still. :(

I got coreclr to build by adding https://github.com/dotnet/coreclr/pull/7865

Now I run into errors building corefx because the openssl api changed.

[ 67%] Building C object System.Security.Cryptography.Native/CMakeFiles/objlib.dir/openssl.c.o
/builddir/build/BUILD/dotnetcore-1.1.0/core-bootstrap/tools/dotnet-bootstrap/fedora.26-x64-dotnet/src/corefx/src/Native/Unix/System.Security.Cryptography.Native/openssl.c:84:22: error: incomplete definition of type 'struct x509_st'
    memcpy(pBuf, x509->sha1_hash, SHA_DIGEST_LENGTH);
                ~~~~^
/usr/include/openssl/ossl_typ.h:119:16: note: forward declaration of 'struct x509_st'
typedef struct x509_st X509;
            ^
/builddir/build/BUILD/dotnetcore-1.1.0/core-bootstrap/tools/dotnet-bootstrap/fedora.26-x64-dotnet/src/corefx/src/Native/Unix/System.Security.Cryptography.Native/openssl.c:101:21: error: incomplete definition of type 'struct x509_st'
    if (x509 && x509->cert_info && x509->cert_info->validity)
                ~~~~^
/usr/include/openssl/ossl_typ.h:119:16: note: forward declaration of 'struct x509_st'
typedef struct x509_st X509;
           ^

Uh, never got so far. Will add 7865.

I will have to setup a F26 VM, sending to copr is too slow to do a rebuild.

PS. pushing commit id's build in a few seconds

Using mock to build on F26 got the same error as you with the latest spec file in the tree :(

[ 64%] Linking CXX shared library System.Net.Security.Native.so
[ 64%] Built target System.Net.Security.Native
Scanning dependencies of target objlib
[ 65%] Building CXX object System.Security.Cryptography.Native/CMakeFiles/objlib.dir/openssl.cpp.o
/builddir/build/BUILD/dotnetcore-1.1.0/core-bootstrap/tools/dotnet-bootstrap/fedora.26-x64-dotnet/src/corefx/src/Native/Unix/System.Security.Cryptography.Native/openssl.cpp:102:21: error: member access into incomplete type 'X509' (aka 'x509_st')
    if (x509 && x509->cert_info && x509->cert_info->validity)
                    ^
/usr/include/openssl/ossl_typ.h:119:16: note: forward declaration of 'x509_st'
typedef struct x509_st X509;
               ^
/builddir/build/BUILD/dotnetcore-1.1.0/core-bootstrap/tools/dotnet-bootstrap/fedora.26-x64-dotnet/src/corefx/src/Native/Unix/System.Security.Cryptography.Native/openssl.cpp:104:20: error: member access into incomplete type 'X509' (aka 'x509_st')
        return x509->cert_info->validity->notBefore;
                   ^
/usr/include/openssl/ossl_typ.h:119:16: note: forward declaration of 'x509_st'
typedef struct x509_st X509;
               ^
/builddir/build/BUILD/dotnetcore-1.1.0/core-bootstrap/tools/dotnet-bootstrap/fedora.26-x64-dotnet/src/corefx/src/Native/Unix/System.Security.Cryptography.Native/openssl.cpp:123:21: error: member access into incomplete type 'X509' (aka 'x509_st')
    if (x509 && x509->cert_info && x509->cert_info->validity)
                    ^
/usr/include/openssl/ossl_typ.h:119:16: note: forward declaration of 'x509_st'
typedef struct x509_st X509;
               ^

At least we are on the same page now :D

I will have to setup a F26 VM, sending to copr is too slow to do a rebuild.

Do you know about mock?

$ rpmbuild -bs SPECS/dotnetcore.spec  # should produce an SRPM
$ mock -r fedora-rawhide-x86_64 --rebuild /path/to/srpm  # create a chroot, install f26 in it and build the RPM inside the chroot

Yes yes, I am using it. Don't know why i said VM, sorry. if you are on irc I am there :)

OpenSSL is bit of a blocker, so I am skipping the F26 build for now. (Patches are still there in the spec file).

Meanwhile we have to wait for a patch which will allow OpenSSL 1.1.0 (F26) to work with corefx.

I opened https://github.com/dotnet/corefx/issues/16296 upstream.

Lets use compat-openssl10 for now: https://koji.fedoraproject.org/koji/packageinfo?packageID=23164

Sadly, I don't this will save us:

https://bugzilla.redhat.com/show_bug.cgi?id=1400231

Can't use compat-openssl10-devel which we need. This compat library is for end-users not compiling.

I just tried it out and it works in a local mock chroot:

diff --git a/dotnetcore.spec b/dotnetcore.spec
index ab26117..743a6b4 100644
--- a/dotnetcore.spec
+++ b/dotnetcore.spec
@@ -29,7 +29,11 @@ BuildRequires:       libuuid-devel
 BuildRequires: lldb-devel
 BuildRequires: llvm
 BuildRequires: lttng-ust-devel
+%if 0%{fedora} >= 26
+BuildRequires: compat-openssl10-devel
+%else
 BuildRequires: openssl-devel
+%endif
 BuildRequires: python
 BuildRequires: zlib-devel

Build using

rpmbuild -bs SPECS/dotnetcore.spec
mock -r fedora-rawhide-x86_64 --rebuild /home/omajid/rpmbuild/SRPMS/dotnetcore-1.1.0-5.fc25.src.rpm

Wow, didn't see that I have openssl-devel listed just above. :(

Testing!

omajid == superstar

Was so tired yesterday actually wrote:

BuildRequires: openssl-devel
%if %{fedora} >= 26
BuildRequires: compat-openssl10-devel
%endif

and the packages conflicted obviously. Thank you so much for noticing this!!!

Pushing builds to copr and new spec file.

Hello rawhide! :)

@nmilosev you have been doing the most heroic work! At least, the hardest ;)

F26 builds are now LIVE!

Thank you @omajid!

https://copr.fedorainfracloud.org/coprs/nmilosev/dotnet-clean/build/516123/

I opened a Fedora tracker bug: https://bugzilla.redhat.com/show_bug.cgi?id=1425914

Safe to close this now?

Metadata Update from @rhea:
- Issue tagged with: package

+1 on closing. I don't have powers to close this.

Metadata Update from @omajid:
- Issue assigned to nmilosev
- Issue status updated to: Closed (was: Open)

I do have powers to close this bug :)

Metadata Update from @rhea:
- Issue assigned to nmilosev
- Issue tagged with: bug, f26, package

Metadata