Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
building golang takes long
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
rzdndr
Tux's lil' helper
Tux's lil' helper


Joined: 26 Jul 2024
Posts: 112

PostPosted: Tue Oct 29, 2024 6:56 am    Post subject: building golang takes long Reply with quote

Hello

I have to install fzf. That has a dependency to golang. But golang takes too long to install, and I do not know why. It is trying to do

Code:
/usr/lib/go-bootstrap/bin/go build -o cmd/dist/dist ./cmd/dist


I have 16G memory, but neofetch reports 1200MB being used, and htop reports the same.

Any ideas?
Back to top
View user's profile Send private message
Banana
Moderator
Moderator


Joined: 21 May 2004
Posts: 1796
Location: Germany

PostPosted: Tue Oct 29, 2024 7:50 am    Post subject: Reply with quote

What exactly do you mean by "But golang takes too long to install...."? Just too long for your taste or does en error happen?
_________________
Forum Guidelines

PFL - Portage file list - find which package a file or command belongs to.
My delta-labs.org snippets do expire
Back to top
View user's profile Send private message
rzdndr
Tux's lil' helper
Tux's lil' helper


Joined: 26 Jul 2024
Posts: 112

PostPosted: Tue Oct 29, 2024 7:57 am    Post subject: Reply with quote

Banana wrote:
What exactly do you mean by "But golang takes too long to install...."? Just too long for your taste or does en error happen?


Not to my taste. It took me ~2 hrs to build golang. Did not expect that.

i did not set the makeopts because of a description in the manual.

Quote:
# If left undefined, Portage's default behavior is to:
# - set the MAKEOPTS jobs value to the same number of threads returned by `nproc`
# - set the MAKEOPTS load-average value slightly above the number of threads returned by `nproc`, due to it being a damped value
# Please replace '4' as appropriate for the system (min(RAM/2GB, threads), or leave it unset.
MAKEOPTS="-j4 -l5"


and

Quote:
Further, as of Portage 3.0.53[2], if left undefined, Portage's default behavior is to set the MAKEOPTS load-average value to the same number of threads returned by nproc


I am assuming that it would use as much memory as possible, but the system only uses ~2G out of 16G, that is also something unexpected.

Regards
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3769
Location: Rasi, Finland

PostPosted: Tue Oct 29, 2024 9:49 am    Post subject: Reply with quote

rzdndr wrote:
I am assuming that it would use as much memory as possible, but the system only uses ~2G out of 16G, that is also something unexpected.

Regards
The memory usage of compilation processes vary vastly.

The 2Gig per compiler thread is just a result of rough estimate what the worst case scenario would be.

I recently ran few tests compiling qtwebengine, which is notoriously long and memory intensive process.
During the compilation process I saw maximum of 1.3G per thread memory usage. It could have been more, I didn't track the memory usage very accurately.

Then there's the possibility of extra memory usage if you place your PORTAGE_TMPDIR on tmpfs. Again referring to qtwebengine compilation, it seemed like it took around 5G of memory from the tmpfs mount.

So no. Each compilation process doesn't (and normally shouldn't) use all your memory.

CPU usage on the other hand can be easily utilized to the max with larger packages.
_________________
..: Zucca :..

My gentoo installs:
init=/sbin/openrc-init
-systemd -logind -elogind seatd

Quote:
I am NaN! I am a man!


Last edited by Zucca on Tue Oct 29, 2024 2:40 pm; edited 1 time in total
Back to top
View user's profile Send private message
eschwartz
Developer
Developer


Joined: 29 Oct 2023
Posts: 240

PostPosted: Tue Oct 29, 2024 12:23 pm    Post subject: Reply with quote

rzdndr wrote:
Banana wrote:
What exactly do you mean by "But golang takes too long to install...."? Just too long for your taste or does en error happen?


Not to my taste. It took me ~2 hrs to build golang. Did not expect that.


There is a simple, common solution to the issue of it not being to one's taste to spend a long time compiling certain packages:

https://www.gentoo.org/news/2023/12/29/Gentoo-binary.html
Back to top
View user's profile Send private message
rzdndr
Tux's lil' helper
Tux's lil' helper


Joined: 26 Jul 2024
Posts: 112

PostPosted: Tue Oct 29, 2024 1:32 pm    Post subject: Reply with quote

eschwartz wrote:
rzdndr wrote:
Banana wrote:
What exactly do you mean by "But golang takes too long to install...."? Just too long for your taste or does en error happen?


Not to my taste. It took me ~2 hrs to build golang. Did not expect that.


There is a simple, common solution to the issue of it not being to one's taste to spend a long time compiling certain packages:

https://www.gentoo.org/news/2023/12/29/Gentoo-binary.html


Was looking at go-bin package. :? I see I could have gotten go from the binhost hosts.
Back to top
View user's profile Send private message
sam_
Developer
Developer


Joined: 14 Aug 2020
Posts: 2027

PostPosted: Tue Oct 29, 2024 3:02 pm    Post subject: Reply with quote

Note that I think there is some long-standing odd interaction between sandbox and building Go where sometimes it seems to take ages to build.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
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