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

wire-desktop: refactor to add Darwin support #64931

Merged
merged 2 commits into from Jul 27, 2019

Conversation

toonn
Copy link
Contributor

@toonn toonn commented Jul 16, 2019

Motivation for this change

The derivation didn't have Darwin support but the software does.
I refactored the package putting all the linux/darwin specific stuff in their own attrsets and then that's merged into the common bits like pname and meta.

I updated the meta while I was at it. The license in the repo is actually GPLv3 or later but I'm not sure whether that's accurate because terms and conditions apply.

You can find them in the README for the project, reproduced here for convenience:

For licensing information, see the attached LICENSE file and the list of third-party licenses at wire.com/legal/licenses/.

If you compile the open source software that we make available from time to time to develop your own mobile, desktop or web application, and cause that application to connect to our servers for any purposes, we refer to that resulting application as an “Open Source App”. All Open Source Apps are subject to, and may only be used and/or commercialized in accordance with, the Terms of Use applicable to the Wire Application, which can be found at https://wire.com/legal/#terms. Additionally, if you choose to build an Open Source App, certain restrictions apply, as follows:

a. You agree not to change the way the Open Source App connects and interacts with our servers;
b. You agree not to weaken any of the security features of the Open Source App;
c. You agree not to use our servers to store data for purposes other than the intended and original functionality of the Open Source App;
d. You acknowledge that you are solely responsible for any and all updates to your Open Source App.

For clarity, if you compile the open source software that we make available from time to time to develop your own mobile, desktop or web application, and do not cause that application to connect to our servers for any purposes, then that application will not be deemed an Open Source App and the foregoing will not apply to that application.

No license is granted to the Wire trademark and its associated logos, all of which will continue to be owned exclusively by Wire Swiss GmbH. Any use of the Wire trademark and/or its associated logos is expressly prohibited without the express prior written consent of Wire Swiss GmbH.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/) Tested the executable inside the .app.
  • Determined the impact on package closure size (by running nix path-info -S before and after) Tried to but the original derivation wouldn't build on darwin. The result is about 150MB though.
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@ofborg ofborg bot added the 6.topic: darwin Running or building packages on Darwin label Jul 16, 2019
@toonn toonn changed the title Wire-desktop refactor to add Darwin support wire-desktop: refactor to add Darwin support Jul 16, 2019
@worldofpeace worldofpeace self-assigned this Jul 16, 2019
@ofborg ofborg bot requested a review from worldofpeace July 16, 2019 18:21
@armijnhemel
Copy link
Contributor

adding @silverhook for legal review, as I am not a lawyer. I don't think that the restrictions that Wire has added would be considered permissable "additional terms" as per GPL3, section 7 but instead be a "further restriction".

@silverhook
Copy link
Contributor

I didn’t dive deep, but at a quick glance, I’d agree with @armijnhemel that this would go into the “further restrictions” territory. But also that these “further restrictions” fall away, if you modify the client in a way to not connect to Wire’s own servers.

It seems like a very mixed bag to me.

@arianvp
Copy link
Member

arianvp commented Jul 16, 2019

I work at Wire and have poked a collegue at the company who might be able to help with this question.

@worldofpeace
Copy link
Contributor

@toonn I've made a patch to fix some style issues and to make it easier to update manually

@toonn
Copy link
Contributor Author

toonn commented Jul 16, 2019

@worldofpeace, I applied your patch, I'd originally grouped the makeDesktopItem with the other linux-specific dependencies but I don't feel strongly about that. Keeping the versions together does look like a definite improvement.

@raphaelrobert
Copy link

@toonn The client source code is only governed by GPLv3. The terms you quote apply to the usage of Wire servers, not the client server.

@armijnhemel
Copy link
Contributor

@toonn The client source code is only governed by GPLv3. The terms you quote apply to the usage of Wire servers, not the client server.

Although I agree that these terms only seem to be when the Wire servers are used (and not when your own server is used), they do read on the client code and are, I think, a "further restriction" according to the license.

@raphaelrobert
Copy link

I should have clarified: I work for Wire. The terms of use only govern Wire accounts (which is a prerequisite for using the Wire servers).
The source code is not affected by them.

@armijnhemel
Copy link
Contributor

I should have clarified: I work for Wire. The terms of use only govern Wire accounts (which is a prerequisite for using the Wire servers).
The source code is not affected by them.

But it is not "terms of use"! The README actually calls them "restrictions" :-)

"Additionally, if you choose to build an Open Source App, certain restrictions apply"

I absolutely understand why you would want these restrictions as rogue code could interfere with your operations, but the way it is currently worded it reads on the client code and thus could be seen as a "further restriction" according to the license.

Personally I would move these restrictions to general terms and conditions and just terminate people's accounts if they don't comply with those rules. GPL3, section 6 would already allow you to do this:

"Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network."

It might be worthwhile to talk to an experienced open source lawyer. I would be more than happy to give some suggestions for various jurisdictions (Germany, Switzerland, Italy, Spain, UK, etc.)

@ofborg ofborg bot requested a review from worldofpeace July 16, 2019 21:32
@toonn toonn force-pushed the wire-desktop-refactor branch 2 times, most recently from 32dbea3 to f5beda5 Compare July 16, 2019 22:09
@silverhook
Copy link
Contributor

I should have clarified: I work for Wire. The terms of use only govern Wire accounts (which is a prerequisite for using the Wire servers).
The source code is not affected by them.

@raphaelrobert, thanks for the clarification. But if that is case, please make sure to clarify it in the license itself and official documentation, instead of an issue buried on a source code forge.

@raphaelrobert
Copy link

@silverhook I'm not sure what you mean exactly. The README file points to the license file directly for all source code licensing questions:

For licensing information, see the attached LICENSE file and the list of third-party licenses at wire.com/legal/licenses/.

@silverhook
Copy link
Contributor

@raphaelrobert, the relevant part of the https://github.com/wireapp/wire-desktop/blob/staging/README.md reads as follows (emphasis mine):

For licensing information, see the attached LICENSE file and the list of third-party licenses at wire.com/legal/licenses/.

If you compile the open source software that we make available from time to time to develop your own mobile, desktop or web application, and cause that application to connect to our servers for any purposes, we refer to that resulting application as an “Open Source App”. All Open Source Apps are subject to, and may only be used and/or commercialized in accordance with, the Terms of Use applicable to the Wire Application, which can be found at https://wire.com/legal/#terms. Additionally, if you choose to build an Open Source App, certain restrictions apply, as follows:

a. You agree not to change the way the Open Source App connects and interacts with our servers; b. You agree not to weaken any of the security features of the Open Source App; c. You agree not to use our servers to store data for purposes other than the intended and original functionality of the Open Source App; d. You acknowledge that you are solely responsible for any and all updates to your Open Source App.

For clarity, if you compile the open source software that we make available from time to time to develop your own mobile, desktop or web application, and do not cause that application to connect to our servers for any purposes, then that application will not be deemed an Open Source App and the foregoing will not apply to that application.

The parts emphasised in bold, seem to be connected to the license of the code, not the Terms of Service of the official Wire server(s). I agree that you clarification makes sense, but it is not (unambiguously) reflected in the README.md. The way it reads now is that it restricts the use of the code and splits the market into two, giving a different license to each part of the market.

It would be good to re-write the wording in order to clarify the distinction between the license of the code (GPL-3.0) and the terms of service that apply when a client connects to the official Wire servers.

@raphaelrobert
Copy link

Thanks for the feedback @silverhook! I guess we could make it more clear that the README is just an extract of the Terms of Use.

@armijnhemel
Copy link
Contributor

Thanks for the feedback @silverhook! I guess we could make it more clear that the README is just an extract of the Terms of Use.

Yes, this would, I think, suffice (as I already commented). It basically comes down to "if you mess with our operations, we will terminate your account" and that's perfectly fine. For the rest: what @silverhook said :-)

@toonn
Copy link
Contributor Author

toonn commented Jul 23, 2019

Ping @worldofpeace.

@worldofpeace
Copy link
Contributor

@grahamc at #64931 (comment) you said "this is very fishy".

I'm not sure what you meant by that and what to change, and @toonn changed their expression significantly f5beda5.

@toonn
Copy link
Contributor Author

