ganto / copr-lxc3

RPM spec files for building lxc-3 on Fedora COPR
MIT License
8 stars 2 forks source link

CentOS 8: No matching package to install: 'libuv-devel' #17

Closed ganto closed 5 years ago

ganto commented 5 years ago

Currently lxd cannot be build on CentOS 8 because libuv-devel package is missing in the repository. The reason is the new modularity system used for NodeJS where libuv-devel is involved.

From the official CentOS 8 announcement:

Known RHEL-8 packages missing -devel

  • libblueray-devel
  • liba52-devel
  • libXvMC-devel
  • libdvdnav-devel
  • gfbgraph-devel
  • libuv-devel
  • rest-devel
  • qgpgme-devel

The reason seems to be as following:

  1. Until modularity and module builds are implemented in EPEL, there will be many packages which can not be built for EPEL. This is mainly due to RHEL-8 not shipping many -devel packages and the need for us to rebuild those packages in a module to make those -devel available to build against.

There already exists an issue in the EPEL Pagure issue tracker which I hope will be updated once there is some progress: #64: libuv-devel missing from CRB

ganto commented 5 years ago

Build failure from rpmbuild (e.g. COPR Build 1062128 (epel-8-x86_64))

[...]
Start: build phase for lxd-3.17-0.1.el8.src.rpm
Start: build setup for lxd-3.17-0.1.el8.src.rpm
Building target platforms: x86_64
Building for target x86_64
Wrote: /builddir/build/SRPMS/lxd-3.17-0.1.el8.src.rpm
No matches found for the following disable plugin patterns: local, spacewalk
Copr repository                                  34 kB/s | 3.3 kB     00:00    
No matching package to install: 'btrfs-progs'
Package gettext-0.19.8.1-14.el8.x86_64 is already installed.
No matching package to install: 'libuv-devel'
Package systemd-239-13.el8_0.5.x86_64 is already installed.
Not all dependencies satisfied
Error: Some packages could not be found.
[...]

Haven't checked yet if there is any btrfs support planned in CentOS/EPEL. If not, I can simply drop the dependency for the CentOS 8 build, but the missing libuv-devel is currently a show-stopper.

jmontleon commented 5 years ago

Hi ganto, I managed to get this built.

libuv-devel does not appear to be in a repo. I found a BZ on this that confirms it.

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

Fortunately, the workaround for Copr, is pretty easy. Just run a build using the available source RPM in your Copr project (just against EL8 is probably the best option) and you'll have it available for your builds: https://koji.mbox.centos.org/pkgs/packages/libuv/1.23.1/1.el8/src/libuv-1.23.1-1.el8.src.rpm

After that just the missing btrfs-progs for checks is at issue, which can be resolved by doing something like this:

%if 0%{?fedora}
global with_check 1
%else
%global with_check 0
%endif

Maybe something like this would be better.

%if 0%{?rhel} >= 8
global with_check 0
%else
%global with_check 1
%endif

Anyway, with those two things I was able to build successfully: https://copr.fedorainfracloud.org/coprs/jmontleon/lxc3/build/1065543/

Edit: I'm just using lxd-client for use with ChromeOS/crostini but the client at least appears to work fine. I have not tested the rest of the packages.

jmontleon commented 5 years ago

I do not believe btrfs-progs will be available:

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/considerations_in_adopting_rhel_8/file-systems-and-storage_considerations-in-adopting-rhel-8

ganto commented 5 years ago

Great, thanks for looking into this. Not sure yet how to build something for only epel-8, but as a workaround I could simply add a build time COPR with libuv-devel.

jmontleon commented 5 years ago

If you go to the build tab on your Copr page and click new build in the upper right I believe it will present you with a page. You can drop the link for the srpm in the text box, scroll down deselect all the buildroots except epel-8 and build.

I am away from a computer for awhile but I can screenshot it when I get back if you can't find it all, but it's not too hidden.

From then on you will have libuv-devel available for your EL8 builds as well.

jmontleon commented 5 years ago

image

image

ganto commented 5 years ago

