Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
'Ebuild variable' vanishes during normal portage emerge
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
Rutcha
n00b
n00b


Joined: 13 Dec 2019
Posts: 7
Location: Brasil, Latin America

PostPosted: Sun Jan 09, 2022 12:33 pm    Post subject: 'Ebuild variable' vanishes during normal portage emerge Reply with quote

I'm trying to use 'ebuild Variables' in my make.conf, like ${PN} for package name or ${PF} package full name so that I cant set a PGO (profile guided optimization) directory.
More or less CFLAGS="-fprofile-dir=/var/tmp/pgo/${PN}".

But what I get is a blank, nothing for that variable as if it didn't exist at all. Am I using it in the right place ?
My other solution is to write an script and make custom entries for every single package inside /etc/portage/env/...
So as to avoid this big work, I believe these 'ebuild variables' were made for.

For those not totally aware of PGO, PGO needs a folder for each package to store profiling data. Thanks, all ladies and gentlemen!
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3918

PostPosted: Sun Jan 09, 2022 3:23 pm    Post subject: Reply with quote

Is
Code:

/var/tmp/pgo/${PN

a file?
Can you post a sample?
Does it contain
Code:

CFLAGS="..............."

I am not sure if portage sources make.conf with every package or just once.
If the former would not
Code:

.  /var/tmp/pgo/${PN}

would work?
Or maybe
Code:

CFLAGS="........."
PGOFLAGS=$(cat  /var/tmp/pgo/${PN})
CFLAGS="${CFLAGS} ${PGOFLAGS}"

Just a wild guess.....
_________________
:)
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1933

PostPosted: Sun Jan 09, 2022 4:22 pm    Post subject: Re: 'Ebuild variable' vanishes during normal portage emerge Reply with quote

Rutcha wrote:
I'm trying to use 'ebuild Variables' in my make.conf, like ${PN} for package name or ${PF} package full name so that I cant set a PGO (profile guided optimization) directory.
More or less CFLAGS="-fprofile-dir=/var/tmp/pgo/${PN}".

But what I get is a blank, nothing for that variable as if it didn't exist at all. Am I using it in the right place ?
My other solution is to write an script and make custom entries for every single package inside /etc/portage/env/...
So as to avoid this big work, I believe these 'ebuild variables' were made for.

For those not totally aware of PGO, PGO needs a folder for each package to store profiling data. Thanks, all ladies and gentlemen!


AFAIK, ebuild variables are not available in make.conf as make.conf is read before ebuilds variables are defined.

In addition, it is not valid for a build to write outside of $WORKDIR or $T as it will likely be denied by the sandbox.
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9614
Location: beyond the rim

PostPosted: Tue Jan 11, 2022 11:43 am    Post subject: Re: 'Ebuild variable' vanishes during normal portage emerge Reply with quote

Rutcha wrote:
I'm trying to use 'ebuild Variables' in my make.conf, like ${PN} for package name or ${PF} package full name so that I cant set a PGO (profile guided optimization) directory.
More or less CFLAGS="-fprofile-dir=/var/tmp/pgo/${PN}".

But what I get is a blank, nothing for that variable as if it didn't exist at all. Am I using it in the right place ?

Nope, ebuild variables, as the name implies, can only be used inside ebuild contexts (ebuilds, eclasses, scripts used within ebuilds, ...). They are not defined when make.conf or other global configuration files are processed.
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