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

brew tests infinite loop on svn_spec #7781

Closed
3 tasks done
miccal opened this issue Jun 22, 2020 · 37 comments · Fixed by #7814
Closed
3 tasks done

brew tests infinite loop on svn_spec #7781

miccal opened this issue Jun 22, 2020 · 37 comments · Fixed by #7814
Labels
outdated PR was locked due to age

Comments

@miccal
Copy link
Contributor

miccal commented Jun 22, 2020

Please note we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again.

  • ran brew update and can still reproduce the problem?
  • ran brew doctor, fixed all issues and can still reproduce the problem?
  • ran brew config and brew doctor and included their output with your issue?

What you were trying to do (and why)

Run brew tests.

What happened (include command output)

Running brew tests results in an infinite loop and does not end. I narrowed down the problem to svn_spec.rb (which is also a part of utils_spec.rb), and running either brew tests --only=utils/svn or brew tests --only=utils does not end, requiring a manual abort. The output of both commands with --verbose and --debug are shown below.

I believe this may be a Catalina-only problem, possibly related to this issue. I have verified that installing svn via brew with brew install svn solves this brew tests issue (see below).

Command output

-bash-5.0.17- /Users/miccal (31) [> brew tests --only=utils/svn --verbose --debug
Randomized with seed 2803
bundle exec parallel_rspec --nice -- -I /usr/local/Homebrew/Library/Homebrew/test --seed 2803 --color --require spec_helper --format NoSeedProgressFormatter --format ParallelTests::RSpec::RuntimeLogger --out /Users/miccal/Library/Caches/Homebrew/tests/parallel_runtime_rspec.log --tag ~needs_linux -- test/utils/svn_spec.rb
1 processes for 1 specs, ~ 1 specs per process
^C

Took 300 seconds
Tests Failed

Command output

-bash-5.0.17- /Users/miccal (31) [> brew tests --only=utils --verbose --debug
Randomized with seed 27117
bundle exec parallel_rspec --nice -- -I /usr/local/Homebrew/Library/Homebrew/test --seed 27117 --color --require spec_helper --format NoSeedProgressFormatter --format ParallelTests::RSpec::RuntimeLogger --out /Users/miccal/Library/Caches/Homebrew/tests/parallel_runtime_rspec.log --tag ~needs_linux -- test/utils_spec.rb test/utils/tty_spec.rb test/utils/popen_spec.rb test/utils/curl_spec.rb test/utils/fork_spec.rb test/utils/bottles/bottles_spec.rb test/utils/bottles/collector_spec.rb test/utils/bottles/bintray_spec.rb test/utils/git_spec.rb test/utils/analytics_spec.rb test/utils/github_spec.rb test/utils/svn_spec.rb test/utils/shell_spec.rb test/utils/user_spec.rb
8 processes for 14 specs, ~ 1 specs per process
................................*.

Pending: (Failures listed here are expected and do not affect your suite's status)

  1. GitHub::get_artifact_url fails to find a nonexistant workflow

    Requires network connection.

    ./test/utils/github_spec.rb:46

  2. GitHub::get_artifact_url gets an artifact link

    Requires network connection.

    ./test/utils/github_spec.rb:58

  3. GitHub::get_artifact_url fails to find artifacts that don't exist

    Requires network connection.

    ./test/utils/github_spec.rb:52

  4. GitHub::search_code queries GitHub code with the passed parameters

    Requires network connection.

    ./test/utils/github_spec.rb:7

  5. GitHub::search_issues queries GitHub issues with the passed parameters

    Requires network connection.

    ./test/utils/github_spec.rb:35

Finished in 0.1059 seconds (files took 4.62 seconds to load)
10 examples, 0 failures, 5 pending

................................
.
Finished in 0.16434 seconds (files took 4.64 seconds to load)
10 examples, 0 failures

.

Finished in 0.16043 seconds (files took 4.65 seconds to load)
16 examples, 0 failures

*...

Finished in 0.21058 seconds (files took 4.62 seconds to load)
10 examples, 0 failures

.................*...

Finished in 0.31558 seconds (files took 4.65 seconds to load)
28 examples, 0 failures

.........

Pending: (Failures listed here are expected and do not affect your suite's status)

  1. Utils::git_remote_exists? when git is available returns true when git remote exists

    Requires network connection.

    ./test/utils/git_spec.rb:133

Finished in 1.61 seconds (files took 4.61 seconds to load)
17 examples, 0 failures, 1 pending

..

Finished in 1.78 seconds (files took 4.58 seconds to load)
11 examples, 0 failures

^C

102 examples, 0 failures, 6 pendings

Took 300 seconds (1:43)
Tests Failed

What you expected to happen

brew tests to finish.

Step-by-step reproduction instructions (by running brew commands)

brew tests --only=utils/svn

Output of brew config and brew doctor commands

-bash-5.0.17- /Users/miccal (31) [> brew config
HOMEBREW_VERSION: 2.4.0-93-g634c457
ORIGIN: https://github.com/Homebrew/brew
HEAD: 634c4571299b5165110eac083dd5c2ae3f84331c
Last commit: 16 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 4bce00ad7b5a2f4ec589ae55cbeec5c72b58bfd5
Core tap last commit: 49 minutes ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_DEVELOPER: set
HOMEBREW_EDITOR: /usr/bin/open -e -W
HOMEBREW_FORCE_BREWED_CURL: set
HOMEBREW_FORCE_BREWED_GIT: set
HOMEBREW_FORCE_VENDOR_RUBY: set
HOMEBREW_MAKE_JOBS: 8
HOMEBREW_NO_ANALYTICS: set
CPU: octa-core 64-bit icelake
Homebrew Ruby: 2.6.3 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/bin/ruby
Clang: 11.0 build 1103
Git: 2.27.0 => /usr/local/opt/git/bin/git
Curl: 7.70.0 => /usr/local/opt/curl/bin/curl
macOS: 10.15.5-x86_64
CLT: 1103.0.32.62
Xcode: N/A
XQuartz: 2.7.11 => /opt/X11
-bash-5.0.17- /Users/miccal (31) [> brew doctor
Your system is ready to brew.
@MikeMcQuaid
Copy link
Member

@miccal Can you pin down exactly what line is causing this (either we some debugging output or --debug)? Thanks!

@miccal
Copy link
Contributor Author

miccal commented Jun 22, 2020

@MikeMcQuaid the output of the commands I gave above were both passed with the --verbose and --debug flags, so that is all the output I get unfortunately.

Looking at svn_spec.rb, it is a mystery to me what exactly is causing the hang.

Is there some other way I can provide more information beyond running the command brew tests --only=utils/svn --verbose --debug?

@miccal
Copy link
Contributor Author

miccal commented Jun 22, 2020

Also, I can confirm that running brew install svn fixes the problem:

-bash-5.0.17- /Users/miccal (30) [> which svn
/usr/local/bin/svn
-bash-5.0.17- /Users/miccal (30) [> brew tests --only=utils/svn --verbose --debug
Randomized with seed 29859
bundle exec parallel_rspec --nice -- -I /usr/local/Homebrew/Library/Homebrew/test --seed 29859 --color --require spec_helper --format NoSeedProgressFormatter --format ParallelTests::RSpec::RuntimeLogger --out /Users/miccal/Library/Caches/Homebrew/tests/parallel_runtime_rspec.log --tag ~needs_linux -- test/utils/svn_spec.rb
1 processes for 1 specs, ~ 1 specs per process
..*.

Pending: (Failures listed here are expected and do not affect your suite's status)

  1) Utils#self.svn_remote_exists? when svn is available returns true when remote exists
     # Requires network connection.
     # ./test/utils/svn_spec.rb:35


Finished in 0.10646 seconds (files took 1.53 seconds to load)
4 examples, 0 failures, 1 pending


4 examples, 0 failures, 1 pending

Took 1 seconds
-bash-5.0.17- /Users/miccal (30) [> brew remove svn
Uninstalling /usr/local/Cellar/subversion/1.14.0_1... (234 files, 30.6MB)
-bash-5.0.17- /Users/miccal (30) [> which svn
/usr/bin/svn
-bash-5.0.17- /Users/miccal (30) [> brew tests --only=utils/svn --verbose --debug
Randomized with seed 37738
bundle exec parallel_rspec --nice -- -I /usr/local/Homebrew/Library/Homebrew/test --seed 37738 --color --require spec_helper --format NoSeedProgressFormatter --format ParallelTests::RSpec::RuntimeLogger --out /Users/miccal/Library/Caches/Homebrew/tests/parallel_runtime_rspec.log --tag ~needs_linux -- test/utils/svn_spec.rb
1 processes for 1 specs, ~ 1 specs per process
^C



Took 300 seconds
Tests Failed

@issyl0
Copy link
Member

issyl0 commented Jun 22, 2020

I could reproduce this before I did brew install svn, as could @samford. I haven't yet had a chance to dig into why, and I'm unlikely to get time soon.

@samford
Copy link
Member

samford commented Jun 22, 2020

This is the same problem I encountered back in April and I came to the same conclusions as @miccal. When we discussed this internally, there was talk that it may be related to the svn shim (i.e., Library/Homebrew/shims/scm/svn) and Catalina not providing svn.

You can reliably reproduce this in a fresh Catalina VM without the subversion formula installed. I don't have the time to investigate this further at the moment but I at least wanted to mention this.

@miccal
Copy link
Contributor Author

miccal commented Jun 23, 2020

Catalina not providing svn.

Command Line Tools provides svn, though:

Screen Shot 2020-06-23 at 13 31 14

@MikeMcQuaid
Copy link
Member

Is there some other way I can provide more information beyond running the command brew tests --only=utils/svn --verbose --debug?

Yes, you can add a , :focus to the relevant test e.g.:

diff --git a/Library/Homebrew/test/utils/svn_spec.rb b/Library/Homebrew/test/utils/svn_spec.rb
index 04492e9fe..d82944ba8 100644
--- a/Library/Homebrew/test/utils/svn_spec.rb
+++ b/Library/Homebrew/test/utils/svn_spec.rb
@@ -8,7 +8,7 @@ describe Utils do
       described_class.clear_svn_version_cache
     end
 
-    it "returns svn version if svn available" do
+    it "returns svn version if svn available", :focus do
       if File.executable? "/usr/bin/svn"
         expect(described_class).to be_svn_available
       else

Yeh, this is likely an issue with the SVN shim but we can definitely work around it. I don't have access to a fresh VM.

@miccal
Copy link
Contributor Author

miccal commented Jun 23, 2020

@MikeMcQuaid I modified svn-spec.rb as per you suggestions, and:

-bash-5.0.17- /Users/miccal (29) [> brew tests --only=utils/svn --verbose --debug
Randomized with seed 26361
bundle exec parallel_rspec --nice -- -I /usr/local/Homebrew/Library/Homebrew/test --seed 26361 --color --require spec_helper --format NoSeedProgressFormatter --format ParallelTests::RSpec::RuntimeLogger --out /Users/miccal/Library/Caches/Homebrew/tests/parallel_runtime_rspec.log --tag ~needs_linux -- test/utils/svn_spec.rb
1 processes for 1 specs, ~ 1 specs per process
^C
RSpec is shutting down and will print the summary report... Interrupt again to force quit.

Took 300 seconds (5:00)
Tests Failed

and I am not sure about this summary report?

@MikeMcQuaid
Copy link
Member

@miccal now you have the focus and have it pinned down to a specific test: could you try to add puts around the codebase until you narrow down exactly what line is hanging? Thanks!

@miccal
Copy link
Contributor Author

miccal commented Jun 23, 2020

@MikeMcQuaid I believe the line that is hanging is:

expect(described_class).to be_svn_available

Adding puts "something" before and after this line outputs the first "something", but not the second.

@MikeMcQuaid
Copy link
Member

@miccal Perfect, thanks! What does bash -x $(brew --repo)/Library/Homebrew/shims/scm/svn --version output or do on your machine? What does /usr/bin/svn --version do/output?

@miccal
Copy link
Contributor Author

miccal commented Jun 23, 2020

@MikeMcQuaid ah, interesting -- both commands hang and require a manual abort. So it seems that svn has been completely removed in a recent version of CLT's on Catalina.

@MikeMcQuaid
Copy link
Member

@miccal What does the bash -x ... version output, if anything? What does file /usr/bin/svn output`?

@miccal
Copy link
Contributor Author

miccal commented Jun 23, 2020

@MikeMcQuaid file /usr/bin/svn outputs what you would expect:

-bash-5.0.17- /Users/miccal (29) [> file /usr/bin/svn
/usr/bin/svn: Mach-O 64-bit executable x86_64

as does:

-bash-5.0.17- /Users/miccal (29) [> test -x /usr/bin/svn && echo true || echo false
true

The bash -x ... output is long, and hangs:

Command output

-bash-5.0.17- /Users/miccal (29) [> bash -x $(brew --repo)/Library/Homebrew/shims/scm/svn --version

  • set +o posix

  • SCM_FILE=svn
    ++ realpath /usr/local/Homebrew/Library/Homebrew/shims/scm/svn
    ++ local path=/usr/local/Homebrew/Library/Homebrew/shims/scm/svn
    ++ local dir
    ++ local dest
    +++ absdir /usr/local/Homebrew/Library/Homebrew/shims/scm/svn
    +++ quiet_safe_cd /usr/local/Homebrew/Library/Homebrew/shims/scm/
    +++ cd /usr/local/Homebrew/Library/Homebrew/shims/scm/
    +++ pwd -P
    ++ dir=/usr/local/Homebrew/Library/Homebrew/shims/scm
    +++ dirbasepath /usr/local/Homebrew/Library/Homebrew/shims/scm /usr/local/Homebrew/Library/Homebrew/shims/scm/svn
    +++ local dir=/usr/local/Homebrew/Library/Homebrew/shims/scm
    +++ local base=svn
    +++ echo /usr/local/Homebrew/Library/Homebrew/shims/scm/svn
    ++ path=/usr/local/Homebrew/Library/Homebrew/shims/scm/svn
    ++ [[ -L /usr/local/Homebrew/Library/Homebrew/shims/scm/svn ]]
    +++ readlink /usr/local/Homebrew/Library/Homebrew/shims/scm/svn
    ++ dest=git
    ++ [[ git = /* ]]
    ++ path=/usr/local/Homebrew/Library/Homebrew/shims/scm/git
    +++ absdir /usr/local/Homebrew/Library/Homebrew/shims/scm/git
    +++ quiet_safe_cd /usr/local/Homebrew/Library/Homebrew/shims/scm/
    +++ cd /usr/local/Homebrew/Library/Homebrew/shims/scm/
    +++ pwd -P
    ++ dir=/usr/local/Homebrew/Library/Homebrew/shims/scm
    +++ dirbasepath /usr/local/Homebrew/Library/Homebrew/shims/scm /usr/local/Homebrew/Library/Homebrew/shims/scm/git
    +++ local dir=/usr/local/Homebrew/Library/Homebrew/shims/scm
    +++ local base=git
    +++ echo /usr/local/Homebrew/Library/Homebrew/shims/scm/git
    ++ path=/usr/local/Homebrew/Library/Homebrew/shims/scm/git
    ++ [[ -L /usr/local/Homebrew/Library/Homebrew/shims/scm/git ]]
    ++ echo /usr/local/Homebrew/Library/Homebrew/shims/scm/git

  • SCM_REAL=/usr/local/Homebrew/Library/Homebrew/shims/scm/git
    ++ quiet_safe_cd /usr/local/Homebrew/Library/Homebrew/shims/scm/
    ++ cd /usr/local/Homebrew/Library/Homebrew/shims/scm/
    ++ pwd -P

  • SCM_DIR=/usr/local/Homebrew/Library/Homebrew/shims/scm

  • [[ --version = --homebrew=* ]]

  • case "$(lowercase "$SCM_FILE")" in
    ++ lowercase svn
    ++ echo svn
    ++ tr '[:upper:]' '[:lower:]'

  • [[ -n '' ]]
    ++ quiet_safe_cd /usr/local/Homebrew/Library/Homebrew/shims/scm/../../../../../bin
    ++ pwd -P

  • brew_prefix_version=/usr/local/bin/svn

  • safe_exec /usr/local/bin/svn --version

  • local arg0=/usr/local/bin/svn

  • executable /usr/local/bin/svn

  • local file=/usr/local/bin/svn

  • [[ -f /usr/local/bin/svn ]]

  • return
    ++ quiet_safe_cd /usr/local/Homebrew/Library/Homebrew/shims/scm/../../../../bin
    ++ cd /usr/local/Homebrew/Library/Homebrew/shims/scm/../../../../bin
    ++ pwd -P

  • brew_repo_version=/usr/local/Homebrew/bin/svn

  • safe_exec /usr/local/Homebrew/bin/svn --version

  • local arg0=/usr/local/Homebrew/bin/svn

  • executable /usr/local/Homebrew/bin/svn

  • local file=/usr/local/Homebrew/bin/svn

  • [[ -f /usr/local/Homebrew/bin/svn ]]

  • return

  • IFS='
    '
    ++ type -aP svn

  • for path in $(type -aP "$SCM_FILE")

  • [[ /usr/bin/svn != /\u\s\r/\b\i\n/\s\v\n ]]

  • unset IFS

  • executable /usr/bin/xcode-select

  • local file=/usr/bin/xcode-select

  • [[ -f /usr/bin/xcode-select ]]

  • [[ -x /usr/bin/xcode-select ]]
    ++ /usr/bin/xcode-select -print-path

  • xcode_path=/Library/Developer/CommandLineTools

  • [[ -z /Library/Developer/CommandLineTools ]]

  • [[ -z '' ]]

  • [[ /Library/Developer/CommandLineTools != / ]]
    ++ /usr/bin/xcrun -find svn

  • path=/usr/local/Homebrew/Library/Homebrew/shims/scm/svn

  • safe_exec /usr/local/Homebrew/Library/Homebrew/shims/scm/svn --version

  • local arg0=/usr/local/Homebrew/Library/Homebrew/shims/scm/svn

  • executable /usr/local/Homebrew/Library/Homebrew/shims/scm/svn

  • local file=/usr/local/Homebrew/Library/Homebrew/shims/scm/svn

  • [[ -f /usr/local/Homebrew/Library/Homebrew/shims/scm/svn ]]

  • [[ -x /usr/local/Homebrew/Library/Homebrew/shims/scm/svn ]]
    ++ lowercase /usr/local/Homebrew/Library/Homebrew/shims/scm/svn
    ++ echo /usr/local/Homebrew/Library/Homebrew/shims/scm/svn
    ++ tr '[:upper:]' '[:lower:]'

  • [[ /usr/local/homebrew/library/homebrew/shims/scm/svn = \s\v\n ]]
    ++ realpath /usr/local/Homebrew/Library/Homebrew/shims/scm/svn
    ++ local path=/usr/local/Homebrew/Library/Homebrew/shims/scm/svn
    ++ local dir
    ++ local dest
    +++ absdir /usr/local/Homebrew/Library/Homebrew/shims/scm/svn
    +++ quiet_safe_cd /usr/local/Homebrew/Library/Homebrew/shims/scm/
    +++ cd /usr/local/Homebrew/Library/Homebrew/shims/scm/
    +++ pwd -P
    ++ dir=/usr/local/Homebrew/Library/Homebrew/shims/scm
    +++ dirbasepath /usr/local/Homebrew/Library/Homebrew/shims/scm /usr/local/Homebrew/Library/Homebrew/shims/scm/svn
    +++ local dir=/usr/local/Homebrew/Library/Homebrew/shims/scm
    +++ local base=svn
    +++ echo /usr/local/Homebrew/Library/Homebrew/shims/scm/svn
    ++ path=/usr/local/Homebrew/Library/Homebrew/shims/scm/svn
    ++ [[ -L /usr/local/Homebrew/Library/Homebrew/shims/scm/svn ]]
    +++ readlink /usr/local/Homebrew/Library/Homebrew/shims/scm/svn
    ++ dest=git
    ++ [[ git = /* ]]
    ++ path=/usr/local/Homebrew/Library/Homebrew/shims/scm/git
    +++ absdir /usr/local/Homebrew/Library/Homebrew/shims/scm/git
    +++ quiet_safe_cd /usr/local/Homebrew/Library/Homebrew/shims/scm/
    +++ cd /usr/local/Homebrew/Library/Homebrew/shims/scm/
    +++ pwd -P
    ++ dir=/usr/local/Homebrew/Library/Homebrew/shims/scm
    +++ dirbasepath /usr/local/Homebrew/Library/Homebrew/shims/scm /usr/local/Homebrew/Library/Homebrew/shims/scm/git
    +++ local dir=/usr/local/Homebrew/Library/Homebrew/shims/scm
    +++ local base=git
    +++ echo /usr/local/Homebrew/Library/Homebrew/shims/scm/git
    ++ path=/usr/local/Homebrew/Library/Homebrew/shims/scm/git
    ++ [[ -L /usr/local/Homebrew/Library/Homebrew/shims/scm/git ]]
    ++ echo /usr/local/Homebrew/Library/Homebrew/shims/scm/git

  • [[ /usr/local/Homebrew/Library/Homebrew/shims/scm/git = /\u\s\r/\l\o\c\a\l/\H\o\m\e\b\r\e\w/\L\i\b\r\a\r\y/\H\o\m\e\b\r\e\w/\s\h\i\m\s/\s\c\m/\g\i\t ]]

  • return

  • path=/Applications/Xcode.app/Contents/Developer/usr/bin/svn

  • safe_exec /Applications/Xcode.app/Contents/Developer/usr/bin/svn --version

  • local arg0=/Applications/Xcode.app/Contents/Developer/usr/bin/svn

  • executable /Applications/Xcode.app/Contents/Developer/usr/bin/svn

  • local file=/Applications/Xcode.app/Contents/Developer/usr/bin/svn

  • [[ -f /Applications/Xcode.app/Contents/Developer/usr/bin/svn ]]

  • return

  • path=/usr/bin/svn

  • [[ -z '' ]]

  • safe_exec /usr/bin/svn --version

  • local arg0=/usr/bin/svn

  • executable /usr/bin/svn

  • local file=/usr/bin/svn

  • [[ -f /usr/bin/svn ]]

  • [[ -x /usr/bin/svn ]]
    ++ lowercase /usr/bin/svn
    ++ echo /usr/bin/svn
    ++ tr '[:upper:]' '[:lower:]'

  • [[ /usr/bin/svn = \s\v\n ]]
    ++ realpath /usr/bin/svn
    ++ local path=/usr/bin/svn
    ++ local dir
    ++ local dest
    +++ absdir /usr/bin/svn
    +++ quiet_safe_cd /usr/bin/
    +++ cd /usr/bin/
    +++ pwd -P
    ++ dir=/usr/bin
    +++ dirbasepath /usr/bin /usr/bin/svn
    +++ local dir=/usr/bin
    +++ local base=svn
    +++ echo /usr/bin/svn
    ++ path=/usr/bin/svn
    ++ [[ -L /usr/bin/svn ]]
    ++ echo /usr/bin/svn

  • [[ /usr/bin/svn = /\u\s\r/\l\o\c\a\l/\H\o\m\e\b\r\e\w/\L\i\b\r\a\r\y/\H\o\m\e\b\r\e\w/\s\h\i\m\s/\s\c\m/\g\i\t ]]

  • [[ '' = \p\r\i\n\t-\p\a\t\h ]]

  • exec /usr/bin/svn --version
    ^C

@MikeMcQuaid
Copy link
Member

Last one I think: output/behaviour of /Library/Developer/CommandLineTools/usr/bin/svn --version? I think we probably need to just never call /usr/bin/svn on Catalina 😬

@miccal
Copy link
Contributor Author

miccal commented Jun 23, 2020

@MikeMcQuaid you have nailed it -- it seems svn is no longer shipped in either Xcode or CLT:

-bash-5.0.17- /Users/miccal (29) [> /Library/Developer/CommandLineTools/usr/bin/svn --version
-bash: /Library/Developer/CommandLineTools/usr/bin/svn: No such file or directory

@miccal
Copy link
Contributor Author

miccal commented Jun 23, 2020

Also:

-bash-5.0.17- /Users/miccal (29) [> /usr/bin/svnlook
svnlook: error: The subversion command line tools are no longer provided by Xcode.
-bash-5.0.17- /Users/miccal (29) [> /usr/bin/svnversion
svnversion: error: The subversion command line tools are no longer provided by Xcode.
-bash-5.0.17- /Users/miccal (29) [> man svn
No manual entry for svn

@MikeMcQuaid
Copy link
Member

I see it in /Library/Developer/CommandLineTools/usr/bin/svn --version and it works as expected on my machine. I suspect if that's missing then /usr/bin/svn goes 💥 on Catalina.

@MikeMcQuaid
Copy link
Member

@miccal What's your output of /usr/bin/svnversion --version?

@miccal
Copy link
Contributor Author

miccal commented Jun 23, 2020

@MikeMcQuaid as above:

-bash-5.0.17- /Users/miccal (29) [> /usr/bin/svnversion --version
svnversion: error: The subversion command line tools are no longer provided by Xcode.

@samford
Copy link
Member

samford commented Jun 23, 2020

It's a strange issue because I was in the same situation as @miccal in April (where brew tests would hang and I had to have the subversion formula installed to avoid it) but now I'm inexplicably in the same position as @MikeMcQuaid.

A fresh install of Catalina with the Command Line Tools installed is identical to @miccal's output above. For whatever reason, I now have working subversion binaries in /Library/Developer/CommandLineTools/usr/bin/ and /usr/bin and brew tests predictably works without the subversion formula installed.

I did a fresh install of macOS 10.15 when it was released, so somewhere in the last few months my situation changed and I have no idea what led to the difference.

@MikeMcQuaid
Copy link
Member

I did a fresh install of macOS 10.15 when it was released, so somewhere in the last few months my situation changed and I have no idea what led to the difference.

Probably installing the CLT and/or a CLT update?

@samford
Copy link
Member

samford commented Jun 23, 2020

Probably installing the CLT and/or a CLT update?

I imagine it must have been a CLT update because I had the CLT installed back in April.

I uninstalled the Command Line Tools and reinstalled them just now and I'm back in the same boat as @miccal again, for what it's worth. There definitely aren't any Subversion binaries in /Library/Developer/CommandLineTools/usr/bin/ now, which is what the files in /usr/bin were using before.

@miccal
Copy link
Contributor Author

miccal commented Jun 23, 2020

This issue first appeared (to my knowledge) in homebrew-cask-fonts and at that stage I did not have this issue, but I guess it may be because sometimes I have to force an update of the CLT's via:

sudo rm -r -f /Library/Developer/CommandLineTools; sudo xcode-select --install

@MikeMcQuaid
Copy link
Member

@miccal @samford I've opened a PR for this in #7814. If you could test it out that'd be wonderful.

@miccal
Copy link
Contributor Author

miccal commented Jun 24, 2020

@MikeMcQuaid:

-bash-5.0.17- /Users/miccal (29) [> brew tests --only=utils/svn --verbose --debug
Randomized with seed 32898
bundle exec parallel_rspec --nice -- -I /usr/local/Homebrew/Library/Homebrew/test --seed 32898 --color --require spec_helper --format NoSeedProgressFormatter --format ParallelTests::RSpec::RuntimeLogger --out /Users/miccal/Library/Caches/Homebrew/tests/parallel_runtime_rspec.log --tag ~needs_linux -- test/utils/svn_spec.rb
1 processes for 1 specs, ~ 1 specs per process
F..*

Pending: (Failures listed here are expected and do not affect your suite's status)

  1) Utils#self.svn_remote_exists? when svn is available returns true when remote exists
     # Requires network connection.
     # ./test/utils/svn_spec.rb:35


Failures:

  1) Utils#self.svn_available? returns svn version if svn available
     Failure/Error: expect(described_class).to be_svn_available
       expected `Utils.svn_available?` to return true, got false
     # ./test/utils/svn_spec.rb:13:in `block (3 levels) in <top (required)>'
     # ./test/spec_helper.rb:185:in `block (2 levels) in <top (required)>'
     # ./vendor/bundle/ruby/2.6.0/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:124:in `block in run'
     # ./vendor/bundle/ruby/2.6.0/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:110:in `loop'
     # ./vendor/bundle/ruby/2.6.0/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:110:in `run'
     # ./vendor/bundle/ruby/2.6.0/gems/rspec-retry-0.6.2/lib/rspec_ext/rspec_ext.rb:12:in `run_with_retry'
     # ./vendor/bundle/ruby/2.6.0/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:37:in `block (2 levels) in setup'
     # ./vendor/bundle/ruby/2.6.0/gems/rspec-wait-0.0.9/lib/rspec/wait.rb:46:in `block (2 levels) in <top (required)>'

Finished in 0.15305 seconds (files took 1.91 seconds to load)
4 examples, 1 failure, 1 pending

Failed examples:

rspec ./test/utils/svn_spec.rb:11 # Utils#self.svn_available? returns svn version if svn available


4 examples, 1 failure, 1 pending

Took 2 seconds
Tests Failed

@MikeMcQuaid
Copy link
Member

@miccal So: it's failing but not blocking forever? That seems like progress!

@miccal
Copy link
Contributor Author

miccal commented Jun 24, 2020

@MikeMcQuaid progress indeed :)

Why not just require brew install svn for Catalina -- that would fix this issue as well?

@MikeMcQuaid
Copy link
Member

@MikeMcQuaid progress indeed :)

@miccal Can you try again? Now the shim is working as expected for you I'd fixed the test code accordingly.

Why not just require brew install svn for Catalina -- that would fix this issue as well?

That's what the shim does. If it doesn't fix the Cask issue: Cask should be updated to always use the Homebrew shim instead of Subversion directly.

@miccal
Copy link
Contributor Author

miccal commented Jun 24, 2020

@MikeMcQuaid:

-bash-5.0.17- /Users/miccal (29) [> brew tests --only=utils/svn --verbose --debug

Randomized with seed 64512
bundle exec parallel_rspec --nice -- -I /usr/local/Homebrew/Library/Homebrew/test --seed 64512 --color --require spec_helper --format NoSeedProgressFormatter --format ParallelTests::RSpec::RuntimeLogger --out /Users/miccal/Library/Caches/Homebrew/tests/parallel_runtime_rspec.log --tag ~needs_linux -- test/utils/svn_spec.rb
1 processes for 1 specs, ~ 1 specs per process
...*

Pending: (Failures listed here are expected and do not affect your suite's status)

  1) Utils#self.svn_remote_exists? when svn is available returns true when remote exists
     # Requires network connection.
     # ./test/utils/svn_spec.rb:35


Finished in 0.17601 seconds (files took 1.51 seconds to load)
4 examples, 0 failures, 1 pending


4 examples, 0 failures, 1 pending

Took 1 seconds

@MikeMcQuaid
Copy link
Member

@miccal Hooray, fixed! Once I get it working in CI I'll merge. Thanks for all the help ❤️

@miccal
Copy link
Contributor Author

miccal commented Jun 24, 2020

@MikeMcQuaid don't thank me, you did all the work! Thank you :)

@miccal
Copy link
Contributor Author

miccal commented Jun 24, 2020

@MikeMcQuaid may I trouble you with a (probably) dumb question -- what is the easiest way to test an open PR locally?

@MikeMcQuaid
Copy link
Member

@miccal Not dumb! hub checkout $URL.

@miccal
Copy link
Contributor Author

miccal commented Jun 24, 2020

@MikeMcQuaid nice, that is easy, thank you.

@Bo98
Copy link
Member

Bo98 commented Jun 24, 2020

Not that it matters much, but just to add that /usr/bin/svn is now gone in Big Sur.

@miccal
Copy link
Contributor Author

miccal commented Jun 24, 2020

All fixed, thanks again @MikeMcQuaid.

Command output
-bash-5.0.17- /Users/miccal (29) [> brew tests
Randomized with seed 54182
8 processes for 282 specs, ~ 35 specs per process
.*.*.......*.............*................................................................................*****......................................................................................................................................................*...............................................................................................................................................................................................................................................................................................................................................................................................................*.**...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

Finished in 1 minute 32.38 seconds (files took 4.37 seconds to load)
376 examples, 0 failures

...............................................................................................................................................................................................................................................*...................

Pending: (Failures listed here are expected and do not affect your suite's status)

  1. UnpackStrategy::Subversion #extract

    subversion not installed.

    ./test/unpack_strategy/shared_examples.rb:12

  2. UnpackStrategy::Subversion is correctly detected

    subversion not installed.

    ./test/unpack_strategy/shared_examples.rb:6

  3. UnpackStrategy::Subversion when the directory name contains an '@' symbol #extract

    subversion not installed.

    ./test/unpack_strategy/shared_examples.rb:12

Finished in 2 minutes 7 seconds (files took 4.4 seconds to load)
311 examples, 0 failures, 3 pending

.......................................................................................................................................................................................................................................................................................................................................................................................................*............

Pending: (Failures listed here are expected and do not affect your suite's status)

  1. brew bundle check checks if a Brewfile's dependencies are satisfied

    Requires network connection.

    ./test/cmd/bundle_spec.rb:5

  2. brew cask list returns a list of installed Casks

    Requires network connection.

    ./test/cmd/cask_spec.rb:5

  3. Bintray::package_exists? detects a package

    Requires network connection.

    ./test/bintray_spec.rb:20

  4. Bintray::file_published? detects a published file

    Requires network connection.

    ./test/bintray_spec.rb:8

  5. Bintray::file_published? fails on a non-existant file

    Requires network connection.

    ./test/bintray_spec.rb:13

  6. Language::Java::overridable_java_home_env returns java_home path without version if version is not specified

    Java not installed.

    ./test/language/java_spec.rb:36

  7. Language::Java::java_home returns valid JAVA_HOME if version is specified

    Java not installed.

    ./test/language/java_spec.rb:7

  8. Language::Java::java_home returns valid JAVA_HOME if version is not specified

    Java not installed.

    ./test/language/java_spec.rb:12

  9. Language::Java::java_home_env returns java_home path without version if version is not specified

    Java not installed.

    ./test/language/java_spec.rb:24

Finished in 2 minutes 28.9 seconds (files took 4.35 seconds to load)
355 examples, 0 failures, 9 pending

...

Pending: (Failures listed here are expected and do not affect your suite's status)

  1. Cask::Cmd::Info can run be run with a url twice and returns analytics

    Requires network connection.

    ./test/cask/cmd/info_spec.rb:143

Finished in 2 minutes 31.6 seconds (files took 4.41 seconds to load)
264 examples, 0 failures, 1 pending

.............................................................................................................................................................................................................

Pending: (Failures listed here are expected and do not affect your suite's status)

  1. GitHub::search_code queries GitHub code with the passed parameters

    Requires network connection.

    ./test/utils/github_spec.rb:7

  2. GitHub::get_artifact_url fails to find artifacts that don't exist

    Requires network connection.

    ./test/utils/github_spec.rb:52

  3. GitHub::get_artifact_url gets an artifact link

    Requires network connection.

    ./test/utils/github_spec.rb:58

  4. GitHub::get_artifact_url fails to find a nonexistant workflow

    Requires network connection.

    ./test/utils/github_spec.rb:46

  5. GitHub::search_issues queries GitHub issues with the passed parameters

    Requires network connection.

    ./test/utils/github_spec.rb:35

  6. brew search falls back to a GitHub tap search when no formula is found

    Requires network connection.

    ./test/cmd/search_spec.rb:11

Finished in 2 minutes 51.1 seconds (files took 4.39 seconds to load)
291 examples, 0 failures, 6 pending

...........................................................................................................

Finished in 3 minutes 37.2 seconds (files took 4.43 seconds to load)
291 examples, 0 failures

....................................................................................................................................................................................................................................................................................................................................

Pending: (Failures listed here are expected and do not affect your suite's status)

  1. brew services allows controlling services

    Requires network connection.

    ./test/cmd/services_spec.rb:4

  2. Utils#self.svn_remote_exists? when svn is available returns true when remote exists

    Requires network connection.

    ./test/utils/svn_spec.rb:35

  3. Utils::git_remote_exists? when git is available returns true when git remote exists

    Requires network connection.

    ./test/utils/git_spec.rb:133

Finished in 4 minutes 43.3 seconds (files took 4.48 seconds to load)
613 examples, 0 failures, 3 pending

...........................................................*......................................................................................................

Pending: (Failures listed here are expected and do not affect your suite's status)

  1. brew pull fetches a patch from a GitHub commit or pull request and applies it

    Requires network connection.

    ./test/dev-cmd/pull_spec.rb:10

  2. Tap #private?

    HOMEBREW_GITHUB_API_TOKEN is required

    ./test/tap_spec.rb:186

Finished in 12 minutes 14 seconds (files took 4.29 seconds to load)
279 examples, 0 failures, 2 pending

2780 examples, 0 failures, 24 pendings

Took 738 seconds (12:18)

@BrewTestBot BrewTestBot added the outdated PR was locked due to age label Dec 3, 2020
@Homebrew Homebrew locked as resolved and limited conversation to collaborators Dec 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants