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

v3.0.0-alpha-2 make check has 4 test failures on Windows/mingw #233

Closed
matt1 opened this issue Mar 8, 2015 · 7 comments
Closed

v3.0.0-alpha-2 make check has 4 test failures on Windows/mingw #233

matt1 opened this issue Mar 8, 2015 · 7 comments

Comments

@matt1
Copy link

matt1 commented Mar 8, 2015

Couldn't find an existing issue for this. Trying to build to get grpc-java up and running using a fresh mingw installation.

Followed these instructions from grpc-java.

$ git clone https://github.com/google/protobuf.git
$ cd protobuf
$ git checkout v3.0.0-alpha-2
$ ./autogen.sh
$ ./configure
$ make
$ make check

4 tests are failing.
[----------] Global test environment tear-down
[==========] 1221 tests from 133 test cases ran. (378102 ms total)
[ PASSED ] 1217 tests.
[ FAILED ] 4 tests, listed below:
[ FAILED ] RubyGeneratorTest.GeneratorTest
[ FAILED ] BootstrapTest.GeneratedDescriptorMatches
[ FAILED ] TextFormatTest.Basic
[ FAILED ] TextFormatExtensionsTest.Extensions

This is on windows 7, mingw-base version as reported by mingw-get "2013072200".

@liujisi
Copy link
Contributor

liujisi commented Mar 10, 2015

Could you print the detailed failure log, as well as the autoconf, automake, libtools and gcc version? I tested on the latest mingw before alpha-2 release and didn't find any failing tests.

@Harshasa
Copy link

Hi ,
Am also getting error during step
make check

Steps followed:
Installing "protobuf-cpp-3.0.0-alpha-2.tar.gz" on ubuntu. 3.16.0-23-generic #31

  1. tar xzvf protobuf-cpp-3.0.0-alpha-2.tar.gz
  2. cd protobuf-3.0.0-alpha-2
  3. ./configure
  4. make
  5. make check

In test-suit.log file i can see this error first.
[libprotobuf FATAL google/protobuf/compiler/ruby/ruby_generator_unittest.cc:53] Could not find Ruby test directory. Please run tests from somewhere within the protobuf source package.
unknown file: Failure
C++ exception with description "Could not find Ruby test directory. Please run tests from somewhere within the protobuf source package." thrown in the test body.
[ FAILED ] RubyGeneratorTest.GeneratorTest (388 ms)

can any one help to resolve this???

gRPC is prompting to install protobuf 3.0 as prerequisite so am trying to install this package.

because of this am stuck for gRPC.

Thanks in advance.
Harsha

@liujisi
Copy link
Contributor

liujisi commented Mar 12, 2015

Add @cfallin to take a look at the failing ruby tests.

@cfallin
Copy link
Contributor

cfallin commented Mar 12, 2015

All tests passed on Windows when we did the release testing, sorry. It's not possible to say any more about the cause without seeing your exact setup.

However, it seems that all four failing tests are ones that compare output to a golden file in the source tree. So perhaps there is something systematically wrong with the way your source tree is laid out, or with how your build is interacting with the filesystem?

@matt1
Copy link
Author

matt1 commented Mar 24, 2015

Apologies for delay in response to this. I would imagine my source tree layout is fairly default - I just checkout and go without any messing around, but please do let me know if there is anything specific in mingw that you'd like me to check (I am more of a Java guy so all this stuff is alien to me - apologies!).

At least some of the errors are windows vs unix line endings (\n vs \r\n) - BootstrapTest.GeneratedDescriptorMatches however is not so clear

Requested version details, steps to checkout used, and output from autogen, configure, make and make check are in this gist
https://gist.github.com/matt1/4e6257f3a8a418389b35

@cfallin
Copy link
Contributor

cfallin commented Mar 24, 2015

Ah! I'm pretty sure I know what the issue is. Consider this failure from TextFormatTest:

google/protobuf/text_format_unittest.cc:121: Failure
Value of: proto_.DebugString()
  Actual: "optional_int32: 101\noptional_int64: 102\n..."
Expected: proto_debug_string_
Which is: "optional_int32: 101\r\noptional_int64: 102\r\n..."

Note the difference in line endings: \n vs. \r\n. As I suspected, this happens in every test that compares against a golden file, and your golden files have Windows-style line endings, so the contents do not match (the code generates only \n).

The answer is to change the text format that git uses to check out your tree. I believe the core.autocrlf git option controls this behavior. You'll probably want to change it globally then check out a fresh clone of protobuf.

@matt1
Copy link
Author

matt1 commented Mar 24, 2015

Ah thanks - I learnt something about git today!

All tests passing. If anyone else finds the same problem, check what your core.autocrlf is. Mine was set to true and was converting the unix line endings in the tests to windows formats automatically when writing the files to the local workspace.

Set this to false with something like git config --global core.autocrlf false, clone again from scratch and build and the tests pass fine this time (since git is no longer fiddling with the line endings behind the scenes).

@matt1 matt1 closed this as completed Mar 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants