"brew tests" fails

(James T White) #1

I originally posted this as an issue on github, https://github.com/Homebrew/brew/issues/5829. The discourse is probably the better place for this as it’s not really a bug with brew but seems to be an issue with my system. I’m at a complete loss. I seem to be getting two things from the logs, one that the compiler that’s being used seems to be outdated and two that I need the ruby dev tools installed.

I don’t know how to trace things to determine which compiler is being used. Will I need to get IT to install ruby-devel? Is there anyway to get ruby-devel via Linuxbrew?

I love the fact that Linuxbrew allows for installation of many applications without the need for sudo; however, I do find myself having to request that our IT install applications with sudo to get Linuxbrew to work. This can be a bit frustrating at times.

Any input is much appreciated. Thanks.

(James T White) #2

I can’t tell which compiler is being used. The logs point to nothing. I have the following.

$ which -a gcc
$ gcc --version
gcc (Homebrew gcc 5.5.0_4) 5.5.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
$ /usr/bin/gcc --version
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO

In the logs, I see messages such as ruby.h:1431: error: wrong number of arguments specified for ‘deprecated’ attribute which I’ve read can be caused by using an older compiler.

(James T White) #3

I also see in the logs You have to install development tools first. I recently rebuilt Linuxbrew and had our IT sudo yum groupinstall 'Development Tools' && sudo yum install curl file git. Do the logs refer to needing to do a sudo yum install ruby-devel?

(Shaun Jackman) #4

Hi, James. It should be using the brewed gcc and the brewed ruby installed at


No other software should need to be provided by the host system.

(James T White) #5

Thanks for the response, Shaun. What you have stated is what I’ve assumed. I removed, by commenting out, lines 1422 and 1431 from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/include/ruby-2.3.0/ruby/ruby.h, and the builds with native extensions for the gems is now successful. The lines are as follows:

1422:// DEPRECATED_BY(rb_data_object_wrap, static inline VALUE rb_data_object_alloc(VALUE,void*,RUBY_DATA_FUNC,RUBY_DATA_FUNC));
1431:// DEPRECATED_BY(rb_data_typed_object_wrap, static inline VALUE rb_data_typed_object_alloc(VALUE,void*,const rb_data_type_t*));

I now have a different problem. brew tests is now running; however, it’s returning failures.

1641 examples, 3 failures, 13 pendings

Took 157 seconds (2:37)
Tests Failed

I’d really like to get this PR submitted for r.rb, but I’m running into quite a bit of difficulty.

(Shaun Jackman) #6

What are the three failed tests? It should say further up.

(James T White) #7
Hardware::CPU::family returns the current CPU's family name as a symbol, or :dunno if it cannot be detected
     Failure/Error: expect(cpu_families).to include described_class.family

       expected [:core, :core2, :penryn, :nehalem, :arrandale, :sandybridge, :ivybridge, :haswell, :broadwell, :skyl:kabylake, :dunno] to include :merom
DependencyCollector#add creates a resource dependency from a CVS URL
     Failure/Error: expect(subject.add(resource)).to eq(Dependency.new("cvs", [:build]))

       expected: #<Dependency: "cvs" [:build]>
            got: nil

I’m not too worried about the following.

brew ruby executes ruby code with Homebrew's libraries loaded
       expect { brew "ruby", "-e", "exit 0" }
         .to be_a_success
         .and not_to_output.to_stdout
         .and not_to_output.to_stderr

       expected block to not output to stderr, but output "/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/langpython.rb:6: warning: Insecure world writable dir /home in PATH, mode 040777\n"
(Shaun Jackman) #8

What’s the output of brew config | grep CPU?

(James T White) #9
$ brew config | grep -i cpu
CPU: octa-core 64-bit merom
(James T White) #10


None of these may be all too serious; however, I am paying strict attention to the PR-submission instructions which include “Test your changes by running the following, and ensure they all pass without issue.”

(James T White) #11


Also the system context of my Linuxbrew set-up is complicated. The directory /home on our systems is a network share. I manage Linuxbrew (installations, etc.) from one particular server, but we run Linuxbrew-installed applications from many of our Linux servers. This includes a compute cluster with 24 nodes as well as servers which host our LIMS (laboratory information management systems).

I just ran brew tests from one of our compute-cluster nodes, and the error output is much messier than what I’ve reported above.

Check out the following diff. Output from a compute-cluster node is on the left and that from the machine from which I manage Linuxbrew is on the right.

$ diff <(brew config) <(ssh seatl0app012 'brew config')
< CPU: 48-core 64-bit haswell
> CPU: octa-core 64-bit merom
< Java: 1.7.0_79
< Kernel: Linux 3.8.13-118.2.2.el6uek.x86_64 x86_64 GNU/Linux
< OS: Oracle Linux Server release 6.7 (n/a)
> Java: 1.7.0_65
> Kernel: Linux 2.6.32-504.el6.x86_64 x86_64 GNU/Linux
> OS: Red Hat Enterprise Linux Server release 6.6 (Santiago) (Santiago)
(Jonathan Chang) #12

Looks like an issue with our tests. I’ll open a pull request to address this. Thanks for helping us diagnose this problem!

(Jonathan Chang) #13

@jwhite007 this pull request should address the test issue (hopefully). Try it out and see if you still get the same failure https://github.com/Homebrew/brew/pull/5853

(James T White) #14

@jonchang, thanks. That fixes the unrecognized-cpu issue. I’m not too worried about the third error that I report above. Those permissions were set by our admins and not too critical to the functionality of Linuxbrew. I’m not sure exactly what the second of those errors is trying to tell me.

(Shaun Jackman) #15

Here’s a link to the failing test:

It’s failing because your system already has cvs installed.
See https://github.com/Homebrew/brew/blob/d8c6f6b12075a06a9837f6fce920ccd07a36ca4c/Library/Homebrew/dependency_collector.rb#L66-L68

Would you like to open a PR to fix the test so that it does not fail if /usr/bin/cvs exists?

(James T White) #16

Sorry for the delay, Shaun. I’ll work on this PR.

(Shaun Jackman) #17

That’s great! Thanks, James.

(James T White) #18


Sorry again for the delay. It’s been crunch time at work.

I’m not exactly sure how you would like this to work. Would you like me to test explicitly for /usr/bin/cvs or for any cvs in the user’s path. From what you wrote, I would assume the former; however, the latter makes more sense to me.


(Shaun Jackman) #19

No worries. You can use which("cvs") to check for any cvs in the PATH. Thanks!

(James T White) #20


I had written it with find_executable from mkmf. I could not get which ("cvs") to work in the irb. I now see that which is defined in requirement.rb.

If cvs is found in PATH, brew tests now skips the cvs test .

Only one test is now failing, and this is due to a world-writable /home. This is something that I have no control over. Our IT sets this.

expected block to not output to stderr, but output "/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/language/python.rb:6: warning: Insecure world writable dir /home in PATH, mode 040777\n"

The only other thing which is holding me back is my concern stated at Brew tests prompts for authentication. Any ideas? Thanks.