Skip to content
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

nwjs, nwjs084: added versioning for the nwjs package #310809

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ilya-epifanov
Copy link
Contributor

@ilya-epifanov ilya-epifanov commented May 11, 2024

Description of changes

Added nwjs084 package, as later versions break some software, including:

betaflight-configurator
blheli-configurator
inav-blackbox-explorer

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@ilya-epifanov
Copy link
Contributor Author

ilya-epifanov commented May 11, 2024

required for #310811 #310813 #310813 #310815

@@ -19221,7 +19221,25 @@ with pkgs;

norminette = callPackage ../development/tools/norminette { };

nwjs = callPackage ../development/tools/nwjs { };
nwjs = callPackage ../development/tools/nwjs {
version = "0.85.0";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason nwjs is reverted to 0.85.0? Only betaflight-configurator has issues prompting the need for 0.84.0 correct?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also all-packages may not be the best place for this, perhaps nwjs can be reworked to allow overrideAttrs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rolling back to 0.85 was just a mistake, I've fixed it now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A number of packages were broken by an upgrade to 0.85:

blheli-configurator (new package, https://github.com/NixOS/nixpkgs/pull/310820)
betaflight-configurator
inav-blackbox-explorer (new package, https://github.com/NixOS/nixpkgs/pull/310813)

Probably betaflight-blackbox-explorer is affected, too (I haven't packaged it yet)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

regarding overrideAttrs, I don't see how it's possible to make it work without code duplication. We're interpolating the version in the url, so we'd have to do it again with a new value for version.
I made version and hashes the same kind of input as sdk. Also, python uses a similar approach to allow for multiple versions

@qubitnano
Copy link
Contributor

CC @MikaelFangel

@MikaelFangel
Copy link
Contributor

MikaelFangel commented May 12, 2024

I think the general idea is fine, but it also leaves me with some questions. Wouldn't it be better if the package was built from scratch? Because nwjs uses chromium it's susceptible to some of the same vulnerabilities as chrome and by keeping the old binaries as an option we would have to determine which is vulnerable to what CVE and to my knowledge we wouldn't be able to patch those.

Edit:
Another thought if we build from scratch wouldn't it be a better solution to use a flag to enable compilation with ffmpeg instead of using the prebuilt? (Addressing #310810)

@qubitnano
Copy link
Contributor

nwjs doesn't appear to backport chromium fixes like electron, so we'd be on our own trying to maintain something as big as that. nwjs from source would be nice, but just looking at the build instructions these are big projects and who knows if hydra may be able to handle it.

Ideally upstream for these packages should be notified new versions of nwjs don't work anymore. It's probably safer to just mark these as broken or let users override an older version with an overlay at their own risk.

@MikaelFangel
Copy link
Contributor

Okay kinda had the feeling that it just wouldn't be that easy.

But, then we agree that leaving this package as is and fixing/mark the packages that may be broken from upgrades of nwjs is the best solution?

@ofborg ofborg bot requested a review from MikaelFangel May 13, 2024 10:39
@ilya-epifanov ilya-epifanov changed the title nwjs084: added versioning for the nwjs package nwjs, nwjs084: added versioning for the nwjs package May 13, 2024
@ilya-epifanov
Copy link
Contributor Author

@eclairevoyant what should we do with the pkgs/by-name check here?

@qubitnano
Copy link
Contributor

qubitnano commented May 13, 2024 via email

@ilya-epifanov
Copy link
Contributor Author

Doesn't marking something as insecure require a CVE or eqv.? Also, the packages I'm fixing by the downgrade don't even access the internet (almost), don't open arbitrary files etc. So most probably not exploitable regardless of the vulnerability.

@ilya-epifanov
Copy link
Contributor Author

I think since nwjs doesn't maintain backwards compatibility we just have to provide multiple versions. It should be easier once they hit 1.0 (that is if they follow semantic versioning)

@MikaelFangel
Copy link
Contributor

Doesn't marking something as insecure require a CVE or eqv.? Also, the packages I'm fixing by the downgrade don't even access the internet (almost), don't open arbitrary files etc. So most probably not exploitable regardless of the vulnerability.

You're correct but because nwjs includes both Chromium and NodeJS it could be susceptible to the same CVE's as both NodeJS and Chromium. Previously we have marked packages including either with their projects' CVE's.

@ilya-epifanov
Copy link
Contributor Author

@qubitnano @MikaelFangel guys, sorry for bumping the conversation but several packages are now broken and several others can't be merged because they're blocked on this change. I'm happy to refactor this but I'd rather do something right now to fix the outstanding issues

@qubitnano
Copy link
Contributor

I personally wouldn't use all-packages for the hashes. nwjs could be migrated to by-name and finalAttrs, and the nwjs084 package could then simply just use overrideAttrs to set version 0.84.0 and the old hashes. It needs to be by-name anyway per CI.

@ilya-epifanov
Copy link
Contributor Author

@qubitnano it's not currently compatible with overrideAttrs. The pkgs/by-name check is optional. I suggest merging a fix so that other packages can benefit from it.

@ilya-epifanov
Copy link
Contributor Author

Let's just roll back nwjs to 0.84 then. A number of packages are broken by a system-wide upgrade.

@MikaelFangel
Copy link
Contributor

MikaelFangel commented Jun 1, 2024

I have created a pr reverting the breaking change against 23.11.

See: #315071

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants