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

aether: init at 2.0.0-dev.15 #130105

Merged
merged 2 commits into from
Aug 11, 2021
Merged

aether: init at 2.0.0-dev.15 #130105

merged 2 commits into from
Aug 11, 2021

Conversation

maxhille
Copy link
Contributor

The changes in this PR add myself to the maintainer list and the Aether P2P client as a package.

about Aether: https://getaether.net/

Motivation for this change

No package yes. People were asking for it (#66414)

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • 21.11 Release Notes (or backporting 21.05 Relase 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.

@maxhille maxhille mentioned this pull request Jul 13, 2021
@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 10.rebuild-linux: 1 labels Jul 13, 2021
@maxhille
Copy link
Contributor Author

Whoever reviews this:

This is my first new package contribution, so I don't expect to have done everything right. I don't mind direct critique. <3

Copy link
Member

@roberth roberth left a comment

Choose a reason for hiding this comment

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

You're off to a good start.

Please update the commit messages to conform to the guidelines mentioned in the pr template. You could use git rebase -i and the r (reword) rebase command to achieve this.

pkgs/applications/networking/aether/default.nix Outdated Show resolved Hide resolved
pkgs/applications/networking/aether/default.nix Outdated Show resolved Hide resolved
pkgs/applications/networking/aether/default.nix Outdated Show resolved Hide resolved
pkgs/applications/networking/aether/default.nix Outdated Show resolved Hide resolved
@r-rmcgibbo
Copy link

Result of nixpkgs-review pr 130105 at 232ed92c run on x86_64-linux 1

1 package built successfully:
  • aether
2 suggestions:
  • warning: missing-phase-hooks

    installPhase should probably contain runHook preInstall and runHook postInstall.

    Near pkgs/applications/networking/aether/default.nix:50:3:

       |
    50 |   installPhase = ''
       |   ^
    
  • warning: unclear-gpl

    agpl3 is a deprecated license, please check if project uses agpl3Plus or agpl3Only and change meta.license accordingly.

    Near pkgs/applications/networking/aether/default.nix:85:5:

       |
    85 |     license = licenses.agpl3;
       |     ^
    

pkgs/applications/networking/aether/default.nix Outdated Show resolved Hide resolved
pkgs/applications/networking/aether/default.nix Outdated Show resolved Hide resolved
pkgs/applications/networking/aether/default.nix Outdated Show resolved Hide resolved
pkgs/applications/networking/aether/default.nix Outdated Show resolved Hide resolved
pkgs/applications/networking/aether/default.nix Outdated Show resolved Hide resolved
@maxhille
Copy link
Contributor Author

@SuperSandro2000 @roberth How exactly is the merge process going to happen (ie. who pushes the merge button)?

I am asking because I want to address your review comments with single commits (otherwise Github gets confused IIRC) but still squash those into the "package init" commit before in lands on master.

@06kellyjac
Copy link
Member

A member can either merge it as it is in the PR or squash merge it for you.
It's preferable for you to squash them yourself and forcepush to the PR.

Just remember that adding yourself as a maintainer and init of the package should be 2 separate commits :)

@maxhille
Copy link
Contributor Author

@roberth @SuperSandro2000 as far as I can tell I addressed the suggestions. I also added some more code because I had to get the app icon from their git repository. I hope the force push did not throw off Github too much (happens some time).

Regarding the license I wrote a request at their bugtracker[1] (My post is still pending moderation).

[1] https://meta.getaether.net/top/all

Copy link
Member

@roberth roberth left a comment

Choose a reason for hiding this comment

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

Looks good to me.

Regarding the use of string constants, I don't expect most of them stand the test of an actual change happening, and the indirection could be slightly harmful. version is a notable exception. I don't feel very strongly about it though, so I wouldn't delay a merge for it.

Maybe @SuperSandro2000 wants to have another look. Otherwise, good for merge afaic.

@maxhille
Copy link
Contributor Author

@roberth @SuperSandro2000 I squashed the package commits together, so from my POV this is ready to merge.

Regarding the strings constant I admit it is a bit pointless as of now, eg. you will find aether-2.0.0-dev.15 aswell as aether-2.0.0-dev15 (dot missing). I think the project does not have some sort of formal release process and as such abstracting would probably be a waste of time right now.

If the Aether project stays alive I assume we will rework this derivation to build from source at some point anyway.

@roberth
Copy link
Member

roberth commented Jul 20, 2021

@maxhille I agree.

The build did fail to fetch the archive though. That's hard to test locally because fixed-output derivation outputs are always cached. You can delete the cached paths from your store using

nix-store --delete $(nix-store -q --outputs $(nix-instantiate -A aether.srcs))

If deletion fails, you may have to remove gc roots:

nix-store -q --roots $(nix-instantiate -A aether.srcs)

@maxhille
Copy link
Contributor Author

The build did fail to fetch the archive though. That's hard to test locally because fixed-output derivation outputs are always cached. You can delete the cached paths from your store using

Turns out that missing dot was my fault somehow. Fixed now

nix-store --delete $(nix-store -q --outputs $(nix-instantiate -A aether.srcs))

If deletion fails, you may have to remove gc roots:

nix-store -q --roots $(nix-instantiate -A aether.srcs)

Thanks for the pointer.

FYI I had to do nix-store -q --roots $(nix-instantiate -E 'with import <nixpkgs> {}; callPackage ./default.nix {}' -A srcs) otherwise nix-instantiate would fail with error: cannot auto-call a function that has an argument without a default value ('autoPatchelfHook').

@roberth
Copy link
Member

roberth commented Jul 20, 2021

Ah that makes sense when run in the aether directory. I assumed to run from the nixpkgs root.

@maxhille
Copy link
Contributor Author

Ah that makes sense when run in the aether directory. I assumed to run from the nixpkgs root.

I guess that also explains why I had to remove the aether qualifier in the attribute. Never stop learning - thanks for the help, I appreciate it!

@SuperSandro2000 SuperSandro2000 changed the title Add new package: Aether P2P Client aether: init at 2.0.0-dev.15 Jul 20, 2021
Comment on lines 68 to 72
desktopItem = makeDesktopItem {
name = pname;
exec = binaryName;
icon = pname;
desktopName = "Aether";
genericName = meta.description;
categories = "Network;";
mimeType = "x-scheme-handler/aether";
};
Copy link
Member

Choose a reason for hiding this comment

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

Use copyDesktopItems instead.

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 you give a reason why I should do that?

Unfortunately I have serious trouble to find the sources for the imported functions, so I don't know more about copyDesktopItems other than that it does not work as a substitute because some argument is missing...

Also please note that the original tarball does not come with a desktop file, so we have to create one. As said I don't know what copyDesktopItem does but I assume is copies existing files?

Copy link
Member

Choose a reason for hiding this comment

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

Can you give a reason why I should do that?

Because it is supposed to be done this way instead of custom cooking the same install steps in all packages that use it.

here you have an example

nativeBuildInputs = [ cmake flex lemon wrapQtAppsHook copyDesktopItems ];
desktopItems = [
(makeDesktopItem {
name = "antimony";
desktopName = "Antimony";
comment="Tree-based Modeler";
genericName = "CAD Application";
exec = "antimony %f";
icon = "antimony";
terminal = "false";
categories = "Graphics;Science;Engineering";
mimeType = "application/x-extension-sb;application/x-antimony;";
extraEntries = ''
StartupWMClass=antimony
Version=1.0
'';
})
];

don't know what copyDesktopItem does but I assume is copies existing files?

It can also copy created items, see the example above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the explanation.

In contrast to the example, I had to add runHook postInstall to the installPhase block, otherwise copyDesktopItems would just not execute.

Again I have no idea why that is...

pkgs/applications/networking/aether/default.nix Outdated Show resolved Hide resolved
pkgs/applications/networking/aether/default.nix Outdated Show resolved Hide resolved
pkgs/applications/networking/aether/default.nix Outdated Show resolved Hide resolved
@maxhille
Copy link
Contributor Author

I added some formatting suggestions and changed the license to agpl3Only.

@maxhille
Copy link
Contributor Author

@roberth Seem like a check for some inferior, proprietary OS got stuck. Is there something I can do about it?

@roberth
Copy link
Member

roberth commented Jul 22, 2021

@roberth Seem like a check for some inferior, proprietary OS got stuck. Is there something I can do about it?

The problem is with our tooling. To be honest, I don't know the exact status of the ofborg x86_64-darwin builders, but I'm pretty sure it's not because of the operating system.

You can ignore the darwin commit status because you didn't package for it and meta.platforms is correct.

some inferior, proprietary OS

Please don't make a fool of yourself.

Also, complacency is a real problem for open source if "it" wants to compete in the OS arena. It's not the root cause though and I won't blame any individual for it.

But hey, let's enjoy ourselves :)

@matthew-piziak
Copy link
Contributor

@maxhille Thanks for your persistence here in diligently updating to feedback. It's looking like a great first package.

@maxhille
Copy link
Contributor Author

maxhille commented Aug 1, 2021

@SuperSandro2000 Can you revisit the suggestions / changes I made?

Comment on lines 35 to 40
postUnpack = ''
cp source/aether-core/aether/client/src/app/ext_dep/images/Linux-Windows-App-Icon.png ${sourceRoot}
'';

buildPhase = ''
convert Linux-Windows-App-Icon.png -resize 512x512 aether.png
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
postUnpack = ''
cp source/aether-core/aether/client/src/app/ext_dep/images/Linux-Windows-App-Icon.png ${sourceRoot}
'';
buildPhase = ''
convert Linux-Windows-App-Icon.png -resize 512x512 aether.png
buildPhase = ''
convert source/aether-core/aether/client/src/app/ext_dep/images/Linux-Windows-App-Icon.png -resize 512x512 aether.png

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. had to add relative ../source though.

basically cloned the discord package as it is also electron
@nehbit
Copy link

nehbit commented Aug 9, 2021

Hi all — maintainer of Aether P2P here. I've been out travelling for the past few weeks, so I'm just seeing all this. Great to see this work out.

Let me know if you have any questions and/or requests. Once this is done and working, I'd be happy to add NixOS as officially supported and point it your way.

@SuperSandro2000 SuperSandro2000 merged commit f8943ba into NixOS:master Aug 11, 2021
@SuperSandro2000
Copy link
Member

In a couple of days it should be available on the unstable channel.

@milahu
Copy link
Contributor

milahu commented Aug 25, 2021

url = "https://static.getaether.net/Releases/Aether-${version}/2011262249.19338c93/linux/Aether-${version}%2B2011262249.19338c93.tar.gz";

is the binary release, so this package should be called aether-bin

the package aether should be built from source

... no?

@SuperSandro2000
Copy link
Member

is the binary release, so this package should be called aether-bin

We only do this if we have both the source and the bin variant. Ideally if we build from source the bin variant can be removed.

@milahu
Copy link
Contributor

milahu commented Aug 27, 2021

edit: forget what i said ...
currently on nixos, packaging node apps from source is too much of a pain in the ass

Ideally if we build from source the bin variant can be removed.

so lets build from source in the first place ... the biggest problem:

aether is abandonware

aether is old

probably the devs focus on the web version

the last serious commit was two years ago (53b6c8b from 2019-09-20)

only 9 commits in the git repo
many go tests are failing (internal api has changed)
old node dependencies
old node code (commonjs, require)

... so this looks not like something "we" want in nixpkgs,
but rather in NUR, assuming we can fix the build

apart from that:
aether has 3 parts: backend, frontend, client

backend and frontend are go modules,
and with some patching these can be built with buildGoModule

frontend

rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial tcp 127.0.0.1:47001: connect: connection refused"

but the frontend will store 700MB of something in $HOME/.config/Air Labs/Aether/

client

electron shows an empty window
electron devtools are broken:

(node:711053) electron: Failed to load URL: devtools://devtools/bundled/devtools_app.html?remoteBase=https://chrome-devtools-frontend.appspot.com/serve_file/@9fd6d71864d3fcf9182cd7caf00f7d46d4e8ebcb/&can_dock=true&toolbarColor=rgba(223,223,223,1)&textColor=rgba(0,0,0,1)&experiments=true with error: ERR_BLOCKED_BY_CLIENT

the client is a javascript/vue/electron app
which is a bit of a pain to package in nix ...

i can generate nix files with node2nix,
but something in the node2nix expression looks for /package.json
but that file is in /aether-core/aether/client/package.json

node2nix expects package.json in the same folder as node-env.nix etc
better tool is npmlock2nix

but its easy to build the client with npm:

git clone --depth 1 https://github.com/milahu/aether-app --branch fix-inconsistent-vendoring
cd aether-app/aether-core/aether/client/
npm install
npm run wpbuild # wp = webpack
nix-shell -p electron --run 'electron .'

we dont need the original bundling (compress with upx, create docker image)

@nehbit
Copy link

nehbit commented Aug 27, 2021

Last commit is from July 21, 2021, I doubt that counts as abandonware, it's clearly being tended to. On the other hand, it is true right now focused on the web version because we've just released it.

If you are going to build it from source, I would recommend you to wait until we cut the dev16, which should happen in a week or two. We're fixing a low-level CVE where a local user can attack its own app and that will be the main release.

@milahu

This comment has been minimized.

@Danie10
Copy link

Danie10 commented Oct 15, 2022

@nehbit is there a link to the dev16 release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 10.rebuild-linux: 1 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants