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

newnode 2.1.5 (new formula) #162683

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

Conversation

theoden8
Copy link

@theoden8 theoden8 commented Feb 14, 2024

  • Have you followed the guidelines for contributing?
  • Have you ensured that your commits follow the commit style guide?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • Does your build pass brew audit --strict <formula> (after doing HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

Newnode is an open-source decentralized Content Distribution Network (https://github.com/clostra/newnode).

This is a rewrite of #153960 with brew services in mind. Tested on intel OSx 14 Sonoma.

@github-actions github-actions bot added the new formula PR adds a new formula to Homebrew/homebrew-core label Feb 14, 2024
@github-actions github-actions bot added the autosquash Automatically squash pull request commits according to Homebrew style. label Feb 14, 2024
Copy link
Contributor

Thanks for contributing to Homebrew! 🎉 It looks like you're having trouble with a CI failure. See our contribution guide for help. You may be most interested in the section on dealing with CI failures. You can find the CI logs in the Checks tab of your pull request.

Formula/n/newnode-helper.rb Outdated Show resolved Hide resolved
Formula/n/newnode-helper.rb Outdated Show resolved Hide resolved
Copy link
Member

@SMillerDev SMillerDev left a comment

Choose a reason for hiding this comment

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

This seems to be vendoring a bunch of homebrew formula, which violates: https://docs.brew.sh/Acceptable-Formulae#stuff-that-requires-vendored-versions-of-homebrew-formulae

  Entering 'libevent'
  Entering 'libsodium'

@theoden8
Copy link
Author

theoden8 commented Feb 14, 2024

This seems to be vendoring a bunch of homebrew formula, which violates: https://docs.brew.sh/Acceptable-Formulae#stuff-that-requires-vendored-versions-of-homebrew-formulae

  Entering 'libevent'
  Entering 'libsodium'

The codebase of newnode uses internal headers of libevent (e.g. in https://github.com/clostra/newnode/blob/master/bufferevent_utp.h), which are not provided in homebrew version. Additionally, our fork of libevent includes important fixes that would lead to errors in the code.

libsodium, however, I think I can try and make it depend on externally.

Would that be a reasonable compromise to resolve this issue?

@theoden8
Copy link
Author

theoden8 commented Feb 21, 2024

@SMillerDev any update on this? I can try and look into fixing #162684 (though, I can't promise it), and we're very interested in making the project (d2d vpn with dht) accessible for mac users.

@SMillerDev
Copy link
Member

Additionally, our fork of libevent includes important fixes that would lead to errors in the code.

Have they been submitted upstream? Then we can just patch the libevent formula

@theoden8
Copy link
Author

theoden8 commented Feb 21, 2024

The fork of libevent we're using has in part been submitted in a series of pull requests (see https://github.com/libevent/libevent/pulls/ghazel), and they might be resubmitted down the line. But this would take a considerable amount of time.

In the meantime, we use features like allow external access to evdns cache, as well as internal headers and ones resulting from compiling libevent (e.g. evconfig.h).

@SMillerDev what do you mean by patching libevent formula, and does it allow for this flexibility?

Copy link
Member

@p-linnane p-linnane left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. I have some concerns I need addressed before we attempt to move forward with this.

Formula/n/newnode-helper.rb Outdated Show resolved Hide resolved
Formula/n/newnode-helper.rb Outdated Show resolved Hide resolved
Formula/n/newnode-helper.rb Outdated Show resolved Hide resolved
further inspection of https://github.com/clostra/newnode/blob/master/build.sh and subsequent build tests confirm that wget isnt needed on mac os
instead of assuming that the proxy is already run as a service, run it in a fork and kill at completion
linux builds currently rely on a hard-coded wget binary, which needs to change upstream to non-hardcoded binary
@github-actions github-actions bot added the macos-only Formula depends on macOS label Feb 22, 2024
fix brew audit fail due to non-alphabetic ordering of dependencies
most of the dependencies specified so far are actually build-time only, and pkg-config was not specified at all
updated newnode-helper to 2.1.5, with updated dependencies and no dependency on mbedtls
@theoden8 theoden8 changed the title newnode-helper 2.1.4 (new formula) newnode-helper 2.1.5 (new formula) Feb 29, 2024
@theoden8
Copy link
Author

theoden8 commented Feb 29, 2024

We've released the new version which should be more compatible with homebrew's policy:

  1. Upon closer inspection, mbedtls isn't needed, so it is no longer listed as a dependency (neither, the new nor the old version).
  2. We've updated libevent, which now have some of the functionality similar to that submitted upstream.
  3. Updated libsodium (we still need it as a controlled dependency for mobile apps).

Does this provide a way forward with this PR?

Formula/n/newnode-helper.rb Outdated Show resolved Hide resolved
Formula/n/newnode-helper.rb Outdated Show resolved Hide resolved
Formula/n/newnode-helper.rb Outdated Show resolved Hide resolved
Formula/n/newnode-helper.rb Outdated Show resolved Hide resolved
theoden8 and others added 2 commits March 4, 2024 14:25
Co-authored-by: Sean Molenaar <SMillerDev@users.noreply.github.com>
@theoden8 theoden8 changed the title newnode-helper 2.1.5 (new formula) newnode 2.1.5 (new formula) Mar 4, 2024
@p-linnane p-linnane removed their request for review March 4, 2024 18:42
@theoden8
Copy link
Author

theoden8 commented Mar 12, 2024

@SMillerDev are we any closer to completion? It's been over a month since this PR started, and several key concerns have been addressed.

@theoden8
Copy link
Author

Any update on this? What's missing?

@SMillerDev SMillerDev removed their request for review March 26, 2024 09:03
@github-actions github-actions bot removed the macos-only Formula depends on macOS label Mar 26, 2024
@p-linnane p-linnane removed their request for review March 26, 2024 16:12
Formula/n/newnode.rb Outdated Show resolved Hide resolved
Formula/n/newnode.rb Outdated Show resolved Hide resolved
Co-authored-by: Sean Molenaar <SMillerDev@users.noreply.github.com>
@theoden8
Copy link
Author

theoden8 commented Apr 9, 2024

Any update on this? @SMillerDev I believe most comments have been addressed.
We do not use liblzma bug in our codebase.

Comment on lines 59 to 66
begin
Timeout.timeout(5) do
Process.wait(pid)
end
rescue Timeout::Error
Process.kill("KILL", pid) # Forcefully kill if not terminated after timeout
Process.wait(pid)
end
Copy link
Member

Choose a reason for hiding this comment

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

Why would we expect it not to be killed by the kill above?

Copy link
Author

Choose a reason for hiding this comment

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

Removed the second kill

Comment on lines +34 to +36
path = (var/"cache/newnode")
path.mkpath
path.chmod 0775
Copy link
Member

Choose a reason for hiding this comment

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

This means that every install/update will make a new cache. Is that desirable?

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 point us the installation doc reference on this?

Copy link
Author

Choose a reason for hiding this comment

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

Doesn't it reuse the old cache?
https://github.com/clostra/newnode/blob/master/client.c#L3590 this is the closest to an installation doc I can find.

Copy link
Member

Choose a reason for hiding this comment

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

No, currently it will make a new cache folder as part of the install and overwrite the old one.

Copy link
Author

@theoden8 theoden8 Apr 11, 2024

Choose a reason for hiding this comment

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

I believe that's even better! :)

Copy link
Member

Choose a reason for hiding this comment

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

And if people are using the tool when running brew upgrade it'll keep working?

Copy link
Author

@theoden8 theoden8 Apr 11, 2024

Choose a reason for hiding this comment

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

It should, if peers file is invalid it just won't be loaded. There's no parsing, just raw ip addresses. The file is updated when the peer list is updated. if it fails to open file for writing, it will skip saving.

Copy link
Author

@theoden8 theoden8 Apr 29, 2024

Choose a reason for hiding this comment

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

Either way works, saving or not saving. We will handle the update smoothly if that interface ever changes. The code is intentionally simple and shouldn't fail.

Formula/n/newnode.rb Outdated Show resolved Hide resolved
@theoden8
Copy link
Author

theoden8 commented May 1, 2024

Anything else that need be addressed? @SMillerDev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosquash Automatically squash pull request commits according to Homebrew style. new formula PR adds a new formula to Homebrew/homebrew-core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants