Opened 2 years ago

Closed 2 years ago

#54167 closed defect (invalid)

Gimp staging fails: expects lbzip2; uses wrong `touch`, found in node_modules

Reported by: paxperscientiam (Chris) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.4.1
Keywords: Cc: dbevans (David B. Evans), ci42
Port: gimp, npm2

Description

Attempting to install gimp +quartz -- the variant is probably irrelevant -- without lbzip2 previously installed will result in a staging failure.

After installing lbzip2, the error went away

An entirely separate issues presented itself when staging failed once more. It seems that macports is being thrown by, in this case, node executables symlinked to the prefix directory.

In my case, port tried to use the wrong touch. Instead of using /usr/bin/touch, it attempted to use ${prefix}/touch, which corresponds to touch.js in the global node modules directory.

Since I could not think of a way to get port to ignore this executable, I temporarily uninstalled it via npm.

In summary, after installing lbzip2 and uninstalling npm's touch.js, I was successfully able to execute port install gimp +quartz.

Sorry I don't have access to the logs anymore.

Change History (3)

comment:1 Changed 2 years ago by raimue (Rainer Müller)

Cc: ci42 added
Port: npm2 added

This looks like two entirely separate issues. The first one is the use of lbzip2. MacPorts uses lbzip2 if available, but should fall back to bzip2 normally. I don't know why it did not work in this case...

The second problem is with touch. Why does npm even install directly into ${prefix}? This should not happen at all. ${prefix} is reserved by MacPorts. If npm is allowed to overrides basic (POSXI) shell functionality such as touch(1), all kinds of problems during builds could occur. Even if MacPorts itself would use /usr/bin/touch, build scripts can be broken by this.

comment:2 Changed 2 years ago by paxperscientiam (Chris)

This looks like two entirely separate issues. The first one is the use of lbzip2. MacPorts uses lbzip2 if available, but should fall back to bzip2 normally. I don't know why it did not work in this case...

I wish I knew! I just ran port installed bzip2 and got back bzip2 @1.0.6_0 (active); so, I do have it installed.

I checked nodejs7 for notes, but there are none. npm4 does, however, have notes.

npm4 has the following notes:

It is not recommended to install packages globally. But if you do so please be aware that they won't get cleaned up when you deactivate or uninstall npm4. Globally installed packages will remain in /opt/local/lib/node_modules/ until you manually delete them.

So, not recommended. Fine, but that's certainly not strong enough nor clear enough language. Is the reference to '/opt/local/lib/node_modules/' hardcoded, or is it programmatically generated based on some config variable?

I just installed a node module and it spits out this: /opt/local/bin/rollup -> /opt/local/lib/node_modules/rollup/bin/rollup

So, something is "mapping" ${PREFIX}/lib/node_modules/module/bin/executable to ${PREFIX}/bin/executable. I'm not sure what is doing this.

EDIT:

In my case, port tried to use the wrong touch. Instead of using /usr/bin/touch, it attempted to use ${prefix}/touch, which corresponds to touch.js in the global node modules directory.

What I should have said is that port tried to use ${prefix}/bin/touch, which maps to ${prefix}/lib/node_modules/something/touch.js

Last edited 2 years ago by paxperscientiam (Chris) (previous) (diff)

comment:3 Changed 2 years ago by ryandesign (Ryan Schmidt)

Resolution: invalid
Status: newclosed

Errors about lbzip2 are typically erroneous and you should ignore them. The real problem will be earlier on in the log file.

Uninstall whatever npm module provided that touch command.

Note: See TracTickets for help on using tickets.