| Files | Last commit | Last update |
|---|---|---|
feat(build): Support RPM/DEB packaging in unified build scenarios. Co-authored-by: wangmingjun<wangmingjun13@huawei.com> # message auto-generated for no-merge-commit merge: !5277 merge feat/build-pkg-type-rpm-deb into master feat(build): Support RPM/DEB packaging in unified build scenarios. Created-by: hwwangmingjun Commit-by: wangmingjun Merged-by: cann-robot Description: feat(build): 支持统一构建场景下的 rpm/deb 打包 为支持 CANN 全量源码构建场景,新增 PACKAGE_TYPE CMake 选项与 --pkg-type 命令行参数,支持产出 run/rpm/deb/all 多种安装包格式。RPM/DEB 包通过自定义 postinst/prerm 钩子完成 PyPTO wheel 的安装与卸载,并统一安装包元数据文件权限。 主要改动: - CMakeLists.txt 新增 PACKAGE_TYPE 缓存变量,并透传至 set_cann_cpack_config - build_ci.py 新增 --pkg-type 参数(run/rpm/deb/all),并传递给 CMake - 新增 rpm_deb/custom_postinst.sh,在 RPM/DEB 安装时安装 PyPTO wheel - 新增 rpm_deb/custom_prerm.sh,在 RPM/DEB 卸载时卸载 PyPTO wheel - 修正 scripts/package/pypto/pypto.xml 中 install_mod 权限配置 Related Issues: #2573 See merge request: cann/pypto!5277 | 3 months ago | |
fix(build): Add set -e to run package scripts and flatten nested defaults Co-authored-by: chengding888<chengding1@hisilicon.com> # message auto-generated for no-merge-commit merge: !7313 merge fix/package-shell-warnings into master fix(build): Add set -e to run package scripts and flatten nested defaults Created-by: chengding888 Commit-by: chengding888 Merged-by: cann-robot Description: fix(build): Add set -e to run package scripts and flatten nested defaults Fix CodeCheck warnings reported for the PyPTO run package scripts: - Five scripts ( pypto_custom_uninstall.sh, run_pypto_uninstall.sh, run_pypto_install.sh, pypto_func.sh, pypto_custom_install.sh) missed set -e at the script head. - Variable definitions such as PKG_WHL_INSTALL_PATH="${PKG_WHL_INSTALL_PATH:-${PKG_INSTALL_PATH}/python/site-packages}" nested more than two levels; they are rewritten with explicit empty checks while keeping the original semantics. Since pypto_func.sh is sourced by install.sh / uninstall.sh, enabling set -e makes errexit propagate into the entry scripts. To keep the existing error-handling behavior unchanged, every command whose failure was previously ignored is guarded with || true, including: - best-effort chmod / chown / chattr / find calls and grep misses; - installed/package version.info lookups (is_multi_version_pkg, get_version), so that a missing or corrupted version.info no longer aborts install.sh / uninstall.sh silently before the /etc/ascend_install.info fallback logic; - log initialization, which falls back to /dev/null when the log directory is not writable, so installation/uninstallation keeps running as before; - the first-install path (version.info does not exist yet), the legacy /etc/ascend_install.info uninstall path, and the invalid local statement in _set_mode. Changes: - Add set -e to the five run package scripts - Flatten nested variable defaults in pypto_custom_uninstall.sh and run_pypto_uninstall.sh - Guard benign failures, version.info lookups and log initialization in pypto_func.sh, install.sh, uninstall.sh, run_pypto_uninstall.sh and pypto_custom_uninstall.sh - Reset ARCH_NAME to empty when scene.info lookup fails, to avoid capturing the error log into the variable Validation: - bash -n on all touched scripts and git diff --check passed - A/B comparison against the base commit (eb60d7b58) with real CANN common_func*.inc: 36 scenarios (help/version/check/first install/uninstall/custom scripts, invalid arguments, missing or corrupted version.info, unwritable log directory) behave identically; only the redundant stderr lines from failed log-file writes disappear - Unit checks for the set -e sensitive functions Related Issues: #3757 See merge request: cann/pypto!7313 | 27 days ago | |
feat(build): Support RPM/DEB packaging in unified build scenarios. Co-authored-by: wangmingjun<wangmingjun13@huawei.com> # message auto-generated for no-merge-commit merge: !5277 merge feat/build-pkg-type-rpm-deb into master feat(build): Support RPM/DEB packaging in unified build scenarios. Created-by: hwwangmingjun Commit-by: wangmingjun Merged-by: cann-robot Description: feat(build): 支持统一构建场景下的 rpm/deb 打包 为支持 CANN 全量源码构建场景,新增 PACKAGE_TYPE CMake 选项与 --pkg-type 命令行参数,支持产出 run/rpm/deb/all 多种安装包格式。RPM/DEB 包通过自定义 postinst/prerm 钩子完成 PyPTO wheel 的安装与卸载,并统一安装包元数据文件权限。 主要改动: - CMakeLists.txt 新增 PACKAGE_TYPE 缓存变量,并透传至 set_cann_cpack_config - build_ci.py 新增 --pkg-type 参数(run/rpm/deb/all),并传递给 CMake - 新增 rpm_deb/custom_postinst.sh,在 RPM/DEB 安装时安装 PyPTO wheel - 新增 rpm_deb/custom_prerm.sh,在 RPM/DEB 卸载时卸载 PyPTO wheel - 修正 scripts/package/pypto/pypto.xml 中 install_mod 权限配置 Related Issues: #2573 See merge request: cann/pypto!5277 | 3 months ago |