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)
committerGichan Jang <gichan2.jang@samsung.com>
Thu, 13 May 2021 02:41:00 +0000 (11:41 +0900)
commit7314cf87eecfad6168246076373e7a3d81f0a595
tree1699c42d0b0e8a5dce2f9bf25bfd48f42597d53b
parent36f662074ea24e500debe7de64ada4cded7a0bb5
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