Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Problem to compile dev-go/go-md2man
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
misterxx
Guru
Guru


Joined: 18 Apr 2004
Posts: 514

PostPosted: Wed Apr 17, 2024 11:09 am    Post subject: Reply with quote

I have also tried it with the linked patch. Unfortunately, you get the same compilation error here too.

Code:
>> Emerging (1 of 1) dev-go/go-md2man-2.0.3::gentoo
 * go-md2man-2.0.3.tar.gz BLAKE2B SHA512 size ;-) ...                                                                                                    [ ok ]
>>> Unpacking source...
>>> Unpacking go-md2man-2.0.3.tar.gz to /var/tmp/portage/dev-go/go-md2man-2.0.3/work
>>> Source unpacked in /var/tmp/portage/dev-go/go-md2man-2.0.3/work
>>> Preparing source in /var/tmp/portage/dev-go/go-md2man-2.0.3/work/go-md2man-2.0.3 ...
 * =============================================================================================================================================================
 * Applying user patches from /etc/portage/patches ...
 * Applying 21f901d9f38ede08f22fdf733166b0283ae4bde2.patch ...                                                                                           [ ok ]
 * User patches applied.
 * =============================================================================================================================================================
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/dev-go/go-md2man-2.0.3/work/go-md2man-2.0.3 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/dev-go/go-md2man-2.0.3/work/go-md2man-2.0.3 ...
make -j8 BUILD_FLAGS=-mod=vendor build
CGO_ENABLED=0 go build -mod=vendor -o bin/go-md2man
WORK=/var/tmp/portage/dev-go/go-md2man-2.0.3/temp/go-build3937421242
-buildmode=pie requires external (cgo) linking, but cgo is not enabled
make: *** [Makefile:49: bin/go-md2man] Error 1
 * ERROR: dev-go/go-md2man-2.0.3::gentoo failed (compile phase):
 *   emake failed
 *
 * If you need support, post the output of `emerge --info '=dev-go/go-md2man-2.0.3::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-go/go-md2man-2.0.3::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/dev-go/go-md2man-2.0.3/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-go/go-md2man-2.0.3/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-go/go-md2man-2.0.3/work/go-md2man-2.0.3'
 * S: '/var/tmp/portage/dev-go/go-md2man-2.0.3/work/go-md2man-2.0.3'


The result remains the same, even if you store the ebuild file with version 2.0.3-r1 in the overlay or not.

I suspect the cause of the problem is the package dev-lang/go, because as soon as I mask its versions up to 1.21.8,

Code:
emerge --ask --regex-search-auto=y @golang-rebuild

These are the packages that would be merged, in order:

Calculating dependencies... done!
Dependency resolution took 52.38 s (backtrack: 0/20).

[ebuild     UD ] dev-lang/go-1.21.7 [1.22.2]
[ebuild   R   ~] app-containers/docker-cli-25.0.4
[ebuild     UD~] dev-go/go-md2man-2.0.3 [2.0.3-r1]
[ebuild   R   *] app-misc/mkcert-1.4.4
[ebuild   R   ~] app-containers/runc-1.1.12
[ebuild   R   ~] app-containers/containerd-1.7.14
[ebuild   R   ~] app-containers/docker-25.0.4


can be executed successfully.

But what doesn't work after that is starting docker containers. And that's what worries me the most.
Back to top
View user's profile Send private message
misterxx
Guru
Guru


Joined: 18 Apr 2004
Posts: 514

PostPosted: Wed Sep 11, 2024 12:44 pm    Post subject: Reply with quote

Hello community,

unfortunately the bug in dev-lang/go is still not fixed in version 1.22.0. Also the current experimental version 1.23.0 still seems to have the bug.

The last version with which go-md2man could be compiled was dev-lang/go-1.21.11. Unfortunately it was uninstalled during the system update.

Unfortunately, go-1.21.11 is no longer available in the portage. So you cannot install it as usual.

Now the question if and how I can install go-1.21.11 in my system?

Thanks for the help in advance.
Back to top
View user's profile Send private message
misterxx
Guru
Guru


Joined: 18 Apr 2004
Posts: 514

PostPosted: Fri Sep 27, 2024 1:12 pm    Post subject: Reply with quote

Even with the latest version dev-lang/go-1.23.1 I get exactly the same error message when I compile dev-go/md2man-2.0.3. Waiting for the solution since April 2024 ;-( Unfortunately in vain.
Back to top
View user's profile Send private message
omelius
n00b
n00b


Joined: 15 Jun 2011
Posts: 11

PostPosted: Mon Oct 14, 2024 8:34 am    Post subject: Reply with quote

Hello,

I've enabled CGO using patch file and it worked for me. Also i've found that in version 2.0.4 and 2.0.5 there is misisng vendor folder, so when i've added it from version 2.0.3 using patch it also worked without disabling network sandbox and also without CGO patch.

Then the next step was similar patch to enable CGO for containerd.

/etc/portage/patches/dev-go/go-md2man-2.0.3/enable_cgo.patch
Code:

diff --git a/Makefile b/Makefile
index 437fc99..e1a2f2f 100644
--- a/Makefile
+++ b/Makefile
@@ -16,7 +16,7 @@ test:
 
 bin/go-md2man: actual_build_flags := $(BUILD_FLAGS) -o bin/go-md2man
 bin/go-md2man: bin
-   @CGO_ENABLED=0 go build $(actual_build_flags)
+   @CGO_ENABLED=1 go build $(actual_build_flags)
 
 bin:
    @mkdir ./bin


/etc/portage/patches/app-containers/containerd-1.7.15/enable_cgo.patch
Code:

diff --git a/Makefile b/Makefile
index 905dfed..ac71ea5 100644
--- a/Makefile
+++ b/Makefile
@@ -33,7 +33,7 @@ TEST_IMAGE_LIST ?=
 VERSION ?= $(shell git describe --match 'v[0-9]*' --dirty='.m' --always)
 REVISION=$(shell git rev-parse HEAD)$(shell if ! git diff --no-ext-diff --quiet --exit-code; then echo .m; fi)
 PACKAGE=github.com/containerd/containerd
-SHIM_CGO_ENABLED ?= 0
+SHIM_CGO_ENABLED ?= 1
 
 ifneq "$(strip $(shell command -v $(GO) 2>/dev/null))" ""
    GOOS ?= $(shell $(GO) env GOOS)
Back to top
View user's profile Send private message
misterxx
Guru
Guru


Joined: 18 Apr 2004
Posts: 514

PostPosted: Tue Oct 22, 2024 1:43 pm    Post subject: Reply with quote

Thank you for the suggestions!

Unfortunately the patch did not work for me.

Code:
matrixstorage /etc/portage # emerge go-md2man
Calculating dependencies... done!
Dependency resolution took 12.47 s (backtrack: 0/20).


>>> Verifying ebuild manifests

>>> Emerging (1 of 1) dev-go/go-md2man-2.0.3::gentoo
 * go-md2man-2.0.3.tar.gz BLAKE2B SHA512 size ;-) ...                                                                                            [ ok ]
>>> Unpacking source...
>>> Unpacking go-md2man-2.0.3.tar.gz to /var/tmp/portage/dev-go/go-md2man-2.0.3/work
>>> Source unpacked in /var/tmp/portage/dev-go/go-md2man-2.0.3/work
>>> Preparing source in /var/tmp/portage/dev-go/go-md2man-2.0.3/work/go-md2man-2.0.3 ...
 * =====================================================================================================================================================
 * Applying user patches from /etc/portage/patches ...
 * Applying enable-cgo.patch ...
patching file Makefile
Hunk #1 FAILED at 16.
1 out of 1 hunk FAILED -- saving rejects to file Makefile.rej                                                                                    [ !! ]
 * ERROR: dev-go/go-md2man-2.0.3::gentoo failed (prepare phase):
 *   patch -p1  failed with /etc/portage/patches/dev-go/go-md2man-2.0.3/enable-cgo.patch
 *
 * Call stack:
 *               ebuild.sh, line  136:  Called src_prepare
 *             environment, line 1944:  Called default
 *      phase-functions.sh, line  873:  Called default_src_prepare
 *      phase-functions.sh, line  949:  Called __eapi8_src_prepare
 *             environment, line  313:  Called eapply_user
 *             environment, line  837:  Called eapply '/etc/portage/patches/dev-go/go-md2man-2.0.3/enable-cgo.patch'
 *             environment, line  797:  Called _eapply_patch '/etc/portage/patches/dev-go/go-md2man-2.0.3/enable-cgo.patch'
 *             environment, line  735:  Called __helpers_die 'patch -p1  failed with /etc/portage/patches/dev-go/go-md2man-2.0.3/enable-cgo.patch'
 *   isolated-functions.sh, line  112:  Called die
 * The specific snippet of code:
 *         die "$@"
 *
 * If you need support, post the output of `emerge --info '=dev-go/go-md2man-2.0.3::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-go/go-md2man-2.0.3::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/dev-go/go-md2man-2.0.3/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-go/go-md2man-2.0.3/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-go/go-md2man-2.0.3/work/go-md2man-2.0.3'
 * S: '/var/tmp/portage/dev-go/go-md2man-2.0.3/work/go-md2man-2.0.3



I am currently trying out an alternative patch, I will write here afterwards if it worked.
Back to top
View user's profile Send private message
misterxx
Guru
Guru


Joined: 18 Apr 2004
Posts: 514

PostPosted: Tue Oct 22, 2024 2:39 pm    Post subject: Reply with quote

The patching of go-md2man worked as follows:

Code:
--- go-md2man-2.0.3/Makefile   2023-10-10 20:05:46.000000000 +0200
+++ Makefile   2024-10-21 21:29:36.307238898 +0200
@@ -16,7 +16,7 @@
 
 bin/go-md2man: actual_build_flags := $(BUILD_FLAGS) -o bin/go-md2man
 bin/go-md2man: bin
-   @CGO_ENABLED=0 go build $(actual_build_flags)
+   @CGO_ENABLED=1 go build $(actual_build_flags)
 
 bin:
    @mkdir ./bin
Back to top
View user's profile Send private message
misterxx
Guru
Guru


Joined: 18 Apr 2004
Posts: 514

PostPosted: Tue Oct 22, 2024 2:41 pm    Post subject: Reply with quote

The patching of containerd-1.7.22 worked as follows:

Code:
--- /Makefile   2024-10-21 06:58:29.817958556 +0200
+++ Makefile   2024-10-21 07:03:39.072092347 +0200
@@ -33,7 +33,7 @@
 VERSION ?= $(shell git describe --match 'v[0-9]*' --dirty='.m' --always)
 REVISION=$(shell git rev-parse HEAD)$(shell if ! git diff --no-ext-diff --quiet --exit-code; then echo .m; fi)
 PACKAGE=github.com/containerd/containerd
-SHIM_CGO_ENABLED ?= 0
+SHIM_CGO_ENABLED ?= 1
 
 ifneq "$(strip $(shell command -v $(GO) 2>/dev/null))" ""
    GOOS ?= $(shell $(GO) env GOOS)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum