google-deepmind / google-deepmind/mujoco_mpc

A faulty patch causes long rebuild times

Open
#355 0 comments 0 reactions 1 assignee Claimed by @thowell View on GitHub
Dominant language
C++
Stars
1.7k
Forks
282
PR merge metrics
No merged PRs in 30d

Description

There is a huge amount of commands listed here one add_custom_target

https://github.com/google-deepmind/mujoco_mpc/blob/9bd2037498056a0ab9cf9463ab841e40fef54142/mjpc/tasks/CMakeLists.txt#L18

Even if one of the command fails (it does), it must rerun all the rules in the generated rules file.
ChatGPT recommended me to do the commands separately:

```
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/humanoid/humanoid.xml"
COMMAND ${CMAKE_COMMAND} -E copy
"${dm_control_SOURCE_DIR}/dm_control/suite/humanoid.xml"
"${CMAKE_CURRENT_BINARY_DIR}/humanoid/humanoid.xml"
DEPENDS "${dm_control_SOURCE_DIR}/dm_control/suite/humanoid.xml"
COMMENT "Copying humanoid.xml for humanoid model"
)
```

then link the output xml as a dependency:

```
add_custom_target(copy_model_resources ALL
DEPENDS
"${CMAKE_CURRENT_BINARY_DIR}/humanoid/humanoid.xml"
...
)
```

The root cause of the issue is that patching of common_assets/reorientation_cube.xml fails due to a missing EOLN at column 26 here https://github.com/google-deepmind/mujoco_mpc/blob/9bd2037498056a0ab9cf9463ab841e40fef54142/mjpc/tasks/common_assets/cube.xml.patch#L1

The patch tool returns an error code and writes this in the output:
`missing header for unified diff at line 3 of patch`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.