AcademySoftwareFoundation / AcademySoftwareFoundation/OpenShadingLanguage

Bitcode serialization fails with unset Python_EXECUTABLE variable

Open
#1,503 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
2.3k
Forks
414
Avg merge
3d 1h
Merged PRs (30d)
10

Description

### Problem

The custom command to serialize the bitcode for liboslexec fails if the `Python_EXECUTABLE` CMake variable is not set. This is due to a slight change in the invocation of the serialization script:

```diff
- COMMAND python "${CMAKE_SOURCE_DIR}/src/build-scripts/serialize-bc.py" ${llvm_bc} ${llvm_bc_cpp} ${prefix}
+ COMMAND ${Python_EXECUTABLE} "${CMAKE_SOURCE_DIR}/src/build-scripts/serialize-bc.py" ${llvm_bc} ${llvm_bc_cpp} ${prefix}
```

This can be worked around by setting `Python_EXECUTABLE` or setting `USE_PYTHON=ON` at configure time.

Perhaps for the sake of compatibility it would be better to either set a default value so that the build will work as before, or to issue a warning or error if the variable is not set?

### Versions

* OSL branch/version: main (033dae37)
* OS: Ubuntu 20.04
* C++ compiler: clang 12.0.0
* LLVM version: 12.0.0
* OIIO version: N/A

Contributor guide

Open the contributing guide

Research direction

Locate the custom command that invokes src/build-scripts/serialize-bc.py and inspect how Python_EXECUTABLE is set during configuration. Reproduce the bitcode serialization build with Python_EXECUTABLE unset, then make the behavior work or fail with a clear diagnostic and verify the affected build path.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, python
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.