public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] Portage and languages with built-in cache support
@ 2023-04-25  8:07 Anna (cybertailor) Vyalkova
  2023-04-25 14:09 ` Maciej Barć
  0 siblings, 1 reply; 4+ messages in thread
From: Anna (cybertailor) Vyalkova @ 2023-04-25  8:07 UTC (permalink / raw
  To: gentoo-dev

Hello,

Portage can use ccache and sccache to speed up builds, but some
languages (like Go and Nim) support caches out-of-the-box. It's not fair
that we can't use them.

I'd like to start discussion on this topic. What should be the preferred
method of handling build caches?

I think adding more stuff to Portage is a bad idea, and caches should be
handled by corresponding "${lang}-utils" eclasses. It can be as simple
as checking some variable, passing necessary flags and placing a couple
of 'addwrite' calls for sandbox.

Of course, such feature needs to be strictly opt-in.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] Portage and languages with built-in cache support
  2023-04-25  8:07 [gentoo-dev] Portage and languages with built-in cache support Anna (cybertailor) Vyalkova
@ 2023-04-25 14:09 ` Maciej Barć
  2023-04-26 13:43   ` Anna (cybertailor) Vyalkova
  0 siblings, 1 reply; 4+ messages in thread
From: Maciej Barć @ 2023-04-25 14:09 UTC (permalink / raw
  To: gentoo-dev; +Cc: Anna


[-- Attachment #1.1.1: Type: text/plain, Size: 1144 bytes --]

You would also have to have correct permissions on cache dirs 
(root:portage or portage:portage) this also means that the cache dir 
will have to be set during build explicitly.
Do both Nim and Go support setting it?

W dniu 25.04.2023 o 10:07, Anna (cybertailor) Vyalkova pisze:
> Hello,
> 
> Portage can use ccache and sccache to speed up builds, but some
> languages (like Go and Nim) support caches out-of-the-box. It's not fair
> that we can't use them.
> 
> I'd like to start discussion on this topic. What should be the preferred
> method of handling build caches?
> 
> I think adding more stuff to Portage is a bad idea, and caches should be
> handled by corresponding "${lang}-utils" eclasses. It can be as simple
> as checking some variable, passing necessary flags and placing a couple
> of 'addwrite' calls for sandbox.
> 
> Of course, such feature needs to be strictly opt-in.
> 

-- 
Have a great day!

~ Maciej XGQT Barć

xgqt@gentoo.org
Gentoo Linux developer
(dotnet, emacs, math, ml, nim, scheme, sci)
https://wiki.gentoo.org/wiki/User:Xgqt
9B0A 4C5D 02A3 B43C 9D6F D6B1 14D7 4A1F 43A6 AC3C

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 10875 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] Portage and languages with built-in cache support
  2023-04-25 14:09 ` Maciej Barć
@ 2023-04-26 13:43   ` Anna (cybertailor) Vyalkova
  2023-06-01 16:03     ` William Hubbs
  0 siblings, 1 reply; 4+ messages in thread
From: Anna (cybertailor) Vyalkova @ 2023-04-26 13:43 UTC (permalink / raw
  To: gentoo-dev

On 2023-04-25 16:09, Maciej Barć wrote:
> You would also have to have correct permissions on cache dirs 
> (root:portage or portage:portage) this also means that the cache dir 
> will have to be set during build explicitly.
> Do both Nim and Go support setting it?

Yes. For Nim it would be something like that:

	# nim.cfg
	--nimcache:"${EPREFIX}/var/cache/nim/${CATEGORY}/${PN}"

And for Go:

	export GOCACHE="${EPREFIX}/var/cache/go"

on some condition.

The only problem is, they don't support cleaning cache automatically. So
it needs to be done manually or with cron.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] Portage and languages with built-in cache support
  2023-04-26 13:43   ` Anna (cybertailor) Vyalkova
@ 2023-06-01 16:03     ` William Hubbs
  0 siblings, 0 replies; 4+ messages in thread
From: William Hubbs @ 2023-06-01 16:03 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 862 bytes --]

On Wed, Apr 26, 2023 at 06:43:04PM +0500, Anna (cybertailor) Vyalkova wrote:
> On 2023-04-25 16:09, Maciej Barć wrote:
> > You would also have to have correct permissions on cache dirs 
> > (root:portage or portage:portage) this also means that the cache dir 
> > will have to be set during build explicitly.
> > Do both Nim and Go support setting it?
> 
> Yes. For Nim it would be something like that:
> 
> 	# nim.cfg
> 	--nimcache:"${EPREFIX}/var/cache/nim/${CATEGORY}/${PN}"
> 
> And for Go:
> 
> 	export GOCACHE="${EPREFIX}/var/cache/go"

This would be very easy to do in the go-module eclass, but we would need
to test how it works with go upgrades. This cache is for compiled
objects, so I hope it would clean the cache and restart it with
every go upgrade since compiled go objects are not compatible between go
versions.

William

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-06-01 16:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-25  8:07 [gentoo-dev] Portage and languages with built-in cache support Anna (cybertailor) Vyalkova
2023-04-25 14:09 ` Maciej Barć
2023-04-26 13:43   ` Anna (cybertailor) Vyalkova
2023-06-01 16:03     ` William Hubbs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox