Re: [gentoo-user] nodejs emerge fails

2018-06-26 Thread Andrew Udvare


> On 2018-06-26, at 16:18, Jack  wrote:
> 
> On 2018.06.26 15:44, Christoph Böhmwalder wrote:
>> On Tue, Jun 26, 2018 at 03:15:09PM -0400, Andrew Udvare wrote:
>> > It should not be accessing this location in any case. What is the 
>> > environment like? What does env show? emerge --config output?
>> >
>> > It would almost seem like you have $HOME set to /home/christoph while 
>> > Portage is running (as root).
>> The only thing that stands out about `env` is that XDG_CONFIG_HOME is set to 
>> /home/christoph/.config (running as root). I'm not sure if it's supposed to 
>> be this way, but I didn't find anything in my dotfiles that would suggest 
>> that I'm overwriting it.
> That's a normal setting for you.  The problem is that when you did sudo or su 
> to run emerge, it simply stayed in the environment, causing this problem.  
> When you su or sudo to run emerge (or just log in directly as root) you need 
> to be sure to do so in a way that cleans out your environment.  I keep 
> thinking to file a bug to request emerge to sanitize the environment, or at 
> least add an option to make it do so.  I often forget to use them, but I 
> created scripts (cleanemerge and cleanebuild) to do that for me.

I had a similar issue with BC_ENV_ARGS being set while running Portage. If you 
have this set, some packages (I forget which) that use bc will try to read your 
.bcrc file and they will most likely fail. The scripts I used to use would 
unset this variable before calling emerge.

I wrote Pezu ( https://github.com/Tatsh/pezu ) as a replacement for said 
scripts. It isolates the environment automatically since everything is run with 
the Subprocess module in Python (which does not inherit the environment by 
default). I run into less issues this way.

Andrew


Re: [gentoo-user] nodejs emerge fails

2018-06-26 Thread Andrew Udvare



> On 2018-06-26, at 15:44, Christoph Böhmwalder  
> wrote:
> 
> On Tue, Jun 26, 2018 at 03:15:09PM -0400, Andrew Udvare wrote:
>> It should not be accessing this location in any case. What is the 
>> environment like? What does env show? emerge --config output?
>> 
>> It would almost seem like you have $HOME set to /home/christoph while 
>> Portage is running (as root).
> 
> The only thing that stands out about `env` is that XDG_CONFIG_HOME is set to
> /home/christoph/.config (running as root). I'm not sure if it's supposed
> to be this way, but I didn't find anything in my dotfiles that would
> suggest that I'm overwriting it.

Use `su -` to become root so the environment you are coming from gets ignored. 
I actually have su aliased to `su -` because I rarely need the opposite 
functionality. Otherwise just `unset XDG_CONFIG_HOME` and other things that 
reference your user when you become root.

You should only have these, if any at all:

# env | fgrep XDG
XDG_DATA_DIRS=/usr/local/share:/usr/share
XDG_CONFIG_DIRS=/etc/xdg

What it would seems to be is that npm uses configstore 
https://www.npmjs.com/package/configstore and since it sees XDG_CONFIG_HOME is 
set and is a real path it tries to write a file to there. It falls back to 
tmpdir otherwise which would be writable by Portage.

https://github.com/yeoman/configstore/blob/master/index.js#L11
https://github.com/yeoman/configstore/blob/master/index.js#L32

> 
> $HOME points to /root.
> 
> I'm not sure what you mean by "emerge --config output"? Running
> `emerge --config` just gives:

Sorry I meant `emerge --info`.

Andrew


Re: [gentoo-user] nodejs emerge fails

2018-06-26 Thread Jack

On 2018.06.26 15:44, Christoph Böhmwalder wrote:

On Tue, Jun 26, 2018 at 03:15:09PM -0400, Andrew Udvare wrote:
> It should not be accessing this location in any case. What is the  
environment like? What does env show? emerge --config output?

>
> It would almost seem like you have $HOME set to /home/christoph  
while Portage is running (as root).


The only thing that stands out about `env` is that XDG_CONFIG_HOME is  
set to /home/christoph/.config (running as root). I'm not sure if  
it's supposed to be this way, but I didn't find anything in my  
dotfiles that would suggest that I'm overwriting it.
That's a normal setting for you.  The problem is that when you did sudo  
or su to run emerge, it simply stayed in the environment, causing this  
problem.  When you su or sudo to run emerge (or just log in directly as  
root) you need to be sure to do so in a way that cleans out your  
environment.  I keep thinking to file a bug to request emerge to  
sanitize the environment, or at least add an option to make it do so.   
I often forget to use them, but I created scripts (cleanemerge and  
cleanebuild) to do that for me.


$HOME points to /root.

I'm not sure what you mean by "emerge --config output"? Running  
`emerge --config` just gives:


# emerge --config nodejs

Configuring pkg...

Warning: ccache requested but no masquerade dircan be found in  
/usr/lib*/ccache/bin

 * pkg_config() is not defined: 'nodejs-8.11.1.ebuild'


--
Regards,
Christoph



Jack



Re: [gentoo-user] nodejs emerge fails

2018-06-26 Thread Christoph Böhmwalder
On Tue, Jun 26, 2018 at 03:15:09PM -0400, Andrew Udvare wrote:
> It should not be accessing this location in any case. What is the environment 
> like? What does env show? emerge --config output?
> 
> It would almost seem like you have $HOME set to /home/christoph while Portage 
> is running (as root).

The only thing that stands out about `env` is that XDG_CONFIG_HOME is set to
/home/christoph/.config (running as root). I'm not sure if it's supposed
to be this way, but I didn't find anything in my dotfiles that would
suggest that I'm overwriting it.

$HOME points to /root.

I'm not sure what you mean by "emerge --config output"? Running
`emerge --config` just gives:


# emerge --config nodejs

Configuring pkg...

Warning: ccache requested but no masquerade dircan be found in 
/usr/lib*/ccache/bin
 * pkg_config() is not defined: 'nodejs-8.11.1.ebuild'


--
Regards,
Christoph



Re: [gentoo-user] nodejs emerge fails

2018-06-26 Thread Andrew Udvare


> On 2018-06-26, at 10:47, Christoph Böhmwalder  
> wrote:
> 
> Hi,
> 
> Lately I've been getting the following error while trying to emerge
> nodejs:
> 
 
> * Failed to set XATTR_PAX markings -me 
> /var/tmp/portage/net-libs/nodejs-8.11.1/image/usr/bin/node.

This might be cause for concern. This does not look like it should fail.

> * ACCESS DENIED:  open_wr:  
> /home/christoph/.config/configstore/update-notifier-npm.json.331767419
> * ACCESS DENIED:  unlink:   
> /home/christoph/.config/configstore/update-notifier-npm.JSON.331767419

It should not be accessing this location in any case. What is the environment 
like? What does env show? emerge --config output?

It would almost seem like you have $HOME set to /home/christoph while Portage 
is running (as root).

Andrew