Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Support Pacman 6 #1411

Closed
huyz-git opened this issue Nov 4, 2020 · 10 comments
Closed

Feature request: Support Pacman 6 #1411

huyz-git opened this issue Nov 4, 2020 · 10 comments
Labels
Status: Resolved Issue or question has been answered or fixed successfully Type: Feature Request

Comments

@huyz-git
Copy link

huyz-git commented Nov 4, 2020

Is your feature request related to a problem? Please describe.
Since 2020.5 pacman-git adds an useful feature: parallel download. It would be great if yay can support pacman-git.

Describe the solution you'd like
yay cannot be built against pacman-git. It seems that pacman-git has changed some ABI in alpm, this prevents yay from building against pacman-git.

Describe alternatives you've considered
Most features of yay-bin or yay built against pacman works on pacman-git. The only thing I found that doesn't work is the -Ss command.

Additional context
If I run yay-bin with pacman-git, it will SIGSEGV when using -Ss command:

$ curl -L -O https://github.com/Jguer/yay/releases/download/v10.1.0/yay_10.1.0_x86_64.tar.gz
$ tar xvf ./yay_10.1.0_x86_64.tar.gz
$ cd yay_10.1.0_x86_64
$ ./yay -Ss something
unexpected fault address 0xffffffff
fatal error: fault
[signal SIGSEGV: segmentation violation code=0x1 addr=0xffffffff pc=0x558cb7010279]

goroutine 1 [running]:
runtime.throw(0x558cb71dc3fd, 0x5)
        runtime/panic.go:1116 +0x74 fp=0xc0000d9a08 sp=0xc0000d99d8 pc=0x558cb6ec1874
runtime.sigpanic()
        runtime/signal_unix.go:727 +0x405 fp=0xc0000d9a38 sp=0xc0000d9a08 pc=0x558cb6ed7365
github.com/Jguer/go-alpm/v2.(*list).forEach(0xffffffff, 0xc0000d9a80, 0x558cb700d24f, 0xc000680000)
        github.com/Jguer/go-alpm/v2@v2.0.1/types.go:113 +0x39 fp=0xc0000d9a60 sp=0xc0000d9a38 pc=0x558cb7010279
github.com/Jguer/go-alpm/v2.PackageList.ForEach(0xffffffff, 0x558cb91f4910, 0xc0000fc160, 0xffffff01, 0xc0000fc160)
        github.com/Jguer/go-alpm/v2@v2.0.1/package.go:48 +0x69 fp=0xc0000d9ab0 sp=0xc0000d9a60 pc=0x558cb700e429
github.com/Jguer/go-alpm/v2.(*PackageList).ForEach(0xc0000fc140, 0xc0000fc160, 0x1, 0x1)
        <autogenerated>:1 +0x51 fp=0xc0000d9ae8 sp=0xc0000d9ab0 pc=0x558cb70158f1
github.com/Jguer/yay/v10/pkg/db/ialpm.(*AlpmExecutor).SyncPackages.func1(0x558cb7304260, 0xc000338010, 0xc0000d9bf0, 0x558cb6e99470)
        github.com/Jguer/yay/v10/pkg/db/ialpm/alpm.go:326 +0x164 fp=0xc0000d9b40 sp=0xc0000d9ae8 pc=0x558cb71b0404
github.com/Jguer/go-alpm/v2.DBList.ForEach.func1(0x558cb9211b50, 0x0, 0x7f3b5592f438)
        github.com/Jguer/go-alpm/v2@v2.0.1/db.go:36 +0x75 fp=0xc0000d9b80 sp=0xc0000d9b40 pc=0x558cb70109b5
github.com/Jguer/go-alpm/v2.(*list).forEach(0x558cb920f960, 0xc0000d9bc8, 0xc0001ae910, 0xc000680000)
        github.com/Jguer/go-alpm/v2@v2.0.1/types.go:113 +0x4a fp=0xc0000d9ba8 sp=0xc0000d9b80 pc=0x558cb701028a
github.com/Jguer/go-alpm/v2.DBList.ForEach(0x558cb920f960, 0x558cb91f4910, 0xc000013740, 0x558cb7518401, 0xc000013740)
        github.com/Jguer/go-alpm/v2@v2.0.1/db.go:35 +0x69 fp=0xc0000d9bf8 sp=0xc0000d9ba8 pc=0x558cb700c5c9
github.com/Jguer/go-alpm/v2.(*DBList).ForEach(0xc0001ae900, 0xc000013740, 0x1, 0xc00012fc70)
        <autogenerated>:1 +0x51 fp=0xc0000d9c30 sp=0xc0000d9bf8 pc=0x558cb7014f91
github.com/Jguer/yay/v10/pkg/db/ialpm.(*AlpmExecutor).SyncPackages(0xc0001b8270, 0xc0001ae910, 0x1, 0x1, 0x558cb75184b8, 0xc00012fcd0, 0x558cb6ecbfca)
        github.com/Jguer/yay/v10/pkg/db/ialpm/alpm.go:319 +0xb0 fp=0xc0000d9c68 sp=0xc0000d9c30 pc=0x558cb71ae330
