Skip to content

remove use of mach_absolute_time#15554

Closed
dmaclach wants to merge 1 commit intomainfrom
dmaclach-mach_absolute_time
Closed

remove use of mach_absolute_time#15554
dmaclach wants to merge 1 commit intomainfrom
dmaclach-mach_absolute_time

Conversation

@dmaclach
Copy link
Contributor

mach_absolute_time is one of Apple's required reason APIs (https://developer.apple.com/documentation/kernel/1462446-mach_absolute_time?language=objc). Replace it with the suggested clock_gettime_nsec_np(CLOCK_UPTIME_RAW) so that we don't need a RRA entry in a privacy manifest.

issue #15029

`mach_absolute_time` is one of Apple's required reason APIs (https://developer.apple.com/documentation/kernel/1462446-mach_absolute_time?language=objc). Replace it with the suggested `clock_gettime_nsec_np(CLOCK_UPTIME_RAW)` so that we don't need a RRA entry in a privacy manifest.

issue #15029
@dmaclach dmaclach marked this pull request as ready for review January 23, 2024 23:31
@dmaclach dmaclach requested a review from a team as a code owner January 23, 2024 23:31
@dmaclach dmaclach requested review from haberman, sbenzaquen and zhangskz and removed request for a team January 23, 2024 23:31
@fowles fowles added 🅰️ safe for tests Mark a commit as safe to run presubmits over ios labels Jan 24, 2024
zhangskz pushed a commit to zhangskz/protobuf that referenced this pull request Jan 31, 2024
`mach_absolute_time` is one of Apple's required reason APIs (https://developer.apple.com/documentation/kernel/1462446-mach_absolute_time?language=objc). Replace it with the suggested `clock_gettime_nsec_np(CLOCK_UPTIME_RAW)` so that we don't need a RRA entry in a privacy manifest.

issue protocolbuffers#15029

Closes protocolbuffers#15554

COPYBARA_INTEGRATE_REVIEW=protocolbuffers#15554 from protocolbuffers:dmaclach-mach_absolute_time 295d831
PiperOrigin-RevId: 601370915
zhangskz pushed a commit to zhangskz/protobuf that referenced this pull request Jan 31, 2024
`mach_absolute_time` is one of Apple's required reason APIs (https://developer.apple.com/documentation/kernel/1462446-mach_absolute_time?language=objc). Replace it with the suggested `clock_gettime_nsec_np(CLOCK_UPTIME_RAW)` so that we don't need a RRA entry in a privacy manifest.

issue protocolbuffers#15029

Closes protocolbuffers#15554

COPYBARA_INTEGRATE_REVIEW=protocolbuffers#15554 from protocolbuffers:dmaclach-mach_absolute_time 295d831
PiperOrigin-RevId: 601370915
zhangskz added a commit that referenced this pull request Jan 31, 2024
`mach_absolute_time` is one of Apple's required reason APIs (https://developer.apple.com/documentation/kernel/1462446-mach_absolute_time?language=objc). Replace it with the suggested `clock_gettime_nsec_np(CLOCK_UPTIME_RAW)` so that we don't need a RRA entry in a privacy manifest.

issue #15029

Closes #15554

COPYBARA_INTEGRATE_REVIEW=#15554 from protocolbuffers:dmaclach-mach_absolute_time 295d831
PiperOrigin-RevId: 601370915

Co-authored-by: dmaclach <dmaclach@gmail.com>
zhangskz pushed a commit that referenced this pull request Feb 12, 2024
`mach_absolute_time` is one of Apple's required reason APIs (https://developer.apple.com/documentation/kernel/1462446-mach_absolute_time?language=objc). Replace it with the suggested `clock_gettime_nsec_np(CLOCK_UPTIME_RAW)` so that we don't need a RRA entry in a privacy manifest.

issue #15029

Closes #15554

COPYBARA_INTEGRATE_REVIEW=#15554 from protocolbuffers:dmaclach-mach_absolute_time 295d831
PiperOrigin-RevId: 601370915
copybara-service bot pushed a commit to grpc/grpc that referenced this pull request Mar 21, 2024
… manifest (#36080)

#35923 removed the use of mach_absolute_time in gpr.

There is still one usage in protobuf, which they have removed the usage in protocolbuffers/protobuf#15554 but we haven't update yet.
However gRPC library does not depends on protobuf but upb, so we should no longer need NSPrivacyAccessedAPICategorySystemBootTime any more.

Closes #36080

COPYBARA_INTEGRATE_REVIEW=#36080 from HannahShiSFB:remove-privacy-for-mach_absolute_time dacccaf
PiperOrigin-RevId: 617995787
zhangskz pushed a commit that referenced this pull request Apr 22, 2024
`mach_absolute_time` is one of Apple's required reason APIs (https://developer.apple.com/documentation/kernel/1462446-mach_absolute_time?language=objc). Replace it with the suggested `clock_gettime_nsec_np(CLOCK_UPTIME_RAW)` so that we don't need a RRA entry in a privacy manifest.

issue #15029

Closes #15554

COPYBARA_INTEGRATE_REVIEW=#15554 from protocolbuffers:dmaclach-mach_absolute_time 295d831
PiperOrigin-RevId: 601370915
zhangskz added a commit that referenced this pull request Apr 26, 2024
remove use of mach_absolute_time (#15554)
deannagarcia pushed a commit to deannagarcia/protobuf that referenced this pull request Jun 20, 2024
`mach_absolute_time` is one of Apple's required reason APIs (https://developer.apple.com/documentation/kernel/1462446-mach_absolute_time?language=objc). Replace it with the suggested `clock_gettime_nsec_np(CLOCK_UPTIME_RAW)` so that we don't need a RRA entry in a privacy manifest.

issue protocolbuffers#15029

Closes protocolbuffers#15554

COPYBARA_INTEGRATE_REVIEW=protocolbuffers#15554 from protocolbuffers:dmaclach-mach_absolute_time 295d831
PiperOrigin-RevId: 601370915
@barracuda156
Copy link
Contributor

@dmaclach @fowles @sbenzaquen Now this fails to build on some macOS versions:

[ 24%] Building CXX object CMakeFiles/libprotobuf-lite.dir/src/google/protobuf/inlined_string_field.cc.o
/opt/local/bin/ccache /opt/local/bin/g++-mp-14 -DGOOGLE_PROTOBUF_CMAKE_BUILD -DHAVE_ZLIB -DLIBPROTOBUF_EXPORTS -DPROTOBUF_USE_DLLS -Dlibprotobuf_lite_EXPORTS -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_protobuf3-cpp-upstream/protobuf3-cpp-upstream/work/build -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_protobuf3-cpp-upstream/protobuf3-cpp-upstream/work/protobuf-28.0 -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_protobuf3-cpp-upstream/protobuf3-cpp-upstream/work/build/src -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_protobuf3-cpp-upstream/protobuf3-cpp-upstream/work/protobuf-28.0/src -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_protobuf3-cpp-upstream/protobuf3-cpp-upstream/work/protobuf-28.0/third_party/utf8_range -isystem /opt/local/include -pipe -DNDEBUG -isystem/opt/local/include/LegacySupport -I/opt/local/include -D_GLIBCXX_USE_CXX11_ABI=0 -O2 -g -DNDEBUG -arch ppc -mmacosx-version-min=10.6 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -MD -MT CMakeFiles/libprotobuf-lite.dir/src/google/protobuf/inlined_string_field.cc.o -MF CMakeFiles/libprotobuf-lite.dir/src/google/protobuf/inlined_string_field.cc.o.d -o CMakeFiles/libprotobuf-lite.dir/src/google/protobuf/inlined_string_field.cc.o -c /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_protobuf3-cpp-upstream/protobuf3-cpp-upstream/work/protobuf-28.0/src/google/protobuf/inlined_string_field.cc
In file included from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_protobuf3-cpp-upstream/protobuf3-cpp-upstream/work/protobuf-28.0/src/google/protobuf/message.h:110,
                 from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_protobuf3-cpp-upstream/protobuf3-cpp-upstream/work/protobuf-28.0/src/google/protobuf/api.pb.h:27,
                 from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_protobuf3-cpp-upstream/protobuf3-cpp-upstream/work/protobuf-28.0/src/google/protobuf/api.pb.cc:6:
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_protobuf3-cpp-upstream/protobuf3-cpp-upstream/work/protobuf-28.0/src/google/protobuf/map.h: In member function 'google::protobuf::internal::map_index_t google::protobuf::internal::UntypedMapBase::Seed() const':
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_protobuf3-cpp-upstream/protobuf3-cpp-upstream/work/protobuf-28.0/src/google/protobuf/map.h:712:9: error: 'clock_gettime_nsec_np' was not declared in this scope
  712 |     s = clock_gettime_nsec_np(CLOCK_UPTIME_RAW);
      |         ^~~~~~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/libprotobuf.dir/src/google/protobuf/api.pb.cc.o] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_protobuf3-cpp-upstream/protobuf3-cpp-upstream/work/build'
make[1]: *** [CMakeFiles/libprotobuf.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 25%] Building CXX object CMakeFiles/libprotobuf-lite.dir/src/google/protobuf/io/coded_stream.cc.o
/opt/local/bin/ccache /opt/local/bin/g++-mp-14 -DGOOGLE_PROTOBUF_CMAKE_BUILD -DHAVE_ZLIB -DLIBPROTOBUF_EXPORTS -DPROTOBUF_USE_DLLS -Dlibprotobuf_lite_EXPORTS -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_protobuf3-cpp-upstream/protobuf3-cpp-upstream/work/build -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_protobuf3-cpp-upstream/protobuf3-cpp-upstream/work/protobuf-28.0 -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_protobuf3-cpp-upstream/protobuf3-cpp-upstream/work/build/src -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_protobuf3-cpp-upstream/protobuf3-cpp-upstream/work/protobuf-28.0/src -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_protobuf3-cpp-upstream/protobuf3-cpp-upstream/work/protobuf-28.0/third_party/utf8_range -isystem /opt/local/include -pipe -DNDEBUG -isystem/opt/local/include/LegacySupport -I/opt/local/include -D_GLIBCXX_USE_CXX11_ABI=0 -O2 -g -DNDEBUG -arch ppc -mmacosx-version-min=10.6 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -MD -MT CMakeFiles/libprotobuf-lite.dir/src/google/protobuf/io/coded_stream.cc.o -MF CMakeFiles/libprotobuf-lite.dir/src/google/protobuf/io/coded_stream.cc.o.d -o CMakeFiles/libprotobuf-lite.dir/src/google/protobuf/io/coded_stream.cc.o -c /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_protobuf3-cpp-upstream/protobuf3-cpp-upstream/work/protobuf-28.0/src/google/protobuf/io/coded_stream.cc
In file included from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_protobuf3-cpp-upstream/protobuf3-cpp-upstream/work/protobuf-28.0/src/google/protobuf/generated_message_tctable_impl.h:22,
                 from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_protobuf3-cpp-upstream/protobuf3-cpp-upstream/work/protobuf-28.0/src/google/protobuf/generated_message_tctable_lite.cc:24:
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_protobuf3-cpp-upstream/protobuf3-cpp-upstream/work/protobuf-28.0/src/google/protobuf/map.h: In member function 'google::protobuf::internal::map_index_t google::protobuf::internal::UntypedMapBase::Seed() const':
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_protobuf3-cpp-upstream/protobuf3-cpp-upstream/work/protobuf-28.0/src/google/protobuf/map.h:712:9: error: 'clock_gettime_nsec_np' was not declared in this scope
  712 |     s = clock_gettime_nsec_np(CLOCK_UPTIME_RAW);
      |         ^~~~~~~~~~~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_protobuf3-cpp-upstream/protobuf3-cpp-upstream/work/protobuf-28.0/src/google/protobuf/generated_message_tctable_lite.cc: At global scope:
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_protobuf3-cpp-upstream/protobuf3-cpp-upstream/work/protobuf-28.0/src/google/protobuf/generated_message_tctable_lite.cc:806:36: warning: 'always_inline' function might not be inlinable unless also declared 'inline' [-Wattributes]
  806 | PROTOBUF_ALWAYS_INLINE const char* TcParser::FastVarintS1(
      |                                    ^~~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_protobuf3-cpp-upstream/protobuf3-cpp-upstream/work/protobuf-28.0/src/google/protobuf/generated_message_tctable_lite.cc:806:36: warning: 'always_inline' function might not be inlinable unless also declared 'inline' [-Wattributes]
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_protobuf3-cpp-upstream/protobuf3-cpp-upstream/work/protobuf-28.0/src/google/protobuf/generated_message_tctable_lite.cc:729:29: warning: 'always_inline' function might not be inlinable unless also declared 'inline' [-Wattributes]
  729 | PROTOBUF_ALWAYS_INLINE bool EnumIsValidAux(int32_t val, uint16_t xform_val,
      |                             ^~~~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_protobuf3-cpp-upstream/protobuf3-cpp-upstream/work/protobuf-28.0/src/google/protobuf/generated_message_tctable_lite.cc:717:29: warning: 'always_inline' function might not be inlinable unless also declared 'inline' [-Wattributes]
  717 | PROTOBUF_ALWAYS_INLINE void PrefetchEnumData(uint16_t xform_val,
      |                             ^~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/libprotobuf-lite.dir/src/google/protobuf/generated_message_tctable_lite.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....

@zhangskz
Copy link
Member

zhangskz commented Sep 9, 2024

Can you file this as a github issue with details on how to reproduce incl. what versions of protobuf / macOS you hit this with, so we can triage this accordingly?

@barracuda156
Copy link
Contributor

Can you file this as a github issue with details on how to reproduce incl. what versions of protobuf / macOS you hit this with, so we can triage this accordingly?

@zhangskz Done: #18180

@barracuda156
Copy link
Contributor

Can you file this as a github issue with details on how to reproduce incl. what versions of protobuf / macOS you hit this with, so we can triage this accordingly?

@zhangskz Done: #18180

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🅰️ safe for tests Mark a commit as safe to run presubmits over ios

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants