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

Firefox extensions discussion #105783

Open
eyJhb opened this issue Dec 3, 2020 · 32 comments
Open

Firefox extensions discussion #105783

eyJhb opened this issue Dec 3, 2020 · 32 comments

Comments

@eyJhb
Copy link
Member

eyJhb commented Dec 3, 2020

Now that #91724 is merged, it would be nice to have a set of Firefox extensions, that one could easily pick from.

Some aspects have been discussed in the PR already, but making a separate issue seems better.
The main reason for packaging is (#91724 (comment))

They're some of the most security critical and most used programs, I think packaging them would be a good idea.

We could make it a part of nixpkgs, e.g. nixpkgs.firefoxExtensions...., but there some things to keep in mind.

  1. Automatically updating them some way ( e.g. like rycee does here https://gitlab.com/rycee/nur-expressions/-/tree/master/pkgs/firefox-addons )
  2. Backporting to stable
  3. Channels that hang (mostly unstable - security risk, but this is a general thing...)
  4. Will create a lot of PRs? One each day or something maybe.

A solution could be, to have it as a separate repository.

@eyJhb eyJhb mentioned this issue Dec 3, 2020
10 tasks
@Mic92
Copy link
Member

Mic92 commented Dec 3, 2020

What if this repo was independent from nixpkgs. Than we would not require to backport updates. Would this not be easier? Than we also would not need to be worried about expression sizes since it does not make nixpkgs bigger.

@eyJhb
Copy link
Member Author

eyJhb commented Dec 3, 2020

The only "issue" is see with that, is that we move away from the Nixpkgs "menorepo" structure.
But I do agree, that it seems like the best solution to do it like that.

However, how would users use it? Because if they need to pin it in their configs or something, then it will quickly become outdated.
I think most users just want to run a nix-channels --update, and then do a rebuild. Having to recalculate a hash of a fetchFromGithub seems tedious for some.

@Mic92
Copy link
Member

Mic92 commented Dec 3, 2020

The only "issue" is see with that, is that we move away from the Nixpkgs "menorepo" structure.
But I do agree, that it seems like the best solution to do it like that.

However, how would users use it? Because if they need to pin it in their configs or something, then it will quickly become outdated.
I think most users just want to run a nix-channels --update, and then do a rebuild. Having to recalculate a hash of a fetchFromGithub seems tedious for some.

There multiple ways: nix-channel, niv or nix flakes. Also see https://github.com/NixOS/nixos-hardware/#setup

@Qubasa
Copy link
Contributor

Qubasa commented Dec 3, 2020

I am not sure if an auto update mechanism is needed. Brower addons in itself very rarely a security issue more often then not updating them automatically is the issue (because addon owner sold the right to marketing firms etc.). I would keep this simple and just let the user update it

@eyJhb
Copy link
Member Author

eyJhb commented Dec 3, 2020

The only "issue" is see with that, is that we move away from the Nixpkgs "menorepo" structure.
But I do agree, that it seems like the best solution to do it like that.
However, how would users use it? Because if they need to pin it in their configs or something, then it will quickly become outdated.
I think most users just want to run a nix-channels --update, and then do a rebuild. Having to recalculate a hash of a fetchFromGithub seems tedious for some.

There multiple ways: nix-channel, niv or nix flakes. Also see https://github.com/NixOS/nixos-hardware/#setup

For a moment I forget how channels works, sorry!

I am not sure if an auto update mechanism is needed. Brower addons in itself very rarely a security issue more often then not updating them automatically is the issue (because addon owner sold the right to marketing firms etc.). I would keep this simple and just let the user update it

Do you then propose to keep them in nixpkgs? Or keep it away from nixpkgs in general, and let the user add them themselves?

EDIT: use the example that you gave in the PR

@Qubasa
Copy link
Contributor

Qubasa commented Dec 3, 2020

I would keep it away from nixpkgs in general, and let the user add them themselves. Or just having the most needed ones in nixpkgs even if they update slowly it's not really an issue.

@Atemu
Copy link
Member

Atemu commented Dec 3, 2020

Split repos are a cool thing but, until Flakes are out of beta, they are a pain to deal with and having them in Nixpkgs would be more convenient in any case.

If the user was on stable and wanted fast updating addons, they could just use a fresher source like nixos-unstable or any separate, fresher repo.

I don't think it'd hurt to include addons in Nixpkgs.

Another consideration I'd like to add is where addons are fetched from. Should we just download the xpis from addons.mozilla.org or should we try to build from source (or both?).

@Qubasa
Copy link
Contributor

Qubasa commented Dec 3, 2020

I mean the building is just getting the source zipped and you are done. As often times the source code is only available through addons.mozilla.org I would just fetch it from there

@bqv
Copy link
Contributor

bqv commented Dec 3, 2020

nix-community/emacs-overlay has existed quite happily for a long time with almost no issues. I don't see how this would be different

@edolstra
Copy link
Member

edolstra commented Dec 4, 2020

Nixpkgs is already too big. I would put this in a separate flake.

@eyJhb
Copy link
Member Author

eyJhb commented Dec 4, 2020

Also somewhat what I thought, it might got too big really fast.
Can we then place it in a repo in nix-community? Not sure who has admin right on this/needs to accept this, @bqv ?

In the future we should be able to do it for Chrome as well! :)

@Atemu
Copy link
Member

Atemu commented Dec 4, 2020

Nixpkgs is already too big. I would put this in a separate flake.

Splitting Nixpkgs subsets off into flakes is something I'd like to see too but flakes aren't even in stable Nix yet (much less something most Nix users have sufficient experience with) and I think such a decision should be made for all such package subsets, not just this one.

We can always spin this one out again once we have come to a consensus on how splitting Nixpkgs should be done but I don't think we should block on that.

Besides, even if we do end up deciding to put it into a flake instead of Nixpkgs, nearly all of the work done should be trivially portable.

@7c6f434c
Copy link
Member

7c6f434c commented Dec 4, 2020 via email

@Mic92
Copy link
Member

Mic92 commented Dec 5, 2020

Also somewhat what I thought, it might got too big really fast.
Can we then place it in a repo in nix-community? Not sure who has admin right on this/needs to accept this, @bqv ?

In the future we should be able to do it for Chrome as well! :)

