Include "code.h" and Python 3.11

I found a problem while compiling to the lastest-stable version (v6.26.10).

[.....]/bindings/pyroot/cppyy/CPyCppyy/src/CPPOverload.cxx:5:10: fatal error: ‘code.h’ file not found

#include “code.h” // from Python

^~~~~~~~

In order to solve the problem, thereby compiling root, I have simply copy-pasted the lines of code present in the this git-hub commit and replaced the following lines of code present in the file /bindings/pyroot/cppyy/CPyCppyy/src/CPPOverload.cxx:

#if PY_VERSION_HEX >= 0x02050000
#include "code.h"            // from Python
#else
#include "compile.h"         // from Python
#endif

with the following lines:

#if PY_VERSION_HEX < 0x02050000
#include "compile.h"         // from Python
#elif PY_VERSION_HEX < 0x030b0000
#include "code.h"            // from Python
#endif

With this change root correctly compiles.
Am I doing something wrong?
I have compiled for macosxarm64 from heads/latest-stable@v6-26-10-324-g4dddea35ac

   ------------------------------------------------------------------
  | Welcome to ROOT 6.26/10                        https://root.cern |
  | (c) 1995-2021, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for macosxarm64 on Nov 17 2022, 15:37:00                   |
  | From heads/latest-stable@v6-26-10-324-g4dddea35ac                |
  | With Apple clang version 14.0.0 (clang-1400.0.29.202)            |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q'       |
   ------------------------------------------------------------------

ROOT Version: v6.26/10
Platform: macosxarm64 (M1 Max)


1 Like

Dear @bellenot, thank you for pointing this out. I just double checked and I do not see the above change in the latest-stable branch? It also seems that this patch did not propagate to the source code tar/zip archives published on the website and not present on the GitHub releases page too.

Majority of the users will most likely download source from the ROOT website or GitHub releases page and will still run into this issue.

Maybe it is a good idea to somehow automate re-deployment of the source archives when critical bugfixes are merged to one of the *-patches branches? Looking forward to hearing from you!

Hi, the changes are in the v6-26-00-patches branch and will be included in v6.26/12 and v6.28/00

It’s not the first time when a serious flaw has been found in a “release” and then left unfixed in the “latest-stable” branch for months (and also in the published source code tar/zip archives).

BTW. For example, one of the previous ones I remember was related to the xrootd hash.