Thanks, I was able to add libuv only for EPEL-8. But now there is another issue that you didn't hit because you completely disabled the test suite. I get the following nasty segfault:

Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.PQSqCQ
+ umask 022
+ cd /builddir/build/BUILD
+ cd lxd-3.17
+ export GOPATH=/builddir/build/BUILDROOT/lxd-3.17-0.2.el8.x86_64//usr/share/gocode:/usr/share/gocode
+ GOPATH=/builddir/build/BUILDROOT/lxd-3.17-0.2.el8.x86_64//usr/share/gocode:/usr/share/gocode
+ unset LXD_SOCKET
+ export GO_DQLITE_MULTITHREAD=1
+ GO_DQLITE_MULTITHREAD=1
+ export CGO_CPPFLAGS=-I/builddir/build/BUILDROOT/lxd-3.17-0.2.el8.x86_64/usr/include/lxd/
+ CGO_CPPFLAGS=-I/builddir/build/BUILDROOT/lxd-3.17-0.2.el8.x86_64/usr/include/lxd/
+ export CGO_LDFLAGS=-L/builddir/build/BUILDROOT/lxd-3.17-0.2.el8.x86_64/usr/lib64/lxd/
+ CGO_LDFLAGS=-L/builddir/build/BUILDROOT/lxd-3.17-0.2.el8.x86_64/usr/lib64/lxd/
+ export LD_LIBRARY_PATH=/builddir/build/BUILDROOT/lxd-3.17-0.2.el8.x86_64/usr/lib64/lxd/
+ LD_LIBRARY_PATH=/builddir/build/BUILDROOT/lxd-3.17-0.2.el8.x86_64/usr/lib64/lxd/
+ go test -compiler gc -ldflags '' github.com/lxc/lxd/lxc
ok      github.com/lxc/lxd/lxc  0.029s
+ go test -compiler gc -ldflags '' github.com/lxc/lxd/lxd
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x0]

runtime stack:
runtime.throw(0x1303033, 0x2a)
        /usr/lib/golang/src/runtime/panic.go:608 +0x72
runtime.sigpanic()
        /usr/lib/golang/src/runtime/signal_unix.go:374 +0x2f2

goroutine 32 [syscall]:
runtime.cgocall(0x10586c0, 0xc0002ff190, 0x29)
        /usr/lib/golang/src/runtime/cgocall.go:128 +0x5e fp=0xc0002ff158 sp=0xc0002ff120 pc=0x4131de
github.com/lxc/lxd/vendor/github.com/canonical/go-dqlite/internal/bindings._Cfunc_dqlite_node_create(0x1, 0x7f264003cda0, 0x7f2640039700, 0xc0001aed90, 0x0)
        _cgo_gotypes.go:127 +0x4d fp=0xc0002ff190 sp=0xc0002ff158 pc=0x89df0d
github.com/lxc/lxd/vendor/github.com/canonical/go-dqlite/internal/bindings.NewNode.func3(0xc000000001, 0x7f264003cda0, 0x7f2640039700, 0xc0001aed90, 0xc0002ff218)
        /builddir/build/BUILDROOT/lxd-3.17-0.2.el8.x86_64/usr/share/gocode/src/github.com/lxc/lxd/vendor/github.com/canonical/go-dqlite/internal/bindings/server.go:105 +
0xb9 fp=0xc0002ff1c8 sp=0xc0002ff190 pc=0x89f4f9
github.com/lxc/lxd/vendor/github.com/canonical/go-dqlite/internal/bindings.NewNode(0x1, 0x12b5018, 0x1, 0xc00003ba40, 0x2a, 0x0, 0x0, 0x0)
        /builddir/build/BUILDROOT/lxd-3.17-0.2.el8.x86_64/usr/share/gocode/src/github.com/lxc/lxd/vendor/github.com/canonical/go-dqlite/internal/bindings/server.go:105 +
0x104 fp=0xc0002ff228 sp=0xc0002ff1c8 pc=0x89ea24
github.com/lxc/lxd/vendor/github.com/canonical/go-dqlite.New(0x1, 0x12b5018, 0x1, 0xc00003ba40, 0x2a, 0xc0002ff340, 0x1, 0x1, 0x10, 0x10, ...)
        /builddir/build/BUILDROOT/lxd-3.17-0.2.el8.x86_64/usr/share/gocode/src/github.com/lxc/lxd/vendor/github.com/canonical/go-dqlite/node.go:56 +0xcb fp=0xc0002ff298 
sp=0xc0002ff228 pc=0x8da26b
github.com/lxc/lxd/lxd/cluster.(*Gateway).init(0xc0001c4780, 0xc0000b5c20, 0xc0001ce900)
        /builddir/build/BUILDROOT/lxd-3.17-0.2.el8.x86_64/usr/share/gocode/src/github.com/lxc/lxd/lxd/cluster/gateway.go:616 +0x436 fp=0xc0002ff3d8 sp=0xc0002ff298 pc=0x
b450a6
github.com/lxc/lxd/lxd/cluster.NewGateway(0xc0000b41a0, 0xc00012cc40, 0xc0002ff7f8, 0x2, 0x2, 0xc00003a300, 0x21, 0x0)
        /builddir/build/BUILDROOT/lxd-3.17-0.2.el8.x86_64/usr/share/gocode/src/github.com/lxc/lxd/lxd/cluster/gateway.go:60 +0x1ce fp=0xc0002ff450 sp=0xc0002ff3d8 pc=0xb
4305e
github.com/lxc/lxd/lxd.(*Daemon).init(0xc0001d47e0, 0x12b511e, 0x2)
        /builddir/build/BUILDROOT/lxd-3.17-0.2.el8.x86_64/usr/share/gocode/src/github.com/lxc/lxd/lxd/daemon.go:616 +0x7cb fp=0xc0002ffa80 sp=0xc0002ff450 pc=0xdc169b
github.com/lxc/lxd/lxd.(*Daemon).Init(0xc0001d47e0, 0x1a, 0x0)
        /builddir/build/BUILDROOT/lxd-3.17-0.2.el8.x86_64/usr/share/gocode/src/github.com/lxc/lxd/lxd/daemon.go:497 +0x2f fp=0xc0002ffad8 sp=0xc0002ffa80 pc=0xdc0e2f
github.com/lxc/lxd/lxd.mockStartDaemon(0x12bbd0f, 0x7, 0xc0001b2760)
        /builddir/build/BUILDROOT/lxd-3.17-0.2.el8.x86_64/usr/share/gocode/src/github.com/lxc/lxd/lxd/main_test.go:30 +0x88 fp=0xc0002ffb20 sp=0xc0002ffad8 pc=0xf44488
github.com/lxc/lxd/lxd.(*lxdTestSuite).SetupTest(0xc0001a4640)
        /builddir/build/BUILDROOT/lxd-3.17-0.2.el8.x86_64/usr/share/gocode/src/github.com/lxc/lxd/lxd/main_test.go:62 +0x1b2 fp=0xc0002ffea8 sp=0xc0002ffb20 pc=0xf44762
github.com/lxc/lxd/vendor/github.com/stretchr/testify/suite.Run.func2(0xc000206100)
        /builddir/build/BUILDROOT/lxd-3.17-0.2.el8.x86_64/usr/share/gocode/src/github.com/lxc/lxd/vendor/github.com/stretchr/testify/suite/suite.go:119 +0x3d0 fp=0xc0002
fffa8 sp=0xc0002ffea8 pc=0xcaef90
testing.tRunner(0xc000206100, 0xc0001b4e00)
        /usr/lib/golang/src/testing/testing.go:827 +0xbf fp=0xc0002fffd0 sp=0xc0002fffa8 pc=0x50c6df
runtime.goexit()
        /usr/lib/golang/src/runtime/asm_amd64.s:1333 +0x1 fp=0xc0002fffd8 sp=0xc0002fffd0 pc=0x46ccc1
created by testing.(*T).Run
        /usr/lib/golang/src/testing/testing.go:878 +0x35c

goroutine 1 [chan receive]:
testing.(*T).Run(0xc000206900, 0x12ddedd, 0x16, 0x1357e00, 0x491b01)
        /usr/lib/golang/src/testing/testing.go:879 +0x383
testing.runTests.func1(0xc000142700)
        /usr/lib/golang/src/testing/testing.go:1119 +0x78
