2
0
Icarus Sparry (work) d9c58d6986 Setup - Fix status return (#444)
The code is full of ERROR_CHECK(os.system("some shell commands")).

Unfortunately the return value from os.system is a 16 bit value with the return code in the upper 8 bits and a number of flags related to the traps in the lower 8 bits. The existing code passes this 16 bit value to the os.exit call, which just uses the bottom 8 bits. Unless the child process is killed by a signal these 8 bits will be zero, which is taken as "success", rather than passing on the exit status of the child process.

So even something as simple as 
    ERROR_CHECK(os.system("false"))
will report a status of 256 in the print statement but will call sys.exit() with a value of 0 in the lower 8 bits.

This change folds the top and bottom halves of the 16 bit value into an 8 bit value. This will be non-zero, so a shell script running rocDecode-setup.py will know something has failed an ERROR_CHECK, rather than the current situation where it thinks things are correct.

[ROCm/rocdecode commit: 40dd67b19a]
2024-11-05 14:10:06 -08:00
S
Descrição
Descrição não fornecida
282 MiB
Linguagens
C++ 67.5%
C 20.6%
Python 6.6%
CMake 3.4%
Shell 0.6%
Outros 1.1%