fix: macro path to refer install#48
Conversation
- Updated the key from `parame_files` to `param_files` in the `parameter_set.yaml.jinja2` template to ensure accurate parameter file referencing. These changes enhance the clarity and correctness of the parameter configuration in the Autoware System Designer. Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
- Refactored the CMake configuration to utilize absolute paths for Python scripts in the Autoware System Designer, enhancing clarity and maintainability. - Introduced logic to dynamically determine script directories based on the installation prefix, improving flexibility for different build environments. - Updated resource directory handling to ensure correct paths are set during the build process. These changes contribute to a more organized and robust build configuration for the Autoware System Designer. Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
- Modified the CMakeLists.txt to write resource manifests directly to the install share directory instead of the build directory, improving the clarity of resource management. - Adjusted the autoware_system_designer_build_deploy.cmake to dynamically determine the resource directory based on the installation path, enhancing flexibility for different build environments. These changes contribute to a more organized and maintainable build configuration for the Autoware System Designer. Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
- Modified the CMakeLists.txt to collect system descriptions at install time, enhancing the clarity and correctness of resource management. - Replaced the previous custom target with an install command that executes the collection script, ensuring proper handling of installation paths. These changes contribute to a more organized and maintainable build configuration for the Autoware System Designer. Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
…ider - Reformatted the initialization of the SignatureHelpProvider in base_server.py for better clarity. - Updated conditional checks in definition_provider.py to use consistent double quotes, enhancing code style uniformity. - Improved readability by restructuring if statements for source_map checks, making the logic clearer. These changes contribute to a more maintainable and organized codebase in the Autoware System Designer. Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
There was a problem hiding this comment.
Pull request overview
This PR addresses autoware_system_designer issue #46 by removing hardcoded build/source-relative paths from the exported CMake macros and instead resolving scripts/resources via the installed package location, improving compatibility with staged Docker builds and pre-installed dependencies.
Changes:
- Install
script/into the package share tree and update exported CMake macros to use${autoware_system_designer_DIR}-relative installed paths. - Move system description manifest collection from build-time to install-time generation into
share/autoware_system_designer/resource. - Minor formatting cleanup in the VS Code language server and fix a YAML template key typo (
parame_files→param_files).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/vscode-autoware-system-designer/server/providers/definition_provider.py | Formatting changes around source_map access. |
| tools/vscode-autoware-system-designer/server/base_server.py | Formatting change (line wrapping) for provider initialization. |
| autoware_system_designer/CMakeLists.txt | Install scripts to share; generate resource manifests at install time. |
| autoware_system_designer/cmake/autoware_system_designer_parameter.cmake | Resolve runner and parameter scripts from installed package path. |
| autoware_system_designer/cmake/autoware_system_designer_generate_launcher.cmake | Resolve runner and launcher generator from installed package path. |
| autoware_system_designer/cmake/autoware_system_designer_build_deploy.cmake | Resolve deploy scripts/resources from installed package; adjust PYTHONPATH behavior. |
| autoware_system_designer/autoware_system_designer/template/parameter_set.yaml.jinja2 | Fix template key to param_files. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Updated CMakeLists.txt to use a dynamic destination prefix for resource paths, improving flexibility during installation. - Modified autoware_system_designer_build_deploy.cmake to calculate the last element of the Python paths list, enhancing clarity in path management. These changes contribute to a more organized and maintainable build configuration for the Autoware System Designer. Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
- Updated the autoware_system_designer_build_deploy.cmake to include both dist-packages and site-packages directories for Python installations, improving compatibility across different environments. - Introduced a new environment variable for PYTHONPATH to streamline the execution of Python scripts during the build process. Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Removed hardcoded references to `python3` in CMake files and replaced them with a variable for the Python executable, enhancing flexibility and compatibility across different environments. - Added checks to ensure the Python3 interpreter is found, improving robustness in script execution during the build process. Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
- Ensured the Python3 interpreter is always found by calling find_package unconditionally, improving reliability. - Updated the logic for determining the installed Python package directory to use the interpreter version, enhancing compatibility across environments. - Simplified the setting of the PYTHONPATH environment variable for script execution, improving clarity and maintainability. Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| COMMAND_ERROR_IS_FATAL ANY | ||
| ) |
There was a problem hiding this comment.
execute_process(COMMAND_ERROR_IS_FATAL ANY) requires a newer CMake than the current cmake_minimum_required(VERSION 3.14). With CMake 3.14 this will error at configure/install time. Either bump the minimum required CMake version to one that supports COMMAND_ERROR_IS_FATAL or replace it with explicit RESULT_VARIABLE checking and a message(FATAL_ERROR ...) on non-zero exit.
| COMMAND_ERROR_IS_FATAL ANY | |
| ) | |
| RESULT_VARIABLE _collect_system_design_manifests_result | |
| ) | |
| if(NOT _collect_system_design_manifests_result EQUAL 0) | |
| message(FATAL_ERROR | |
| \"collect_system_design_manifests.py failed with exit code \${_collect_system_design_manifests_result}\" | |
| ) | |
| endif() |
| # Collect system descriptions at install time. | ||
| # ${CMAKE_CURRENT_SOURCE_DIR} and ${Python3_EXECUTABLE} are expanded at configure time; | ||
| install(CODE " | ||
| set(_dest_prefix \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}\") | ||
| execute_process( | ||
| COMMAND \"${CMAKE_COMMAND}\" -E remove_directory | ||
| \"\${_dest_prefix}/share/${PROJECT_NAME}/resource\" | ||
| ) | ||
| execute_process( | ||
| COMMAND \"${Python3_EXECUTABLE}\" | ||
| \"${CMAKE_CURRENT_SOURCE_DIR}/script/collect_system_design_manifests.py\" | ||
| \"${CMAKE_CURRENT_SOURCE_DIR}\" | ||
| \"\${_dest_prefix}/share/${PROJECT_NAME}/resource\" | ||
| \"\${CMAKE_INSTALL_PREFIX}\" | ||
| COMMAND_ERROR_IS_FATAL ANY | ||
| ) | ||
| ") | ||
|
|
There was a problem hiding this comment.
The install-time manifest generation writes YAML manifests into the installed share/${PROJECT_NAME}/resource, but collect_system_design_manifests.py records absolute source file paths for deploy_config_files (see script: it stores yf_abs). If this package is consumed pre-installed (deb/apt), those paths will point at the packaging/build machine’s source tree and won’t exist for users, breaking deployment generation. Consider generating manifests at consumer build time (so paths match the consumer workspace), or change the manifest format to store install-space paths/relative paths and resolve via package_map.
| # Collect system descriptions at install time. | |
| # ${CMAKE_CURRENT_SOURCE_DIR} and ${Python3_EXECUTABLE} are expanded at configure time; | |
| install(CODE " | |
| set(_dest_prefix \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}\") | |
| execute_process( | |
| COMMAND \"${CMAKE_COMMAND}\" -E remove_directory | |
| \"\${_dest_prefix}/share/${PROJECT_NAME}/resource\" | |
| ) | |
| execute_process( | |
| COMMAND \"${Python3_EXECUTABLE}\" | |
| \"${CMAKE_CURRENT_SOURCE_DIR}/script/collect_system_design_manifests.py\" | |
| \"${CMAKE_CURRENT_SOURCE_DIR}\" | |
| \"\${_dest_prefix}/share/${PROJECT_NAME}/resource\" | |
| \"\${CMAKE_INSTALL_PREFIX}\" | |
| COMMAND_ERROR_IS_FATAL ANY | |
| ) | |
| ") | |
| # Collect system descriptions at build time so the generated manifests match | |
| # the workspace that is building this package, then install the generated files. | |
| set(_generated_resource_dir "${CMAKE_CURRENT_BINARY_DIR}/resource") | |
| add_custom_target(generate_system_design_manifests ALL | |
| COMMAND "${CMAKE_COMMAND}" -E remove_directory | |
| "${_generated_resource_dir}" | |
| COMMAND "${Python3_EXECUTABLE}" | |
| "${CMAKE_CURRENT_SOURCE_DIR}/script/collect_system_design_manifests.py" | |
| "${CMAKE_CURRENT_SOURCE_DIR}" | |
| "${_generated_resource_dir}" | |
| "${CMAKE_INSTALL_PREFIX}" | |
| BYPRODUCTS "${_generated_resource_dir}" | |
| COMMENT "Generating system design manifests" | |
| VERBATIM | |
| ) | |
| install( | |
| DIRECTORY "${_generated_resource_dir}/" | |
| DESTINATION share/${PROJECT_NAME}/resource | |
| ) |
| COMMAND ${CMAKE_COMMAND} -E env | ||
| PYTHONPATH=${SYSTEM_DESIGNER_SOURCE_DIR}:$ENV{PYTHONPATH} | ||
| ${_AWSD_PYTHONPATH_ARGS} | ||
| AUTOWARE_SYSTEM_DESIGNER_BUILD_DEPLOY_STRICT=${AUTOWARE_SYSTEM_DESIGNER_BUILD_DEPLOY_STRICT} | ||
| python3 ${SYSTEM_DESIGNER_RUNNER_SCRIPT} | ||
| ${Python3_EXECUTABLE} ${SYSTEM_DESIGNER_RUNNER_SCRIPT} |
There was a problem hiding this comment.
The macro currently sets PYTHONPATH to the autoware_system_designer install site-packages directory, but it no longer appends the existing $ENV{PYTHONPATH}. This can break environments that rely on additional PYTHONPATH entries (e.g., overlays/venvs). Consider setting PYTHONPATH=${_AWSD_PYTHON_PATH}:$ENV{PYTHONPATH} (when _AWSD_PYTHON_PATH is found) so the existing environment is preserved.
Issue: #46
After this fix, the autoware_launch can be turn back autowarefoundation/autoware_launch#1814