testing.tRunner(0xc000142700, 0xc0002a3e08)
        /usr/lib/golang/src/testing/testing.go:827 +0xbf
testing.runTests(0xc0002c85a0, 0x1f373c0, 0x18, 0x18, 0x41c40f)
        /usr/lib/golang/src/testing/testing.go:1117 +0x2aa
testing.(*M).Run(0xc000136600, 0x0)
        /usr/lib/golang/src/testing/testing.go:1034 +0x165
main.main()
        _testmain.go:88 +0x13d

goroutine 4 [select]:
database/sql.(*DB).connectionResetter(0xc00013a0c0, 0x14b73c0, 0xc0000b2700)
        /usr/lib/golang/src/database/sql/sql.go:1014 +0xfb
created by database/sql.OpenDB
        /usr/lib/golang/src/database/sql/sql.go:672 +0x193

goroutine 21 [syscall]:
os/signal.signal_recv(0x7c17e3)
        /usr/lib/golang/src/runtime/sigqueue.go:139 +0x9c
os/signal.loop()
        /usr/lib/golang/src/os/signal/signal_unix.go:23 +0x22
created by os/signal.init.0
        /usr/lib/golang/src/os/signal/signal_unix.go:29 +0x41

goroutine 43 [chan receive]:
testing.(*T).Run(0xc000206100, 0x10b7c33, 0x25, 0xc0001b4e00, 0xc000206900)
        /usr/lib/golang/src/testing/testing.go:879 +0x383
github.com/lxc/lxd/vendor/github.com/stretchr/testify/suite.runTests(0x14ca040, 0xc000206900, 0xc000208c00, 0xd, 0x10)
        /builddir/build/BUILDROOT/lxd-3.17-0.2.el8.x86_64/usr/share/gocode/src/github.com/lxc/lxd/vendor/github.com/stretchr/testify/suite/suite.go:151 +0xbb            
github.com/lxc/lxd/vendor/github.com/stretchr/testify/suite.Run(0xc000206900, 0x14add80, 0xc0001a4640)
        /builddir/build/BUILDROOT/lxd-3.17-0.2.el8.x86_64/usr/share/gocode/src/github.com/lxc/lxd/vendor/github.com/stretchr/testify/suite/suite.go:138 +0x5cc           
github.com/lxc/lxd/lxd.TestContainerTestSuite(0xc000206900)
        /builddir/build/BUILDROOT/lxd-3.17-0.2.el8.x86_64/usr/share/gocode/src/github.com/lxc/lxd/lxd/container_test.go:389 +0x51
testing.tRunner(0xc000206900, 0x1357e00)
        /usr/lib/golang/src/testing/testing.go:827 +0xbf
created by testing.(*T).Run
        /usr/lib/golang/src/testing/testing.go:878 +0x35c

goroutine 3 [select]:
database/sql.(*DB).connectionOpener(0xc00013a0c0, 0x14b73c0, 0xc0000b2700)
        /usr/lib/golang/src/database/sql/sql.go:1001 +0xe8
created by database/sql.OpenDB
        /usr/lib/golang/src/database/sql/sql.go:671 +0x15d
FAIL    github.com/lxc/lxd/lxd  0.138s
error: Bad exit status from /var/tmp/rpm-tmp.PQSqCQ (%check)
    Bad exit status from /var/tmp/rpm-tmp.PQSqCQ (%check)

RPM build errors:
ERROR: Exception(SRPMS/lxd-3.17-0.2.el8.src.rpm) Config(epel-8-x86_64) 13 minutes 40 seconds

There might still be something wrong with the compile flags. Have to look further into this...

ganto commented 5 years ago

Ok, I managed to fix the build test issue. Unfortunately CentOS 8 still doesn't seem to have golang build macros that are comparable with Fedora.

Finally the lxd-related packages are now also available for CentOS 8 :smiley:

jmontleon commented 5 years ago

Cool. You beat me to it. I was about to submit a PR.

Not that it much matters, but this was my answer: https://github.com/ganto/copr-lxc3/compare/master...jmontleon:fix-lxd-test-error?expand=1