AcademySoftwareFoundation / AcademySoftwareFoundation/rez
include could not find load file: RezBuild error on Windows
- Dominant language
- Python
- Stars
- 1.1k
- Forks
- 374
- Avg merge
- 9d 12h
- Merged PRs (30d)
- 5
Description
We're currently using an old version of rez (2.49.0) and would like to update to 2.68.4. Everything wees to be fine with the new version on Linux, but we can't build with Cmake anymore on Windows.
The first error is:
```cmd
CMake Error at CMakeLists.txt:7 (include):
include could not find load file:
RezBuild
```
and other error follows indicating the Rez environment variables for Cmake are not set.
It appears the reasons for this error are:
- our **cmake** package has **visualstudio** in its `build_requires`
- our **visualstudio** contains the following code:
```python
if building:
cmd = 'call "{executable}" x64'
cmd = cmd.format(executable=os.path.join(expandvars("{root}"), "bin", "msvcEnv.bat"))
command(cmd)
```
- rez now sets the build environment in `post_actions_callback` instead of `actions_callback` and it's too late
Would it be reasonable to use again `actions_callback` at [this line](https://github.com/nerdvegas/rez/blob/b21516589933afeed1e1a1a439962d2e20151e2d/src/rezplugins/build_system/cmake.py#L166) when building?
Or do yo know any other way to run cmake via rez on Windows?
I tried to use `vswhere` as mentionned [here](https://github.com/nerdvegas/rez/issues/703) but it doesn't return any installPath.
[Pull Request](https://github.com/nerdvegas/rez/pull/975)
Contributor guide
Research direction
Start in src/rezplugins/build_system/cmake.py around line 166 and compare the actions_callback and post_actions_callback paths. Reproduce the Windows CMake build described in the issue, checking when RezBuild and the Rez environment variables become available. Done means the CMake build can find RezBuild and receives the required environment on Windows.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, python
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100