Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Temporally build package in another location/partition
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
abduct
Apprentice
Apprentice


Joined: 19 Mar 2015
Posts: 215

PostPosted: Tue Apr 24, 2018 2:43 am    Post subject: Temporally build package in another location/partition Reply with quote

So I need to emerge some packages that may have large space requirements for building (clang and llvm specifically). I have very little space, more or less around 1GB. I have a partition mounted that has 4.3GB.

I am wondering if there is a way to let emerge build clang and llvm in another location (the 4.3GB partition) and then move the compiled binaries into it's normal installation location.

I've seen the `PORTAGE_TMPDIR' environment variable from `man 5 make.conf' Is this what I need to set? If so do I need to set it inside make.conf or can I inline it into the emerge command such as

Code:
PORTAGE_TMPDIR=/mount/point emerge -a clang


Also is it possible to find how much space is required for building packages? Even if it is only a estimate.

Thanks
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9679
Location: almost Mile High in the USA

PostPosted: Tue Apr 24, 2018 6:42 am    Post subject: Reply with quote

Yes this should work. I normally edit my make.conf and point PORTAGE_TMPDIR always point to a disk with space on it or a tmpfs. Same goes for PORTDIR to keep the tree somewhere else too possibly.

However at 1GB remaining, you're going to be in a lot of hurt soon, (installed) packages tend to continue to increase in size...
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54237
Location: 56N 3W

PostPosted: Tue Apr 24, 2018 9:16 am    Post subject: Reply with quote

abduct,

You can set PORTAGE_TMPDIR on a per package basis. Then you won't forget.

See how to use /etc/portage/package.env and /etc/portage/env/ in
Code:
man portage

Hint: describe what is to be done in files in /etc/portage/env/ and the packages it applies to in /etc/portage/package.env
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
wraeth
Developer
Developer


Joined: 08 May 2007
Posts: 72
Location: Australia

PostPosted: Tue Apr 24, 2018 10:53 am    Post subject: Reply with quote

As for checking how much space a package will require to build, the only way is to actually build the package. Packages could do something as simple as copy the extracted distfiles into their install location, or dump an arbitrary string to a file up to whatever length it likes.

Some of the bigger packages do have a check in place prior to building to ensure enough space - as estimated by the maintainer - is available in the designated PORTAGE_TMPDIR.
Back to top
View user's profile Send private message
freke
l33t
l33t


Joined: 23 Jan 2003
Posts: 977
Location: Somewhere in Denmark

PostPosted: Tue Apr 24, 2018 3:14 pm    Post subject: Reply with quote

I'm using a tmpfs for /var/tmp/portage
/etc/fstab
Code:
...
tmpfs                   /var/tmp/portage        tmpfs   size=2G,uid=portage,gid=portage,mode=775,noatime        0 0
...

And then for some of the bigger builds:
/etc/portage/env/notmpfs.conf
Code:
PORTAGE_TMPDIR="/var/tmp/notmpfs"

and
/etc/portage/package.env
Code:
## No tmpfs
dev-db/mariadb notmpfs.conf
sys-devel/gcc notmpfs.conf
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