Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Change formula to use sshuttle/sshuttle fork #39968

Closed
wants to merge 1 commit into from

Conversation

verdurin
Copy link

This is a simple change to use the fork at https://github.com/sshuttle/sshuttle that includes fixes for sshuttle to work in recent releases of OS X. See the discussion at #37907


head 'https://github.com/apenwarr/sshuttle.git'
head 'https://github.com/sshuttle/sshuttle.git'
Copy link
Member

Choose a reason for hiding this comment

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

Can a test be added to do something more substantial than e.g. --version or --help? See cmake.rb for an example of an application formula with a good test and tinyxml2.rb for an example of a library formula with a good test. Thanks!

Copy link
Author

Choose a reason for hiding this comment

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

Sure - it did complain during the build. I suppose requirements have changed since this was first created (not by me).

Copy link
Member

Choose a reason for hiding this comment

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

Thanks!

@DomT4
Copy link
Member

DomT4 commented May 27, 2015

What's the status here? We have #38581 open previously, and just had #40120 opened. Are we just waiting on the test to be added?


head 'https://github.com/apenwarr/sshuttle.git'
head 'https://github.com/sshuttle/sshuttle.git'

def install
Copy link
Member

Choose a reason for hiding this comment

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

According to the other two PRs, libexec.install Dir['*'] should be libexec.install Dir["src/*"] now?

@MikeMcQuaid
Copy link
Member

I'd also like clarification on #38581 whether this requires Yosemite.

@verdurin
Copy link
Author

Yes, I still need to add a test. This is my first (attempted) contribution, so I'm bound to make a few mistakes. I've fixed the lib exec path.

@verdurin
Copy link
Author

I only have access to Yosemite machines, so I can't directly test whether it will work on older releases.

As for a test, I can't see anything that doesn't either require sudo access or starts listening to the network e.g. sshuttle --server, which I'm assuming isn't acceptable.

I could use sshuttle --firewall without arguments, which should provoke a specific error message. Is that better than just --help?

@MikeMcQuaid
Copy link
Member

@verdurin Listening on the network is OK; you could start it up with fork and then wait to ensure it came up OK. If that's too hard then checking for the specific error message seems fine 👍

@DomT4
Copy link
Member

DomT4 commented Jun 3, 2015

Ping?

@verdurin
Copy link
Author

verdurin commented Jun 4, 2015

I've tried to add a check that meets what @MikeMcQuaid wanted, please take a look.

@verdurin
Copy link
Author

verdurin commented Jun 4, 2015

Looks like it fails on Mountain Lion, though the test passes locally on Yosemite.

bin.write_exec_script libexec/'sshuttle'
end
test do
cmd = '#{bin}/sshuttle --server'
Open3.popen3(cmd) do |stdin, stdout, stderr, wait_thr|
Copy link
Member

Choose a reason for hiding this comment

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

Might want to use the fork method here instead? Up to you.

@verdurin
Copy link
Author

verdurin commented Jun 4, 2015

It might be a bit verbose but I prefer this approach, if that's okay.

@MikeMcQuaid
Copy link
Member

@verdurin
Copy link
Author

verdurin commented Jun 4, 2015

That's true, as I did mention above, but does this fork work on 10.8 anyway? As I noted either in this PR or the other one, I don't have access to a 10.8 machine on which to test.

@MikeMcQuaid
Copy link
Member

@verdurin I don't know. We can guard it to 10.9 and above if that's what upstream supports with depends_on :macos => :mavericks

@DomT4
Copy link
Member

DomT4 commented Jun 5, 2015

This'll need rebasing on master here before the next push.

@verdurin
Copy link
Author

verdurin commented Jun 9, 2015

@DomT4
Copy link
Member

DomT4 commented Jun 10, 2015

Looks like this still needs rebasing against master. If you could squash your commits when you do so, that'd be 🏆, Thanks!

@verdurin
Copy link
Author

Forgive my Git ignorance, but trying to rebase isn't going too well:

git rebase --interactive origin/master
error: could not apply f1bf43b... Change formula to use sshuttle/sshuttle fork

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".
Could not apply f1bf43b... Change formula to use sshuttle/sshuttle fork

I see a similar message if I try to rebase to an updated upstream remote.

git rebase homebrew/master
First, rewinding head to replay your work on top of it...
Applying: Change formula to use sshuttle/sshuttle fork
Using index info to reconstruct a base tree...
M Library/Formula/sshuttle.rb
Falling back to patching base and 3-way merge...
Auto-merging Library/Formula/sshuttle.rb
CONFLICT (content): Merge conflict in Library/Formula/sshuttle.rb
Failed to merge in the changes.
Patch failed at 0001 Change formula to use sshuttle/sshuttle fork
The copy of the patch that failed is found in:
/usr/local/.git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

@DomT4
Copy link
Member

DomT4 commented Jun 10, 2015

You may find it easier at this point to do something like:

git rebase --abort
mv Library/Formula/sshuttle.rb ~/Downloads
git fetch; git reset --hard origin/master
mv ~/Downloads/sshuttle.rb Library/Formula/sshuttle.rb
git add -A && git commit -m "sshuttle: change to maintained fork"
git push verdurin sshuttle-fork -f

@verdurin
Copy link
Author

Thanks, @DomT4

This is the current status:

git status
On branch sshuttle-fork
Your branch and 'verdurin/sshuttle-fork' have diverged,
and have 1 and 12 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)
nothing to commit, working directory clean

Is this a safe state from which to push? Or do I need to collapse those 12 commits again?

git branch -a
master

  • sshuttle-fork
    remotes/homebrew/gh-pages
    remotes/homebrew/go
    remotes/homebrew/master
    remotes/origin/master
    remotes/verdurin/gh-pages
    remotes/verdurin/go
    remotes/verdurin/master
    remotes/verdurin/sshuttle-fork

Thanks again for your patience on this.

@DomT4
Copy link
Member

DomT4 commented Jun 11, 2015

Make sure you've backed up your desired sshuttle.rb file first, but from this point you should be absolutely fine to do git push verdurin sshuttle-fork -f.

@DomT4
Copy link
Member

DomT4 commented Jun 13, 2015

Still needs to be rebased on an up-to-date master apparently:

git checkout master && git pull origin master
git checkout sshuttle-fork && git rebase master

@DomT4
Copy link
Member

DomT4 commented Jun 13, 2015

Ah, an alternative version was merged this morning in b76121d. If you want to open an updated PR to add the improved test and MacOS limit that'd be perfect. Thanks for all your effort in this PR! 🍸

@DomT4 DomT4 closed this Jun 13, 2015
@Homebrew Homebrew locked and limited conversation to collaborators Jul 10, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants