public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] nodejs emerge fails
@ 2018-06-26 14:47 Christoph Böhmwalder
  2018-06-26 19:15 ` Andrew Udvare
  0 siblings, 1 reply; 6+ messages in thread
From: Christoph Böhmwalder @ 2018-06-26 14:47 UTC (permalink / raw
  To: gentoo-user

Hi,

Lately I've been getting the following error while trying to emerge
nodejs:

>>> Install nodejs-8.11.1 into /var/tmp/portage/net-libs/nodejs-8.11.1/image/ category net-libs
make -j9 -l8 install DESTDIR=/var/tmp/portage/net-libs/nodejs-8.11.1/image/
make -C out BUILDTYPE=Release V=1
  touch 95791f913e60cc9fcb29d34b6a73660b74906c54.intermediate
  LD_LIBRARY_PATH=/var/tmp/portage/net-libs/nodejs-8.11.1/work/node-v8.11.1/out/Release/lib.host:/var/tmp/portage/net-libs/nodejs-8.11.1/work/node-v8.11.1/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../deps/v8/src/inspector; mkdir -p /var/tmp/portage/net-libs/nodejs-8.11.1/work/node-v8.11.1/out/Release/obj/gen/src/inspector/protocol /var/tmp/portage/net-libs/nodejs-8.11.1/work/node-v8.11.1/out/Release/obj/gen/include/inspector; python ../../third_party/inspector_protocol/CodeGenerator.py --jinja_dir ../../third_party --output_base "/var/tmp/portage/net-libs/nodejs-8.11.1/work/node-v8.11.1/out/Release/obj/gen/src/inspector" --config inspector_protocol_config.json
rm 95791f913e60cc9fcb29d34b6a73660b74906c54.intermediate
if [ ! -r node -o ! -L node ]; then ln -fs out/Release/node node; fi
/usr/bin/python2.7 tools/install.py install '/var/tmp/portage/net-libs/nodejs-8.11.1/image/' '/usr'
 * PT_PAX marking -m /var/tmp/portage/net-libs/nodejs-8.11.1/image/usr/bin/node with paxctl
 * PT_PAX marking -m /var/tmp/portage/net-libs/nodejs-8.11.1/image/usr/bin/node with scanelf
 * XATTR_PAX marking -me /var/tmp/portage/net-libs/nodejs-8.11.1/image/usr/bin/node with setfattr
 * Failed to set XATTR_PAX markings -me /var/tmp/portage/net-libs/nodejs-8.11.1/image/usr/bin/node.
 * 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

┌─────────────────────────────────────────────────────────────┐
│                   npm update check failed                   │
│             Try running with sudo or get access             │
│            to the local update config store via             │
│ sudo chown -R $USER:$(id -gn $USER) /home/christoph/.config │
└─────────────────────────────────────────────────────────────┘
>>> Completed installing nodejs-8.11.1 into /var/tmp/portage/net-libs/nodejs-8.11.1/image/

 * Final size of build directory: 302712 KiB (295.6 MiB)
 * Final size of installed tree:   44524 KiB ( 43.4 MiB)

 * --------------------------- ACCESS VIOLATION SUMMARY ---------------------------
 * LOG FILE: "/var/log/sandbox/sandbox-26618.log"
 *
VERSION 1.0
FORMAT: F - Function called
FORMAT: S - Access Status
FORMAT: P - Path as passed to function
FORMAT: A - Absolute Path (not canonical)
FORMAT: R - Canonical Path
FORMAT: C - Command Line

F: open_wr
S: deny
P: /home/christoph/.config/configstore/update-notifier-npm.json.331767419
A: /home/christoph/.config/configstore/update-notifier-npm.json.331767419
R: /home/christoph/.config/configstore/update-notifier-npm.json.331767419
C: npm

F: unlink
S: deny
P: /home/christoph/.config/configstore/update-notifier-npm.json.331767419
A: /home/christoph/.config/configstore/update-notifier-npm.json.331767419
R: /home/christoph/.config/configstore/update-notifier-npm.json.331767419
C: npm
 * --------------------------------------------------------------------------------


I've set the permissions on the ~/.config/configstore directory to 777
for testing purposes, and it still doesn't work.

Anyone have any ideas?

--
Regards,
Christoph


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

* Re: [gentoo-user] nodejs emerge fails
  2018-06-26 14:47 [gentoo-user] nodejs emerge fails Christoph Böhmwalder
@ 2018-06-26 19:15 ` Andrew Udvare
  2018-06-26 19:44   ` Christoph Böhmwalder
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Udvare @ 2018-06-26 19:15 UTC (permalink / raw
  To: gentoo-user


> On 2018-06-26, at 10:47, Christoph Böhmwalder <christoph@boehmwalder.at> 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



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

* Re: [gentoo-user] nodejs emerge fails
  2018-06-26 19:15 ` Andrew Udvare
@ 2018-06-26 19:44   ` Christoph Böhmwalder
  2018-06-26 20:18     ` Jack
  2018-06-26 20:47     ` Andrew Udvare
  0 siblings, 2 replies; 6+ messages in thread
From: Christoph Böhmwalder @ 2018-06-26 19:44 UTC (permalink / raw
  To: gentoo-user

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


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

* Re: [gentoo-user] nodejs emerge fails
  2018-06-26 19:44   ` Christoph Böhmwalder
@ 2018-06-26 20:18     ` Jack
  2018-06-26 20:53       ` Andrew Udvare
  2018-06-26 20:47     ` Andrew Udvare
  1 sibling, 1 reply; 6+ messages in thread
From: Jack @ 2018-06-26 20:18 UTC (permalink / raw
  To: gentoo-user

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


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

* Re: [gentoo-user] nodejs emerge fails
  2018-06-26 19:44   ` Christoph Böhmwalder
  2018-06-26 20:18     ` Jack
@ 2018-06-26 20:47     ` Andrew Udvare
  1 sibling, 0 replies; 6+ messages in thread
From: Andrew Udvare @ 2018-06-26 20:47 UTC (permalink / raw
  To: gentoo-user



> On 2018-06-26, at 15:44, Christoph Böhmwalder <christoph@boehmwalder.at> 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

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

* Re: [gentoo-user] nodejs emerge fails
  2018-06-26 20:18     ` Jack
@ 2018-06-26 20:53       ` Andrew Udvare
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Udvare @ 2018-06-26 20:53 UTC (permalink / raw
  To: gentoo-user


> On 2018-06-26, at 16:18, Jack <ostroffjh@users.sourceforge.net> 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

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

end of thread, other threads:[~2018-06-26 20:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-26 14:47 [gentoo-user] nodejs emerge fails Christoph Böhmwalder
2018-06-26 19:15 ` Andrew Udvare
2018-06-26 19:44   ` Christoph Böhmwalder
2018-06-26 20:18     ` Jack
2018-06-26 20:53       ` Andrew Udvare
2018-06-26 20:47     ` Andrew Udvare

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