main.queryRepo(0xc0001ae910, 0x1, 0x1, 0x558cb7305460, 0xc0001b8270, 0x4c4, 0x63f, 0x0)
        github.com/Jguer/yay/v10/query.go:244 +0x5b fp=0xc0000d9cc8 sp=0xc0000d9c68 pc=0x558cb71d245b
main.syncSearch(0xc0001ae910, 0x1, 0x1, 0x558cb7305460, 0xc0001b8270, 0xc0001ae900, 0x0)
        github.com/Jguer/yay/v10/query.go:160 +0x165 fp=0xc0000d9d80 sp=0xc0000d9cc8 pc=0x558cb71d18e5
main.handleSync(0xc00012ff28, 0x558cb7305460, 0xc0001b8270, 0x1, 0xffffffffffffffff)
        github.com/Jguer/yay/v10/cmd.go:259 +0x174 fp=0xc0000d9e38 sp=0xc0000d9d80 pc=0x558cb71b4714
main.handleCmd(0xc00012ff28, 0x558cb7305460, 0xc0001b8270, 0x0, 0x301)
        github.com/Jguer/yay/v10/cmd.go:165 +0x14e fp=0xc0000d9eb0 sp=0xc0000d9e38 pc=0x558cb71b2f8e
main.main()
        github.com/Jguer/yay/v10/main.go:130 +0x46a fp=0xc0000d9f88 sp=0xc0000d9eb0 pc=0x558cb71cb0aa
runtime.main()
        runtime/proc.go:204 +0x209 fp=0xc0000d9fe0 sp=0xc0000d9f88 pc=0x558cb6ec4089
runtime.goexit()
        runtime/asm_amd64.s:1374 +0x1 fp=0xc0000d9fe8 sp=0xc0000d9fe0 pc=0x558cb6ef6321

goroutine 28 [IO wait]:
internal/poll.runtime_pollWait(0x7f3b2c7790b8, 0x72, 0x558cb72fb7e0)
        runtime/netpoll.go:220 +0x65
internal/poll.(*pollDesc).wait(0xc000146318, 0x72, 0x558cb72fb700, 0x558cb74ad9a0, 0x0)
        internal/poll/fd_poll_runtime.go:87 +0x47
internal/poll.(*pollDesc).waitRead(...)
        internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Read(0xc000146300, 0xc000280000, 0xd85b, 0xd85b, 0x0, 0x0, 0x0)
        internal/poll/fd_unix.go:159 +0x1a5
net.(*netFD).Read(0xc000146300, 0xc000280000, 0xd85b, 0xd85b, 0x203000, 0xc, 0xc000288031)
        net/fd_posix.go:55 +0x51
net.(*conn).Read(0xc000094000, 0xc000280000, 0xd85b, 0xd85b, 0x0, 0x0, 0x0)
        net/net.go:182 +0x90
crypto/tls.(*atLeastReader).Read(0xc0002c2500, 0xc000280000, 0xd85b, 0xd85b, 0x582a, 0xc00028802c, 0xc00012b730)
        crypto/tls/conn.go:779 +0x62
bytes.(*Buffer).ReadFrom(0xc000096280, 0x558cb72fa640, 0xc0002c2500, 0x558cb6e97127, 0x558cb7298960, 0x558cb72dece0)
        bytes/buffer.go:204 +0xbb
crypto/tls.(*Conn).readFromUntil(0xc000096000, 0x558cb72fa960, 0xc000094000, 0x5, 0xc000094000, 0xc000288031)
        crypto/tls/conn.go:801 +0xf3
crypto/tls.(*Conn).readRecordOrCCS(0xc000096000, 0x0, 0x0, 0xc00012bd38)
        crypto/tls/conn.go:608 +0x125
crypto/tls.(*Conn).readRecord(...)
        crypto/tls/conn.go:576
crypto/tls.(*Conn).Read(0xc000096000, 0xc000132000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
        crypto/tls/conn.go:1252 +0x15f
bufio.(*Reader).Read(0xc00009a0c0, 0xc0004318b8, 0x9, 0x9, 0xc00012bd38, 0x558cb72f1d00, 0x558cb713920d)
        bufio/bufio.go:227 +0x224
io.ReadAtLeast(0x558cb72fa520, 0xc00009a0c0, 0xc0004318b8, 0x9, 0x9, 0x9, 0xc000064060, 0x0, 0x558cb72fa7e0)
        io/io.go:314 +0x89
io.ReadFull(...)
        io/io.go:333
net/http.http2readFrameHeader(0xc0004318b8, 0x9, 0x9, 0x558cb72fa520, 0xc00009a0c0, 0x0, 0x558c00000000, 0xc0000129f0, 0x0)
        net/http/h2_bundle.go:1477 +0x89
net/http.(*http2Framer).ReadFrame(0xc000431880, 0xc0000129f0, 0x0, 0x0, 0x0)
        net/http/h2_bundle.go:1735 +0xa5
net/http.(*http2clientConnReadLoop).run(0xc00012bfa8, 0x0, 0x0)
        net/http/h2_bundle.go:8240 +0x8f
net/http.(*http2ClientConn).readLoop(0xc000582c00)
        net/http/h2_bundle.go:8168 +0x71
created by net/http.(*http2Transport).newClientConn
        net/http/h2_bundle.go:7173 +0x66e

yay fails to build with pacman-git:

$ git clone https://github.com/Jguer/yay
$ cd yay
$ make
go build -v -trimpath -mod=readonly -modcacherw -ldflags '-s -w  -X "main.yayVersion=10.0.0" -X "main.localePath=/usr/local/share/locale/"' -buildmode=pie -o yay
go: downloading github.com/Morganamilo/go-srcinfo v1.0.0
go: downloading github.com/leonelquinteros/gotext v1.4.0
go: downloading golang.org/x/crypto v0.0.0-20200930160638-afb6bcd081ae
go: downloading github.com/Morganamilo/go-pacmanconf v0.0.0-20180910220353-9c5265e1b14f
go: downloading github.com/mikkeloscar/aur v0.0.0-20200113170522-1cb4e2949656
go: downloading golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f
go: downloading github.com/Jguer/go-alpm/v2 v2.0.1
go: downloading gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776
runtime/cgo
github.com/Jguer/go-alpm/v2
net
vendor/golang.org/x/net/http/httpproxy
net/textproto
crypto/x509
vendor/golang.org/x/net/http/httpguts
crypto/tls
net/http/httptrace
net/http
# github.com/Jguer/go-alpm/v2
/home/abc/go/pkg/mod/github.com/!jguer/go-alpm/v2@v2.0.1/db.go:165:35: cannot convert _Cfunc_alpm_db_search(db.ptr, needles) (type _Ctype_int) to type unsafe.Pointer
/home/abc/go/pkg/mod/github.com/!jguer/go-alpm/v2@v2.0.1/db.go:165:52: not enough arguments in call to _Cfunc_alpm_db_search
        have (*_Ctype_struct___alpm_db_t, *_Ctype_struct___alpm_list_t)
        want (*_Ctype_struct___alpm_db_t, *_Ctype_struct___alpm_list_t, **_Ctype_struct___alpm_list_t)
net/http/httptest
github.com/Jguer/yay/v10/pkg/settings/exe
github.com/Jguer/yay/v10/pkg/vcs
github.com/Jguer/yay/v10/pkg/settings
github.com/Jguer/yay/v10/pkg/news
make: *** [Makefile:127:yay] Error 2
@huyz-git huyz-git added Status: Discussion Open Topic is being considered and open for discussion Type: Feature Request labels Nov 4, 2020
@Morganamilo
Copy link
Contributor

I used to maintain the pacman-git branch here and on go-alpm. Honestly it's super annoying keeping them rebased against master. I wish go had #ifdefs.

@bpierre
Copy link

bpierre commented Dec 4, 2020

The first alpha of Pacman 6 has been released: http://allanmcrae.com/2020/12/pacman-6-0-0alpha1/

Should this issue be renamed to “Support Pacman 6”?

@Jguer Jguer changed the title Feature request: support pacman-git Feature request: Support Pacman 6 Dec 4, 2020
@kageurufu
Copy link

kageurufu commented Dec 4, 2020

My locally built copy of yay is working fine with the pacman 6.0.0-alpha1 right now

EDIT: Nevermind, segfault when searching for a package. yay -Syu worked earlier

@Jguer Jguer added Status: Resolved Issue or question has been answered or fixed successfully and removed Status: Discussion Open Topic is being considered and open for discussion labels Dec 9, 2020
@Jguer
Copy link
Owner

Jguer commented Dec 9, 2020

yay-git now works with both pacman 5 and 6. A recompile is needed though.

So next question is how to detect pacman update to add yay to the update list or how to make sure they get updated together

@grandchild
Copy link

Bump the pkgrel for yay and yay-git when pacman-6 gets released? That wouldn't work for people on testing though, but it's the easy way out.

@stale
Copy link

stale bot commented Feb 8, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Feb 8, 2021
@Jguer Jguer removed the stale label Feb 8, 2021
@lucki1000
Copy link

After upgrading pacman to version 6, If got this errror while using yay:

yay -Syua 
yay: error while loading shared libraries: libalpm.so.12: cannot open shared object file: No such file or directory

but since i've updated pacman i only have libalpm.so.13

@kageurufu
Copy link

Rebuild yay after upgrading pacman.

@lucki1000
Copy link

Worked, thanks

@Jguer
Copy link
Owner

Jguer commented Jun 1, 2021

Closed in favor of #1519

@Jguer Jguer closed this as completed Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Resolved Issue or question has been answered or fixed successfully Type: Feature Request
Projects
None yet
Development

No branches or pull requests

7 participants