toonn commented Jul 23, 2019

@worldofpeace, I made the changes in response to @grahamc's complaints. They didn't like the common // if darwin then darwin else linux), preferring inheriting the common attributes. (aside: I personally don't like the inherit mechanism because with can bring things in scope implicitly so you can't always tell where inheritted attributes are coming from.)

@grahamc also didn't like that all this derivation does is fetch the .app for darwin, preferring homebrew for this. But the linux derivation essentially does the same and I wrote this because I want to move away from brew. (Note there was some support for having this in nixpkgs despite "just fetching the .app.")

@worldofpeace
Copy link
Contributor

Did you discuss in private? Because he only left that comment here.

At any rate I'm sure the changes are fine, going to give it the last look over since it has been a week here for me.

@toonn
Copy link
Contributor Author

toonn commented Jul 23, 2019

We discussed in #nixos-dev or #nixos-chat, not quite sure. I could share the relevant parts of my logs if necessary. Note that these changes were made almost a week ago. I didn't ping until now because I figured people are busy and this isn't high priority anyway.

@worldofpeace
Copy link
Contributor

worldofpeace commented Jul 23, 2019

Thanks for clearing it up @toonn, it just confused me as to where the inspiration for these changes were coming from.

@GrahamcOfBorg build wire-desktop

downloadPage = https://wire.com/download/;
license = licenses.gpl3Plus;
maintainers = with maintainers; [ toonn worldofpeace ];
platforms = [ "x86_64-darwin" "x86_64-linux" ];
Copy link
Contributor

Choose a reason for hiding this comment

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

We should set this independently in darwin and linux.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, considered this metadata for the entire derivation, which is indeed compatible with both platforms 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.

May have gotten messy with my commit message, do I need to stick to the package: reason convention for all of them?

Copy link
Contributor

Choose a reason for hiding this comment

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

It should be fine since it's one package, squashing should be easy.

linux = stdenv.mkDerivation rec {
inherit pname version meta;

platforms = [ "x86_64-linux" ];
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
platforms = [ "x86_64-linux" ];
meta.platforms = [ "x86_64-linux" ];

same for the other

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can and should we use the same trick as for version and sha256? Or does that depend on meta.platforms somehow?

Copy link
Contributor

Choose a reason for hiding this comment

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

Well for those, it's just done for ease of manual maintainability. I don't expect to ever have to change this.

@worldofpeace
Copy link
Contributor

@GrahamcOfBorg build wire-desktop

@worldofpeace
Copy link
Contributor

@toonn Can you squash your commits?
I'm not sure where to go with the history so I'll leave this up to you.

@toonn
Copy link
Contributor Author

toonn commented Jul 27, 2019

@worldofpeace, should we worry about the ofborg failure?

@worldofpeace
Copy link
Contributor

Oh, I just now noticed that.

Added a `longDescription` and `downloadPage`. Also added myself to
`maintainers`.

I fixed up the `license` because it's actually GPLv3 *or later*.
Note that terms and conditions apply though I don't feel like they
violate the GPL-ness of the code.
Wire Desktop is available for linux, mac os and windows. I figured
adding darwin support would be cromulent. Note that the versions don't
align 100%, this is how it's released upstream.

I refactored the derivation to seperate all the linux-specific parts. I
also sorted the dependencies and grouped them.

The changes were based on the derivation for electron. I changed the
construction from calling `mkDerivation` on a conditional merger of two
sets by moving the `mkDerivation` calls into the conditional and up to
the local bindings for `linux` and `darwin`. This required moving
`pname` and `meta` up to local bindings.
@FRidh
Copy link
Member

FRidh commented Jul 28, 2019

I undid this change when merging staging-next into staging because of a merge conflict. Please open a new PR for staging to reapply the change.

@FRidh
Copy link
Member

FRidh commented Jul 28, 2019

Nevermind, it is in. However, there was a problem with evaluation, see 15564fb.

@toonn
Copy link
Contributor Author

toonn commented Jul 28, 2019

@FRidh, does this require further action? Would my original approach work better maybe? Then meta.platforms can be evaluated without running into this (if nix is lazy enough).

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.

None yet

8 participants