Running cpt.py --current-dev=deb results in several failures:
In file included from /root/ci/build/cling-src/utils/benchmark/src/benchmark_register.cc:15:
/root/ci/build/cling-src/utils/benchmark/src/benchmark_register.h: In function 'void AddRange(std::vector<T>*, T, T, int)':
/root/ci/build/cling-src/utils/benchmark/src/benchmark_register.h:17:30: error: 'numeric_limits' is not a member of 'std'
17 | static const T kmax = std::numeric_limits<T>::max();
| ^~~~~~~~~~~~~~
/root/ci/build/cling-src/utils/benchmark/src/benchmark_register.h:17:46: error: expected primary-expression before '>' token
17 | static const T kmax = std::numeric_limits<T>::max();
| ^
/root/ci/build/cling-src/utils/benchmark/src/benchmark_register.h:17:49: error: '::max' has not been declared; did you mean 'std::max'?
17 | static const T kmax = std::numeric_limits<T>::max();
| ^~~
| std::max
In file included from /usr/include/c++/11/algorithm:62,
from /root/ci/build/cling-src/utils/benchmark/include/benchmark/benchmark.h:175,
from /root/ci/build/cling-src/utils/benchmark/src/internal_macros.h:4,
from /root/ci/build/cling-src/utils/benchmark/src/check.h:8,
from /root/ci/build/cling-src/utils/benchmark/src/benchmark_register.h:6,
from /root/ci/build/cling-src/utils/benchmark/src/benchmark_register.cc:15:
/usr/include/c++/11/bits/stl_algo.h:3467:5: note: 'std::max' declared here
3467 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
make[2]: *** [utils/benchmark/src/CMakeFiles/benchmark.dir/build.make:90: utils/benchmark/src/CMakeFiles/benchmark.dir/benchmark_register.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
Next failure is caused by llvm-lit trying to use python 2:
[100%] Running the Cling regression tests
llvm-lit: /root/ci/build/cling-src/utils/lit/lit/llvm/config.py:340: note: using clang: /root/ci/build/builddir/bin/clang
llvm-lit: /root/ci/build/cling-src/utils/lit/lit/llvm/subst.py:126: note: Did not find opt in /root/ci/build/builddir/bin
Traceback (most recent call last):
File "/root/ci/build/builddir/bin/llvm-lit", line 39, in <module>
main(builtin_parameters)
File "/root/ci/build/cling-src/utils/lit/lit/main.py", line 194, in main
main_with_tmp(builtinParameters)
File "/root/ci/build/cling-src/utils/lit/lit/main.py", line 515, in main_with_tmp
tc = lit.ProgressBar.TerminalController()
File "/root/ci/build/cling-src/utils/lit/lit/ProgressBar.py", line 110, in __init__
reload(sys)
NameError: name 'reload' is not defined
make[3]: *** [tools/cling/test/CMakeFiles/check-cling.dir/build.make:71: tools/cling/test/CMakeFiles/check-cling] Error 1
make[2]: *** [CMakeFiles/Makefile2:52195: tools/cling/test/CMakeFiles/check-cling.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:52202: tools/cling/test/CMakeFiles/check-cling.dir/rule] Error 2
make: *** [Makefile:12500: check-cling] Error 2
subprocess.CalledProcessError: Command 'make -j8 check-cling' returned non-zero exit status 2
This can be fixed as follows:
+++ ci/build/cling-src/utils/lit/lit/ProgressBar.py 2022-07-29 12:28:27.221805312 -0400
@@ -3,6 +3,7 @@
# Source: http://code.activestate.com/recipes/475116/, with
# modifications by Daniel Dunbar.
+from importlib import reload
import sys, re, time
def to_bytes(str):
@@ -108,7 +109,7 @@
# We want unicode output and have unicode input.
reload(sys)
- sys.setdefaultencoding('utf8')
+ #sys.setdefaultencoding('utf8')
# Look up numeric capabilities.
self.COLS = curses.tigetnum('cols')
Pardon my French, but are you effing kidding me? How could someone write such a thing? The resulting TAG values are:
TAG = 0.9
TAG = 0.8
TAG = 0.7000000000000001
TAG = 0.6000000000000001
TAG = 0.5000000000000001
TAG = 0.40000000000000013
TAG = 0.30000000000000016
TAG = 0.20000000000000015
TAG = 0.10000000000000014
TAG = 1.3877787807814457e-16
TAG = -0.09999999999999987
TAG = -0.19999999999999987
TAG = -0.2999999999999999
TAG = -0.3999999999999999
TAG = -0.4999999999999999
TAG = -0.5999999999999999
TAG = -0.6999999999999998
TAG = -0.7999999999999998
TAG = -0.8999999999999998
TAG = -0.9999999999999998
TAG = -1.0999999999999999
TAG = -1.2
TAG = -1.3
Which leads to an endless loop. Didn't we all learn in school that doing this kind of stuff with floats is extremely dangerous?
And just because we are having so much "fun":
┌──────────────────────────────────────────────────────────────────────────────┐
│ Set up the debian directory │
└──────────────────────────────────────────────────────────────────────────────┘
Create directory: debian
Create directory: /root/ci/build/cling-1.0~dev-0b684e3/debian/source
Create file: /root/ci/build/cling-1.0~dev-0b684e3/debian/source/format
Create file: /root/ci/build/cling-1.0~dev-0b684e3/debian/source/lintian-overrides
Create file: /root/ci/build/cling-1.0~dev-0b684e3/debian/cling.install
Create file: /root/ci/build/cling-1.0~dev-0b684e3/debian/compact
Create file: /root/ci/build/cling-1.0~dev-0b684e3/debian/compat
Create file: /root/ci/build/cling-1.0~dev-0b684e3/debian/control
Create file: /root/ci/build/cling-1.0~dev-0b684e3/debian/copyright
Create file: /root/ci/build/cling-1.0~dev-0b684e3/debian/rules
Create file: /root/ci/build/cling-1.0~dev-0b684e3/debian/changelog
Traceback (most recent call last):
File "/root/./cpt.py", line 2197, in <module>
debianize()
File "/root/./cpt.py", line 1129, in debianize
f.write(template.encode('utf-8'))
TypeError: write() argument must be str, not bytes
Running
cpt.py --current-dev=deb
results in several failures:This can be fixed by adding the missing header:
Next failure is caused by
llvm-lit
trying to use python 2:This can be fixed as follows:
Then there are multiple failing tests:
Full build.log of failing tests.
Not sure what to do here, other than skipping the tests with
--no-tests
.Next we get these two errors:
Did someone seriously think they could just use pipes in
subprocess.check_output
???Not done yet:
And then some more (subprocess shenanigans):
Fixed by:
And this is just icing on the cake:
https://github.com/root-project/cling/blob/0b684e39da807b2c7988535255d15ad55f6e35df/tools/packaging/cpt.py#L1134-L1136
Pardon my French, but are you effing kidding me? How could someone write such a thing? The resulting
TAG
values are:Which leads to an endless loop. Didn't we all learn in school that doing this kind of stuff with floats is extremely dangerous?
And just because we are having so much "fun":
Up until this line:
https://github.com/root-project/cling/blob/0b684e39da807b2c7988535255d15ad55f6e35df/tools/packaging/cpt.py#L1161
everything was written without utf-8 and then suddenly someone had this urge to covert to utf-8 here...
And in the end it still failed:
At this point I gave up. It's been a while since I've seen such a low quality of code.
Expected behavior
I expect .deb package to be produced.
To Reproduce
Execute
cpt.py --current-dev=deb
.Setup
Additional context