AcademySoftwareFoundation / AcademySoftwareFoundation/rez

cmake module ExternalProject running with extra `make install` command

Open
#476 11 comments 0 reactions 0 assignees View on GitHub
bug cmake
Dominant language
Python
Stars
1.1k
Forks
369
Avg merge
12d 3h
Merged PRs (30d)
5

Description

From what I gather when using the cmake module `ExternalProject` the building and installation is taken care of without any outside input. When using `rez-build --install` we can utilize the `REZ_BUILD_INSTALL` variable to query for in the `CMakeLists` file to help create commands.

When executing `rez-build --install` it seems that rez wants to perform a `make install` as well causing a error output:

```bash
make[3]: *** No rule to make target `install'. Stop.
make[2]: *** [boost/src/boost-stamp/boost-install] Error 2
make[1]: *** [CMakeFiles/boost.dir/all] Error 2
make: *** [all] Error 2
10:15:06 ERROR BuildError: The cmake build system failed.
```

I guess it makes sense that we would want to have `make install` if we were performing something else outside of the ExteralProject but when we are just using that operation everything is already taken care of as I can comment out the code block performing the `make install` command from the `CMakeBuildSystem.build` function in cmake.py without causing any issues.

```python
if not retcode and install and "install" not in cmd:
cmd.append("install")

# execute make install within the build env
_pr("\nExecuting: %s" % ' '.join(cmd))
retcode, _, _ = context.execute_shell(command=cmd,
block=True,
cwd=build_path,
actions_callback=callback)
```

Should there be some way to specify that ExternalProject should handle the execution or have I missed something that already specifies that?

Contributor guide

Open the contributing guide

Research direction

Start in cmake.py at CMakeBuildSystem.build and inspect how the install argument, REZ_BUILD_INSTALL, and the ExternalProject module interact. Reproduce the failure with rez-build --install and review the issue discussion for the intended opt-in behavior. Done means ExternalProject builds and installs without an erroneous extra make install, while ordinary CMake projects retain their installation behavior.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.