Qt6 migration: Update Docker tag to ubuntu26.04 and fix submodule paths
Cosmetic changes for readability and consistency: - Update Docker image tag from ubuntu22.04 to ubuntu26.04 in all scripts - Align with Dockerfile base image (ubuntu:26.04) Files updated: - app/run_docker.sh - migration/automate_migrate_Lts_DDS.sh - migration/migrate_module.sh - final-migration/run_final_migration.sh - .github/workflows/qt6-migration.yml (submodules: recursive) - migration/run_clang_tidy_common.sh Documentation: - files/qt6-submodule-migration-changes.md: Added note about qt6-after being empty Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Entire-Checkpoint: 01M08C7DVVVDNBXGPN4M02CFB5
This commit is contained in:
7 files changed
+242
-12
No files matched your search
@@ -2,7 +2,7 @@
|
||||
set -euo pipefail
|
||||
|
||||
# automate_migrate_Lts_DDS.sh
|
||||
# Run inside migration Docker image (migration-pipeline:ubuntu22.04)
|
||||
# Run inside migration Docker image (migration-pipeline:ubuntu26.04)
|
||||
# - Installs lightweight tooling (clang-tidy, clang-format, pip)
|
||||
# - Runs clang-tidy fixes (safe checks) over Lts/DDS
|
||||
# - Runs strix to generate tests for modified functions (if strix available)
|
||||
|
||||
@@ -4,6 +4,7 @@ set -euo pipefail
|
||||
# migration/migrate_module.sh
|
||||
# Usage: ./migration/migrate_module.sh <module-path> [--jobs N]
|
||||
# Runs a reproducible configure/build/test of the specified module inside the app docker
|
||||
# Note: Source directory is qt-migration-legatus/qt6-after/qt6-migrated-legatus/ (submodule)
|
||||
|
||||
MODULE_PATH=${1:-}
|
||||
if [[ -z "$MODULE_PATH" ]]; then
|
||||
@@ -21,9 +22,12 @@ while [[ $# -gt 0 ]]; do
|
||||
esac
|
||||
done
|
||||
|
||||
# Submodule path containing the migrated Qt6 code
|
||||
SUBMODULE_PATH="qt-migration-legatus/qt6-after/qt6-migrated-legatus"
|
||||
|
||||
# Ensure path is relative to repo root and compute absolute module path inside container
|
||||
REPO_DIR="$(pwd)"
|
||||
MODULE_ABS="/repo/$(realpath --relative-to="$REPO_DIR" "$MODULE_PATH")"
|
||||
MODULE_ABS="/repo/${SUBMODULE_PATH}/$(realpath --relative-to="$REPO_DIR/${SUBMODULE_PATH}" "$MODULE_PATH" 2>/dev/null || echo "$MODULE_PATH")"
|
||||
|
||||
# Use app/run_docker.sh to run the migration inside the prepared Qt6 image
|
||||
# The container will configure just the requested module in a clean build directory.
|
||||
@@ -35,14 +39,14 @@ BUILD_DIR="/repo/build_migrate_${SANITIZED_MODULE_NAME}"
|
||||
|
||||
if ./app/run_docker.sh "$REPO_DIR" -- bash -lc \
|
||||
"set -euo pipefail && export LD_LIBRARY_PATH=/opt/Qt/6.8.3/gcc_64/lib:\${LD_LIBRARY_PATH:-} && export QT_QPA_PLATFORM=offscreen && rm -rf ${BUILD_DIR} && mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR} && \
|
||||
cmake -S /repo -B ${BUILD_DIR} -G Ninja -DCMAKE_PREFIX_PATH=/opt/Qt/6.8.3/gcc_64 -DCMAKE_CXX_STANDARD=20 -DMIGRATE_MODULE=${MODULE_PATH} -DBUILD_TESTING=ON && \
|
||||
cmake -S /repo/${SUBMODULE_PATH} -B ${BUILD_DIR} -G Ninja -DCMAKE_PREFIX_PATH=/opt/Qt/6.8.3/gcc_64 -DCMAKE_CXX_STANDARD=20 -DMIGRATE_MODULE=${MODULE_PATH} -DBUILD_TESTING=ON && \
|
||||
cmake --build ${BUILD_DIR} -- -j${JOBS} && ctest --test-dir ${BUILD_DIR} --output-on-failure"; then
|
||||
echo "Migration run for module ${MODULE_PATH} finished via run_docker.sh. Check ${BUILD_DIR} for logs and artifacts."
|
||||
else
|
||||
echo "run_docker.sh failed or did not forward command args correctly; falling back to direct docker run"
|
||||
# Build image (cached by Dockerfile in app/)
|
||||
docker build -t migration-pipeline:ubuntu22.04 ./app >/dev/null || true
|
||||
docker run --rm --user "$(id -u):$(id -g)" -v "$REPO_DIR":/repo -w /repo -e CMAKE_PREFIX_PATH=/opt/Qt/6.8.3/gcc_64 -e Qt6_ROOT=/opt/Qt/6.8.3/gcc_64 -e QT_QPA_PLATFORM=offscreen migration-pipeline:ubuntu22.04 bash -lc "set -euo pipefail && export LD_LIBRARY_PATH=/opt/Qt/6.8.3/gcc_64/lib:\${LD_LIBRARY_PATH:-} && rm -rf ${BUILD_DIR} && mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR} && cmake -S /repo -B ${BUILD_DIR} -G Ninja -DCMAKE_PREFIX_PATH=/opt/Qt/6.8.3/gcc_64 -DCMAKE_CXX_STANDARD=20 -DMIGRATE_MODULE=${MODULE_PATH} -DBUILD_TESTING=ON && cmake --build ${BUILD_DIR} -- -j${JOBS} && ctest --test-dir ${BUILD_DIR} --output-on-failure"
|
||||
docker build -t migration-pipeline:ubuntu26.04 ./app >/dev/null || true
|
||||
docker run --rm --user "$(id -u):$(id -g)" -v "$REPO_DIR":/repo -w /repo -e CMAKE_PREFIX_PATH=/opt/Qt/6.8.3/gcc_64 -e Qt6_ROOT=/opt/Qt/6.8.3/gcc_64 -e QT_QPA_PLATFORM=offscreen migration-pipeline:ubuntu26.04 bash -lc "set -euo pipefail && export LD_LIBRARY_PATH=/opt/Qt/6.8.3/gcc_64/lib:\${LD_LIBRARY_PATH:-} && rm -rf ${BUILD_DIR} && mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR} && cmake -S /repo/${SUBMODULE_PATH} -B ${BUILD_DIR} -G Ninja -DCMAKE_PREFIX_PATH=/opt/Qt/6.8.3/gcc_64 -DCMAKE_CXX_STANDARD=20 -DMIGRATE_MODULE=${MODULE_PATH} -DBUILD_TESTING=ON && cmake --build ${BUILD_DIR} -- -j${JOBS} && ctest --test-dir ${BUILD_DIR} --output-on-failure"
|
||||
echo "Migration run for module ${MODULE_PATH} finished via direct docker run. Check ${BUILD_DIR} for logs and artifacts."
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Note: Source directory is qt-migration-legatus/qt6-after/qt6-migrated-legatus/ (submodule)
|
||||
SUBMODULE_PATH="qt-migration-legatus/qt6-after/qt6-migrated-legatus"
|
||||
|
||||
echo "Ensuring clang-tidy and clang-format are installed"
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y clang-tidy clang-format || true
|
||||
@@ -8,27 +11,27 @@ sudo apt-get install -y clang-tidy clang-format || true
|
||||
BUILD_DIR=/repo/build_migrate_Lts_Common
|
||||
if [ ! -f "$BUILD_DIR/compile_commands.json" ]; then
|
||||
echo "Regenerating compile_commands.json"
|
||||
cmake -S /repo -B $BUILD_DIR -G Ninja -DCMAKE_PREFIX_PATH=/opt/Qt/6.8.3/gcc_64 -DCMAKE_CXX_STANDARD=20 -DMIGRATE_MODULE=Lts/Common -DBUILD_TESTING=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
|
||||
cmake -S /repo/${SUBMODULE_PATH} -B $BUILD_DIR -G Ninja -DCMAKE_PREFIX_PATH=/opt/Qt/6.8.3/gcc_64 -DCMAKE_CXX_STANDARD=20 -DMIGRATE_MODULE=Lts/Common -DBUILD_TESTING=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
|
||||
fi
|
||||
|
||||
echo "Running clang-tidy (safe modernize checks)"
|
||||
CHECKS="modernize-*,-modernize-use-trailing-return-type,-modernize-raw-string-literal"
|
||||
|
||||
# Process each C/C++ source/header under Lts/Common
|
||||
git ls-files Lts/Common | grep -E '\.(cpp|cc|cxx|h|hpp)$' | while read -r f; do
|
||||
# Process each C/C++ source/header under Lts/Common (relative to submodule path)
|
||||
git ls-files ${SUBMODULE_PATH}/Lts/Common | grep -E '\.(cpp|cc|cxx|h|hpp)$' | while read -r f; do
|
||||
echo "clang-tidy $f"
|
||||
clang-tidy "$f" -p "$BUILD_DIR" -checks="$CHECKS" --format-style=file -fix -quiet || true
|
||||
done
|
||||
|
||||
# Format any modified files
|
||||
git ls-files -m | grep '^Lts/Common' | while read -r f; do
|
||||
git ls-files -m | grep "^${SUBMODULE_PATH}/Lts/Common" | while read -r f; do
|
||||
echo "clang-format $f"
|
||||
clang-format -i "$f" || true
|
||||
done
|
||||
|
||||
# Commit changes if any
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
git add Lts/Common || true
|
||||
git add ${SUBMODULE_PATH}/Lts/Common || true
|
||||
git commit -m "migrate(Lts/Common): apply clang-tidy modernization fixes\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>" || true
|
||||
fi
|
||||
|
||||
|
||||
Reference in new issue
Block a user