google / s2geometry

Computational geometry and spatial indexing on the sphere
http://s2geometry.io/
Apache License 2.0
2.29k stars 302 forks source link

encoded_s2point_vector_test fails to build with recent abseil #359

Closed benstadin closed 5 months ago

benstadin commented 5 months ago

https://github.com/google/s2geometry/blob/7940c9f791819211782bd7df51632657172c17c2/src/s2/encoded_s2point_vector_test.cc#L377

This line fails to compile with recent versions of abseil with the error. below. It should be changed to (adding .value()):

S2Testing::rnd.Reset(absl::GetFlag(FLAGS_s2_random_seed));

/var/lib/jenkins/workspace/s2geometry_master/s2geometry/src/s2/encoded_s2point_vector_test.cc: In member function 'virtual void s2coding::EncodedS2PointVectorTest_SnappedFractalLoops_Test::TestBody()': /var/lib/jenkins/workspace/s2geometry_master/s2geometry/src/s2/encoded_s2point_vector_test.cc:377:24: error: cannot convert 'absl::lts_20240116::Flag' {aka 'absl::lts_20240116::flags_internal::Flag'} to 'int32' {aka 'int'} 377 S2Testing::rnd.Reset(FLAGS_s2_random_seed); ^~~~~~~~
absl::lts_20240116::Flag {aka absl::lts_20240116::flags_internal::Flag}

In file included from /var/lib/jenkins/workspace/s2geometry_master/s2geometry/src/s2/encoded_s2point_vector_test.cc:43: /var/lib/jenkins/workspace/s2geometry_master/s2geometry/src/s2/s2testing.h:264:20: note: initializing argument 1 of 'void S2Testing::Random::Reset(int32)' 264 | void Reset(int32 seed); | ~~^~~~

jmr commented 5 months ago

Again, what code is this? Your error message has Reset(FLAGS_s2_random_seed), but the link has Reset(GetFlag(FLAGS_s2_random_seed)).

benstadin commented 5 months ago

Sorry, please ignore this issue.