Anyone in the nix-community org, can move repos there. I can invite anyone to become a member there and also do other administrative tasks if necessary.

@Mic92
Copy link
Member

Mic92 commented Dec 5, 2020

Nixpkgs is already too big. I would put this in a separate flake.

Splitting Nixpkgs subsets off into flakes is something I'd like to see too but flakes aren't even in stable Nix yet (much less something most Nix users have sufficient experience with) and I think such a decision should be made for all such package subsets, not just this one.

I find Niv quite easy to use in this case.

@beardhatcode
Copy link
Contributor

beardhatcode commented Dec 5, 2020

I have some concerns regarding the preservation of settings. The fetchFirefoxAddon function generates a new extid depending on the hash of the extension url. I don't think Firefox will show the settings of abcdef@myext to qrstu@myext.

My suggestion would be to use the extid from the manifest and complain if there are duplicates in it. Alternatively allow specifying the extid.

@doronbehar
Copy link
Contributor

I haven't read the whole thread, but I just updated my system and what happened??

ZENIX-full-2020-12-05T16:37:43+02:00

I manage my firefox extensions imperatively and I'm fine with that! I don't want to bring Nix into every aspect of my life 😭.

@bbigras
Copy link
Contributor

bbigras commented Dec 5, 2020

@doronbehar maybe check #105796

@doronbehar
Copy link
Contributor

Thanks. That mistake was rather disastrous in terms of my time wasted because with that commit merged to my channels I can install extensions but all of them got removed and now I have to give them all of the settings I had before 😠 .

@Qubasa
Copy link
Contributor

Qubasa commented Dec 5, 2020

I have some concerns regarding the preservation of settings. The fetchFirefoxAddon function generates a new extid depending on the hash of the extension url. I don't think firefox will show the settings of abcdef@myext to qrstu@myext.

My suggestion would be to use the extid from the manifest and complain if there are duplicates in it. Alternatively allow specifying the extid.

I opened up a pull request for this. Getting the extid from the addon is very complicated I would just stick to a fixed but unique name given by the user.
#106000

@wiltaylor
Copy link
Contributor

Yeah any chance we can have this as a separate Firefox package? So you have the main line one behaves like it currently does and we have a FirefoxWithAddons or something? I really don't want to waste a heap of my weekend reinstalling and re configuring my Firefox plugins again because it wasn't tested properly.

@archseer
Copy link
Member

archseer commented Dec 6, 2020

Thanks. That mistake was rather disastrous in terms of my time wasted because with that commit merged to my channels I can install extensions but all of them got removed and now I have to give them all of the settings I had before 😠 .

Even worse, the setting somehow propagated to my other machines via Firefox Sync so I got to reconfigure all the extensions I haven't touched in years.

@andir
Copy link
Member

andir commented Dec 7, 2020

Until yesterdays PR that fixed the outbreak I wasn't even aware of the PR or else I'd have commented earlier.

I pretty much like the prospect of having the ability to declare my firefox extensions and have them sync'ed between all my devices without requiring firefox sync (or similar impurities).

My feedback here is not to discourage the contributor frrom further changes but just reflects my thoughts on the whole issue.

While overall positive with the idea the change looks very intrusive and is probably a hack (copying the binaries around…) and should probably have receive proper review on the method used. The PR that introduced the breakage didn't remotely comply with our contribution guidelines (just look at the commits…). Which should be the lower end of the bar. I welcome the added documentation to the newly added options but that doesn't guarantee any kind of release quality.

Modifying the Firefox code (and to that extend the wrapper) always deals with valuable state of the user. Regardless of the fact that this is on unstable or not we should take better precautions on these cases. The worst that can happen with a Firefox bump is most likely loosing the entire profile Thankfully we only lost plugins and their configuration with this change.

In the previous round of this change I commented with a request for tests (#74297 (comment)) as the wrapper script is gaining in complexity with these kinds of hacks being applied. As the contributor stated that he didn't have the time back then and the PR went stale after a while I eventually forgot about the initiative. This time around I'd have appreciated a ping on the PR as the feedback would have probably been the same. We need to properly ensure we aren't screwing around with users data. The API surface of the wrapper script has laregly grown evolutionary and probably needs a make over. I am not asking this from the contributor of the latest change but having been in the know about this change would have ensured more active feedback from those that have been caring about Firefox for >3y now.

So lets please take a learning from this and be more careful with merging. Having to wait months for changes to go in because of formalities might sound stupid and is tiresome but IMHO proper reviews and pinging the right maintainers should be warranted.

The tip of the iceberg is discussing making things a flake while flakes aren't even beta quality software or standardized at all... If we want to be taken seriously we should probably not do such ad-hoc decisions that are incompatible with most of the users?

@Qubasa
Copy link
Contributor

Qubasa commented Dec 7, 2020

Until yesterdays PR that fixed the outbreak I wasn't even aware of the PR or else I'd have commented earlier.

I pretty much like the prospect of having the ability to declare my firefox extensions and have them sync'ed between all my devices without requiring firefox sync (or similar impurities).

My feedback here is not to discourage the contributor frrom further changes but just reflects my thoughts on the whole issue.

While overall positive with the idea the change looks very intrusive and is probably a hack (copying the binaries around…) and should probably have receive proper review on the method used. The PR that introduced the breakage didn't remotely comply with our contribution guidelines (just look at the commits…). Which should be the lower end of the bar. I welcome the added documentation to the newly added options but that doesn't guarantee any kind of release quality.

Modifying the Firefox code (and to that extend the wrapper) always deals with valuable state of the user. Regardless of the fact that this is on unstable or not we should take better precautions on these cases. The worst that can happen with a Firefox bump is most likely loosing the entire profile Thankfully we only lost plugins and their configuration with this change.

In the previous round of this change I commented with a request for tests (#74297 (comment)) as the wrapper script is gaining in complexity with these kinds of hacks being applied. As the contributor stated that he didn't have the time back then and the PR went stale after a while I eventually forgot about the initiative. This time around I'd have appreciated a ping on the PR as the feedback would have probably been the same. We need to properly ensure we aren't screwing around with users data. The API surface of the wrapper script has laregly grown evolutionary and probably needs a make over. I am not asking this from the contributor of the latest change but having been in the know about this change would have ensured more active feedback from those that have been caring about Firefox for >3y now.

So lets please take a learning from this and be more careful with merging. Having to wait months for changes to go in because of formalities might sound stupid and is tiresome but IMHO proper reviews and pinging the right maintainers should be warranted.

The tip of the iceberg is discussing making things a flake while flakes aren't even beta quality software or standardized at all... If we want to be taken seriously we should probably not do such ad-hoc decisions that are incompatible with most of the users?

Ah yes great idea asking for a testing harness. The only problem with it is that writing and maintaining it is hackier and more work then the Firefox wrapper implementation itself. Also I am intrigued of your definition of a hack, because copying executables and linking configuration into the right places is how NixOS works. Fact is, there is a reason nobody till now wrote a Firefox addon wrapper, because it's a ton of work. Was there a slip up on my part and on part of the reviewers? Yes and I'm sorry for the inconvenience it brought to people on unstable, I did my utmost to quickly address the issue, it certainly won't happen again.
But also... it's always easy to point fingers from a safe distance and demanding a testing harness .

@bqv
Copy link
Contributor

bqv commented Dec 7, 2020

Honestly, I think its understandable for firefox, but for other general and less popular packages, I would not like to encourage dragging out PRs unnecesarily. Looking at the number of abandoned and stale PRs, the constant burnouts of PR authors, and hearing of other people who like me are entirely and absolutely disincentivised to contribute tangibly to nixpkgs, that's something that should be getting better, not worse.

I do happen to believe leaning on flakes will lead to that too, but I'm sure most of you are familiar with my opinions on both matters.

@7c6f434c
Copy link
Member

7c6f434c commented Dec 7, 2020 via email

@xaverdh
Copy link
Contributor

xaverdh commented Dec 7, 2020

NixOS is all about symlinks, actually copying an executable is rare. So there is a difference here.

The firefox runtime is somewhat special in this regard (for "security" reasons). You can read up on that here and the why the alternative approach was shot down here.

edit: ah I think you already read it ;-)

@taku0
Copy link
Contributor

taku0 commented Dec 7, 2020

I don't think automated tests could prevent the issue for this case. Ensuring updates don't break existing profiles is hard. It is not unusual that tests are bigger than actual code. Careful reviews and manual tests could save us, though I was too late to review it. An option is enforcing two or more approving reviews for non-trivial changes. For trivial changes, a committer can attach a label and make a bot approves it automatically. It would increase stale PRs, though.

@7c6f434c
Copy link
Member

7c6f434c commented Dec 7, 2020 via email

@xaverdh
Copy link
Contributor

xaverdh commented Dec 13, 2020

This is getting slightly off topic, but can't we automate pinging the maintainers?

@Mic92 Mic92 mentioned this issue Dec 14, 2020
10 tasks
@stale
Copy link

stale bot commented Jun 16, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 16, 2021
@ShalokShalom
Copy link

Was there ever any solution to this?

Do we have such a repo today?

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests