google / sandboxed-api

Generate sandboxes for C/C++ libraries automatically
https://developers.google.com/sandboxed-api/
Apache License 2.0
1.66k stars 190 forks source link

Curl example build failed #76

Closed xsmart closed 3 years ago

xsmart commented 3 years ago

I use master version to test curl, there has build error

mkdir -p build
cd build 
cmake .. -G Ninja -D SAPI_ROOT=/home/user/sandbox/curl/sandboxed-api
cmake --build .

sandbox/curl/sandboxed-api/oss-internship-2020/curl/build$ cmake --build .
[2/4] Building CXX object tests/CMakeFiles/tests.dir/tests.cc.o
FAILED: tests/CMakeFiles/tests.dir/tests.cc.o 
/usr/bin/c++  -DGOOGLE_GLOG_DLL_DECL="" -I. -Iabsl-src -Iprotobuf-src/src -Iglog-build -Iglog-src/src -Igflags-build/include -Isandboxed-api-build -I/home/user/sandbox/curl/sandboxed-api -isystem googletest-src/googletest/include -isystem googletest-src/googletest -isystem googletest-src/googlemock/include -isystem googletest-src/googlemock -fPIE   -pthread -Wno-deprecated -Wno-deprecated-declarations -Wno-psabi -std=gnu++17 -MD -MT tests/CMakeFiles/tests.dir/tests.cc.o -MF tests/CMakeFiles/tests.dir/tests.cc.o.d -o tests/CMakeFiles/tests.dir/tests.cc.o -c ../tests/tests.cc
In file included from ../tests/test_utils.h:23,
                 from ../tests/tests.cc:15:
../tests/tests.cc: In member function 'virtual void {anonymous}::CurlTest_EffectivePort_Test::TestBody()':
../tests/tests.cc:63:59: error: 'CURLINFO_PRIMARY_PORT' was not declared in this scope
                                              curl_.get(), CURLINFO_PRIMARY_PORT,
                                                           ^~~~~~~~~~~~~~~~~~~~~
/home/user/sandbox/curl/sandboxed-api/sandboxed_api/util/status_matchers.h:31:20: note: in definition of macro 'SAPI_ASSERT_OK_AND_ASSIGN_IMPL'
   auto statusor = (rexpr);                                   \
                    ^~~~~
../tests/tests.cc:62:3: note: in expansion of macro 'SAPI_ASSERT_OK_AND_ASSIGN'
   SAPI_ASSERT_OK_AND_ASSIGN(int getinfo_code, api_->curl_easy_getinfo_ptr(
   ^~~~~~~~~~~~~~~~~~~~~~~~~
../tests/tests.cc:63:59: note: suggested alternative:
                                              curl_.get(), CURLINFO_PRIMARY_PORT,
                                                           ^~~~~~~~~~~~~~~~~~~~~
/home/user/sandbox/curl/sandboxed-api/sandboxed_api/util/status_matchers.h:31:20: note: in definition of macro 'SAPI_ASSERT_OK_AND_ASSIGN_IMPL'
   auto statusor = (rexpr);                                   \
                    ^~~~~
../tests/tests.cc:62:3: note: in expansion of macro 'SAPI_ASSERT_OK_AND_ASSIGN'
   SAPI_ASSERT_OK_AND_ASSIGN(int getinfo_code, api_->curl_easy_getinfo_ptr(
   ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../tests/../sandbox.h:24,
                 from ../tests/test_utils.h:18,
                 from ../tests/tests.cc:15:
./curl_sapi.sapi.h:187:2: note:   'CURLINFO_PRIMARY_PORT'
  CURLINFO_PRIMARY_PORT = CURLINFO_LONG + 40 ,
  ^~~~~~~~~~~~~~~~~~~~~
In file included from googletest-src/googletest/include/gtest/gtest.h:384,
                 from ../tests/test_utils.h:20,
                 from ../tests/tests.cc:15:
../tests/tests.cc:65:27: error: 'CURLE_OK' was not declared in this scope
   ASSERT_EQ(getinfo_code, CURLE_OK);
                           ^~~~~~~~
../tests/tests.cc:65:27: note: suggested alternative:
In file included from ../tests/../sandbox.h:24,
                 from ../tests/test_utils.h:18,
                 from ../tests/tests.cc:15:
./curl_sapi.sapi.h:39:2: note:   'CURLE_OK'
  CURLE_OK = 0 ,
  ^~~~~~~~
In file included from ../tests/test_utils.h:23,
                 from ../tests/tests.cc:15:
../tests/tests.cc: In member function 'virtual void {anonymous}::CurlTest_ContentType_Test::TestBody()':
../tests/tests.cc:94:59: error: 'CURLINFO_CONTENT_TYPE' was not declared in this scope
                                              curl_.get(), CURLINFO_CONTENT_TYPE,
                                                           ^~~~~~~~~~~~~~~~~~~~~
/home/user/sandbox/curl/sandboxed-api/sandboxed_api/util/status_matchers.h:31:20: note: in definition of macro 'SAPI_ASSERT_OK_AND_ASSIGN_IMPL'
   auto statusor = (rexpr);                                   \
                    ^~~~~
../tests/tests.cc:93:3: note: in expansion of macro 'SAPI_ASSERT_OK_AND_ASSIGN'
   SAPI_ASSERT_OK_AND_ASSIGN(int getinfo_code, api_->curl_easy_getinfo_ptr(
   ^~~~~~~~~~~~~~~~~~~~~~~~~
../tests/tests.cc:94:59: note: suggested alternative:
                                              curl_.get(), CURLINFO_CONTENT_TYPE,
                                                           ^~~~~~~~~~~~~~~~~~~~~
/home/user/sandbox/curl/sandboxed-api/sandboxed_api/util/status_matchers.h:31:20: note: in definition of macro 'SAPI_ASSERT_OK_AND_ASSIGN_IMPL'
   auto statusor = (rexpr);                                   \
                    ^~~~~
../tests/tests.cc:93:3: note: in expansion of macro 'SAPI_ASSERT_OK_AND_ASSIGN'
   SAPI_ASSERT_OK_AND_ASSIGN(int getinfo_code, api_->curl_easy_getinfo_ptr(
   ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../tests/../sandbox.h:24,
                 from ../tests/test_utils.h:18,
                 from ../tests/tests.cc:15:
./curl_sapi.sapi.h:165:2: note:   'CURLINFO_CONTENT_TYPE'
  CURLINFO_CONTENT_TYPE = CURLINFO_STRING + 18 ,
  ^~~~~~~~~~~~~~~~~~~~~
In file included from googletest-src/googletest/include/gtest/gtest.h:384,
                 from ../tests/test_utils.h:20,
                 from ../tests/tests.cc:15:
../tests/tests.cc:96:27: error: 'CURLE_OK' was not declared in this scope
   ASSERT_EQ(getinfo_code, CURLE_OK);
                           ^~~~~~~~
../tests/tests.cc:96:27: note: suggested alternative:
In file included from ../tests/../sandbox.h:24,
                 from ../tests/test_utils.h:18,
                 from ../tests/tests.cc:15:
./curl_sapi.sapi.h:39:2: note:   'CURLE_OK'
  CURLE_OK = 0 ,
  ^~~~~~~~
In file included from ../tests/test_utils.h:23,
                 from ../tests/tests.cc:15:
../tests/tests.cc: In member function 'virtual void {anonymous}::CurlTest_POSTResponse_Test::TestBody()':
../tests/tests.cc:119:58: error: 'CURLOPT_POST' was not declared in this scope
                                             curl_.get(), CURLOPT_POST, 1l));
                                                          ^~~~~~~~~~~~
/home/user/sandbox/curl/sandboxed-api/sandboxed_api/util/status_matchers.h:31:20: note: in definition of macro 'SAPI_ASSERT_OK_AND_ASSIGN_IMPL'
   auto statusor = (rexpr);                                   \
                    ^~~~~
../tests/tests.cc:118:3: note: in expansion of macro 'SAPI_ASSERT_OK_AND_ASSIGN'
   SAPI_ASSERT_OK_AND_ASSIGN(int setopt_post, api_->curl_easy_setopt_long(
   ^~~~~~~~~~~~~~~~~~~~~~~~~
../tests/tests.cc:119:58: note: suggested alternative:
                                             curl_.get(), CURLOPT_POST, 1l));
                                                          ^~~~~~~~~~~~
/home/user/sandbox/curl/sandboxed-api/sandboxed_api/util/status_matchers.h:31:20: note: in definition of macro 'SAPI_ASSERT_OK_AND_ASSIGN_IMPL'
   auto statusor = (rexpr);                                   \
                    ^~~~~
../tests/tests.cc:118:3: note: in expansion of macro 'SAPI_ASSERT_OK_AND_ASSIGN'
   SAPI_ASSERT_OK_AND_ASSIGN(int setopt_post, api_->curl_easy_setopt_long(
   ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../tests/../sandbox.h:24,
                 from ../tests/test_utils.h:18,
                 from ../tests/tests.cc:15:
./curl_sapi.sapi.h:253:11: note:   'CURLOPT_POST'
  CURLOPT( CURLOPT_POST , CURLOPTTYPE_LONG , 47 ) ,
           ^~~~~~~~~~~~
./curl_sapi.sapi.h:21:32: note: in definition of macro 'CURLOPT'
 #define CURLOPT( na , t , nu ) na = t + nu
                                ^~
In file included from googletest-src/googletest/include/gtest/gtest.h:384,
                 from ../tests/test_utils.h:20,
                 from ../tests/tests.cc:15:
../tests/tests.cc:120:26: error: 'CURLE_OK' was not declared in this scope
   ASSERT_EQ(setopt_post, CURLE_OK);
                          ^~~~~~~~
../tests/tests.cc:120:26: note: suggested alternative:
In file included from ../tests/../sandbox.h:24,
                 from ../tests/test_utils.h:18,
                 from ../tests/tests.cc:15:
./curl_sapi.sapi.h:39:2: note:   'CURLE_OK'
  CURLE_OK = 0 ,
  ^~~~~~~~
[3/4] Building CXX object tests/CMakeFiles/tests.dir/test_utils.cc.o
FAILED: tests/CMakeFiles/tests.dir/test_utils.cc.o 
/usr/bin/c++  -DGOOGLE_GLOG_DLL_DECL="" -I. -Iabsl-src -Iprotobuf-src/src -Iglog-build -Iglog-src/src -Igflags-build/include -Isandboxed-api-build -I/home/user/sandbox/curl/sandboxed-api -isystem googletest-src/googletest/include -isystem googletest-src/googletest -isystem googletest-src/googlemock/include -isystem googletest-src/googlemock -fPIE   -pthread -Wno-deprecated -Wno-deprecated-declarations -Wno-psabi -std=gnu++17 -MD -MT tests/CMakeFiles/tests.dir/test_utils.cc.o -MF tests/CMakeFiles/tests.dir/test_utils.cc.o.d -o tests/CMakeFiles/tests.dir/test_utils.cc.o -c ../tests/test_utils.cc
../tests/test_utils.cc:30:5: error: 'CurlTestUtils' has not been declared
 int CurlTestUtils::port_;
     ^~~~~~~~~~~~~
../tests/test_utils.cc:31:13: error: 'CurlTestUtils' has not been declared
 std::thread CurlTestUtils::server_thread_;
             ^~~~~~~~~~~~~
ninja: build stopped: subcommand failed.