Re-ported build-error workaround from 1.6.0
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Fri, 27 Mar 2020 00:52:34 +0000 (09:52 +0900)
committerYongjoo Ahn <yongjoo1.ahn@samsung.com>
Fri, 2 Dec 2022 07:37:24 +0000 (16:37 +0900)
commit44a29f3bba44b96038d6c133b99d64940ea16628
tree652c8c02bbb2c164de57238363eb0799364329e2
parent8f5f4c2aaa9110ec1d51d731beecef26a6890132
Re-ported build-error workaround from 1.6.0

There was a build-error fix in flatbuffers-1.6.0, which
was in bash build script. They appear to lose it when
they abandoned the bash build script.

The following is the commit message of the workaround
of flatbuffers 1.6.0 mainline:

Work around flatbuffers flaky build

The flatbuffers build ocasionally fails with the following error:

/flatbuffers/flatbuffers-1.6.0/src/idl_parser.cpp
/mnt/source/flatbuffers/flatbuffers-1.6.0/samples/sample_binary.cpp:19:17:
error: 'MyGame' has not been declared
 using namespace MyGame::Sample;
                 ^
/mnt/source/flatbuffers/flatbuffers-1.6.0/samples/sample_binary.cpp:19:25:
error: 'Sample' is not a namespace-name
 using namespace MyGame::Sample;
                         ^
/mnt/source/flatbuffers/flatbuffers-1.6.0/samples/sample_binary.cpp:19:31:
error: expected namespace-name before ';' token
 using namespace MyGame::Sample;
                               ^
/mnt/source/flatbuffers/flatbuffers-1.6.0/samples/sample_binary.cpp: In
function 'int main(int, const char**)':
/mnt/source/flatbuffers/flatbuffers-1.6.0/samples/sample_binary.cpp:25:3:
error: 'flatbuffers' has not been declared
   flatbuffers::FlatBufferBuilder builder;
   ^
/mnt/source/flatbuffers/flatbuffers-1.6.0/samples/sample_binary.cpp:28:26:
error: 'builder' was not declared in this scope
   auto weapon_one_name = builder.CreateString("Sword");
                          ^
...

Disabling the BUILD_TESTS target removes the flakiness and makes the
compilation faster.

Reviewed-on: http://gerrit.cloudera.org:8080/12886
Reviewed-by: Tim Armstrong <tarmstrong@cloudera.com>
Tested-by: Tim Armstrong <tarmstrong@cloudera.com>
Change-Id: Ica8300d7edad7d10adad311cc22c18b8987b1f9b
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
packaging/flatbuffers.spec