Skip to content

Commit

Permalink
CinderX "compiling" against 3.12
Browse files Browse the repository at this point in the history
Summary:
Attempt to get as much of CinderX compiling against 3.12 as possible by hiding the parts broken by API changes behind `#ifdef`s. The goals are to start unblocking parallel work on the codebase, and highlight areas which need upgrade work.

The focus of the work here is just to unblock compilation. Nothing should actually be upgraded, or refactored for upgrade by these changes.

The most interesting parts of this diff are:
* `Upgrade/upgrade_assert.h` - has an `UPGRADE_ASSERT()` macro which can be used in `#ifdef`s to stop execution when an unfixed area of code is entered. Also has a manually currated enum of "tags" which can be used with this macro to indicate broad category of upgrade work needed.

* `Upgrade/upgrade_stubs.[h, cpp]` - Stubbed implementation of APIs missing from 3.10.cinder when building against 3.12. Every function here compiles down to a "stub" which just assert when called.

* `Upgrade/upgrade_exports.h` - Similar to `upgrade_stubs.h` but the functions do actually exist in 3.12 but just aren't exported by `libpython3.12`.

Other notes:
* The orders of some `#include`s have been deliberately changed to avoid global name clashes with new macros.

Reviewed By: alexmalyshev

Differential Revision: D58312431

fbshipit-source-id: a0b1d5ca2ab399c9c3a944fbb0d088722ff4cea5
  • Loading branch information
jbower-fb authored and facebook-github-bot committed Jun 28, 2024
1 parent 46f7028 commit 28614d8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
2 changes: 0 additions & 2 deletions Include/cinder/hooks.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,6 @@ CiAPI_DATA(Ci_HookType_PyJIT_GetCurrentCodeFlags)
CiAPI_DATA(int64_t) __strobe_RuntimeFrameState_py_code;
CiAPI_DATA(int64_t) __strobe_CodeRuntime_py_code;

CiAPI_DATA(PyObject*) CiExc_StaticTypeError;

#ifdef __cplusplus
} // extern "C"
#endif
2 changes: 0 additions & 2 deletions Python/cinderhooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ Ci_HookType_PyJIT_GetBuiltins Ci_hook_PyJIT_GetBuiltins = NULL;
Ci_HookType_PyJIT_GetGlobals Ci_hook_PyJIT_GetGlobals = NULL;
Ci_HookType_PyJIT_GetCurrentCodeFlags Ci_hook_PyJIT_GetCurrentCodeFlags = NULL;

PyObject* CiExc_StaticTypeError = NULL;

// For backward compatibility, we need this in libpython rather than the
// CinderX module.
int _PyShadowFrame_WalkAndPopulate(
Expand Down

0 comments on commit 28614d8

Please sign in to comment.