-
Notifications
You must be signed in to change notification settings - Fork 567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
profiles: nodejs-common: fix node-gyp failing to build canvas #5202
base: master
Are you sure you want to change the base?
Conversation
So there is a commonly use node (npm) package called "canvas", which uses node-gyp to bind to cairo (2D canvas drawing library). And I assume this is useful outside of this particular case. node-gyp (run by `yarn install` or `npm install`) needs access to `/usr/share/pkgconfig` otherwise it fails to buold the native extensions. So it's either this proposed change, or it can be move to `yarn.profile` or `npm.profile`. I'm not sure it will work when moved to `node-gyp.profile` as that one is invoked as a subprocess. It can also, instead of including `build-systems-common.profile` just whitelist `/usr/share/pkgconfig`.
@@ -67,6 +67,7 @@ include disable-xdg.inc | |||
whitelist /usr/share/doc/node | |||
whitelist /usr/share/nvm | |||
whitelist /usr/share/systemtap/tapset/node.stp | |||
include build-systems-common.profile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- This should go to the end of the file, see https://github.com/netblue30/firejail/blob/master/etc/templates/redirect_alias-profile.template.
- All commands set by
build-systems-common.profile
should be removed here. - All commands unintentional introduced by this must be
ignore
d.
It can also, instead of including
build-systems-common.profile
just whitelist/usr/share/pkgconfig
.
Likely easier than the above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's considerable overlap between nodejs-common and build-systems-common. IMO it's asking for trouble by including the latter in the former. I'll do some testing shortly but adding whitelist /usr/share/pkgconfig
to nodejs-common.profile is the cleaner option.
Fix node-gyp failing to build canvas
Do you have a reproducer? Or a more detailed log of what is actually failing?
Any yarn npm project that has canvas as a dependency. I'm fine with just
|
Yes |
If you mean redo the PR to add whitelist /usr/share/pkgconfig to nodejs-common.profile instead of what you have now: yes please do :-) You might need to rebase for the CI check. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you redo? Add whitelist /usr/share/pkgconfig
and we can bring this in.
So there is a commonly use node (npm) package called "canvas", which uses node-gyp to bind to cairo (2D canvas drawing library). And I assume this is useful outside of this particular case. node-gyp (run by
yarn install
ornpm install
) needs access to/usr/share/pkgconfig
otherwise it fails to buold the native extensions.So it's either this proposed change, or it can be move to
yarn.profile
ornpm.profile
. I'm not sure it will work when moved tonode-gyp.profile
as that one is invoked as a subprocess.It can also, instead of including
build-systems-common.profile
just whitelist/usr/share/pkgconfig
.