From b5256a7c4b526685b9eae0744e5c2301e35651eb Mon Sep 17 00:00:00 2001 From: Sachin Hulyalkar Date: Tue, 5 Aug 2025 09:28:18 +0200 Subject: [PATCH 1/9] Add logic in the build action --- .github/workflows/build-targets.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/build-targets.yaml b/.github/workflows/build-targets.yaml index 94d3473c..073e8822 100644 --- a/.github/workflows/build-targets.yaml +++ b/.github/workflows/build-targets.yaml @@ -22,3 +22,18 @@ jobs: - name: Start Build Workflow run: | echo "Starting Build Workflow for target: ${{ matrix.build-targets }}" + + - name: Set up build environment + run: | + echo "Installing required dependencies" + sudo apt-get update + sudo apt-get install -y quilt + + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: List directory after checkout + run: | + ls From 761bc2c585ddd3fbd97c839b8404283ed961b9b9 Mon Sep 17 00:00:00 2001 From: Sachin Hulyalkar Date: Tue, 5 Aug 2025 09:29:49 +0200 Subject: [PATCH 2/9] Add command to check quilt version --- .github/workflows/build-targets.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build-targets.yaml b/.github/workflows/build-targets.yaml index 073e8822..2d2ba601 100644 --- a/.github/workflows/build-targets.yaml +++ b/.github/workflows/build-targets.yaml @@ -37,3 +37,8 @@ jobs: - name: List directory after checkout run: | ls + + - name: Run quilt help + run: | + which quilt + quilt --version From e340360faaffb5e80f6ce2e06f464f07c336e333 Mon Sep 17 00:00:00 2001 From: Sachin Hulyalkar Date: Tue, 5 Aug 2025 09:34:42 +0200 Subject: [PATCH 3/9] Run script to patch source --- scripts/prepare-src.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/prepare-src.sh diff --git a/scripts/prepare-src.sh b/scripts/prepare-src.sh old mode 100644 new mode 100755 From ab6d176cb97e42ea9f1f7be9b7c3312da73a6d3c Mon Sep 17 00:00:00 2001 From: Sachin Hulyalkar Date: Tue, 5 Aug 2025 09:43:32 +0200 Subject: [PATCH 4/9] Add command to zip source --- .github/workflows/build-targets.yaml | 6 +++++- scripts/prepare-src.sh | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-targets.yaml b/.github/workflows/build-targets.yaml index 2d2ba601..8549a5b7 100644 --- a/.github/workflows/build-targets.yaml +++ b/.github/workflows/build-targets.yaml @@ -41,4 +41,8 @@ jobs: - name: Run quilt help run: | which quilt - quilt --version + quilt --help + + - name: Run patches script + run: | + ./scripts/prepare-src.sh diff --git a/scripts/prepare-src.sh b/scripts/prepare-src.sh index 9c76010b..94351e09 100755 --- a/scripts/prepare-src.sh +++ b/scripts/prepare-src.sh @@ -10,9 +10,11 @@ apply_changes() { code_editor_module_path="$(dirname "$(dirname "${BASH_SOURCE[0]}")")" patch_dir="${code_editor_module_path}/patches" + echo "Code Editor module path: $code_editor_module_path" + echo "Patch directory: $patch_dir" export QUILT_PATCHES="${patch_dir}" - export QUILT_SERIES="web-server.series" + export QUILT_SERIES="sagemaker.series" # Clean out the build directory echo "Cleaning build src dir" @@ -29,6 +31,8 @@ apply_changes() { echo "Applying overrides" rsync -a "${code_editor_module_path}/overrides/" "${patched_src_dir}" + echo "Zipping patched source" + tar -chzvf "patched_source.tar.gz" $patched_src_dir } custom_path="" From 84826ea0cd7fa02ff44c73f206a1fbd5d8f86b3e Mon Sep 17 00:00:00 2001 From: Sachin Hulyalkar Date: Tue, 5 Aug 2025 09:45:39 +0200 Subject: [PATCH 5/9] Replace quilt command to version --- .github/workflows/build-targets.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-targets.yaml b/.github/workflows/build-targets.yaml index 8549a5b7..4b0adb23 100644 --- a/.github/workflows/build-targets.yaml +++ b/.github/workflows/build-targets.yaml @@ -41,7 +41,7 @@ jobs: - name: Run quilt help run: | which quilt - quilt --help + quilt --version - name: Run patches script run: | From 130a143ca300657306dbd6f70ea53a31d58aee43 Mon Sep 17 00:00:00 2001 From: Sachin Hulyalkar Date: Tue, 5 Aug 2025 09:51:27 +0200 Subject: [PATCH 6/9] Fix prepare-src script --- scripts/prepare-src.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/prepare-src.sh b/scripts/prepare-src.sh index 94351e09..3ecb51e8 100755 --- a/scripts/prepare-src.sh +++ b/scripts/prepare-src.sh @@ -8,10 +8,10 @@ apply_changes() { local patched_src_dir="${1:-$(pwd)/vscode}" echo "Creating patched source in directory: ${patched_src_dir}" - code_editor_module_path="$(dirname "$(dirname "${BASH_SOURCE[0]}")")" - patch_dir="${code_editor_module_path}/patches" - echo "Code Editor module path: $code_editor_module_path" - echo "Patch directory: $patch_dir" + # code_editor_module_path="$(dirname "$(dirname "${BASH_SOURCE[0]}")")" + # patch_dir="${code_editor_module_path}/patches" + # echo "Code Editor module path: $code_editor_module_path" + # echo "Patch directory: $patch_dir" export QUILT_PATCHES="${patch_dir}" export QUILT_SERIES="sagemaker.series" @@ -21,7 +21,7 @@ apply_changes() { rm -rf "${patched_src_dir}" # Copy third party source - rsync -a "${code_editor_module_path}/third-party-src/" "${patched_src_dir}" + rsync -a "third-party-src/" "${patched_src_dir}" echo "Applying base patches" pushd "${patched_src_dir}" @@ -29,7 +29,7 @@ apply_changes() { popd echo "Applying overrides" - rsync -a "${code_editor_module_path}/overrides/" "${patched_src_dir}" + rsync -a "overrides/" "${patched_src_dir}" echo "Zipping patched source" tar -chzvf "patched_source.tar.gz" $patched_src_dir From de4840d7e246832fa52e72b94fe5e7c370bb2445 Mon Sep 17 00:00:00 2001 From: Sachin Hulyalkar Date: Tue, 5 Aug 2025 09:54:21 +0200 Subject: [PATCH 7/9] Fix patch-dir variable --- scripts/prepare-src.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/prepare-src.sh b/scripts/prepare-src.sh index 3ecb51e8..ca2c494e 100755 --- a/scripts/prepare-src.sh +++ b/scripts/prepare-src.sh @@ -9,9 +9,9 @@ apply_changes() { echo "Creating patched source in directory: ${patched_src_dir}" # code_editor_module_path="$(dirname "$(dirname "${BASH_SOURCE[0]}")")" - # patch_dir="${code_editor_module_path}/patches" + patch_dir="patches" # echo "Code Editor module path: $code_editor_module_path" - # echo "Patch directory: $patch_dir" + echo "Patch directory: $patch_dir" export QUILT_PATCHES="${patch_dir}" export QUILT_SERIES="sagemaker.series" From 1269609ce155d524a2eacfb0fcb37f9d9af15e6c Mon Sep 17 00:00:00 2001 From: Sachin Hulyalkar Date: Tue, 5 Aug 2025 15:25:53 +0200 Subject: [PATCH 8/9] Fix script to apply patches and over-rides --- scripts/prepare-src.sh | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/scripts/prepare-src.sh b/scripts/prepare-src.sh index ca2c494e..8a50f27d 100755 --- a/scripts/prepare-src.sh +++ b/scripts/prepare-src.sh @@ -3,25 +3,23 @@ set -euo pipefail apply_changes() { - - # Use custom path if provided, otherwise default to ./vscode - local patched_src_dir="${1:-$(pwd)/vscode}" + local present_working_dir="$(pwd)" + local patched_src_dir="$present_working_dir/code-editor-src" echo "Creating patched source in directory: ${patched_src_dir}" - # code_editor_module_path="$(dirname "$(dirname "${BASH_SOURCE[0]}")")" - patch_dir="patches" - # echo "Code Editor module path: $code_editor_module_path" - echo "Patch directory: $patch_dir" + patch_dir="${present_working_dir}/patches" + echo "Set patch directory as: $patch_dir" export QUILT_PATCHES="${patch_dir}" - export QUILT_SERIES="sagemaker.series" + export QUILT_SERIES="${present_working_dir}/patches/sagemaker.series" # Clean out the build directory echo "Cleaning build src dir" rm -rf "${patched_src_dir}" # Copy third party source - rsync -a "third-party-src/" "${patched_src_dir}" + echo "Copying third party source to the patch directory" + rsync -a "${present_working_dir}/third-party-src/" "${patched_src_dir}" echo "Applying base patches" pushd "${patched_src_dir}" @@ -29,23 +27,12 @@ apply_changes() { popd echo "Applying overrides" - rsync -a "overrides/" "${patched_src_dir}" - - echo "Zipping patched source" - tar -chzvf "patched_source.tar.gz" $patched_src_dir + rsync -a "${present_working_dir}/overrides/" "${patched_src_dir}" } custom_path="" while [[ $# -gt 0 ]]; do case $1 in - --path) - if [[ -z "${2:-}" ]]; then - echo "Error: --path requires a value" - exit 1 - fi - custom_path="$2" - shift 2 - ;; -h|--help) echo "Usage: $0 [--path ]" echo " --path: Custom build directory (default: ./vscode)" @@ -58,4 +45,4 @@ while [[ $# -gt 0 ]]; do ;; esac done -apply_changes "${custom_path}" \ No newline at end of file +apply_changes "${custom_path}" From 135c7dba232631b05d99b8fca22ef1b8270f45b3 Mon Sep 17 00:00:00 2001 From: Sachin Hulyalkar Date: Wed, 6 Aug 2025 09:21:30 +0200 Subject: [PATCH 9/9] Fix the prepare src script --- .github/workflows/build-targets.yaml | 9 --------- scripts/prepare-src.sh | 17 +---------------- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/.github/workflows/build-targets.yaml b/.github/workflows/build-targets.yaml index 4b0adb23..1f95854e 100644 --- a/.github/workflows/build-targets.yaml +++ b/.github/workflows/build-targets.yaml @@ -33,15 +33,6 @@ jobs: uses: actions/checkout@v4 with: submodules: recursive - - - name: List directory after checkout - run: | - ls - - - name: Run quilt help - run: | - which quilt - quilt --version - name: Run patches script run: | diff --git a/scripts/prepare-src.sh b/scripts/prepare-src.sh index 8a50f27d..4f039ffa 100755 --- a/scripts/prepare-src.sh +++ b/scripts/prepare-src.sh @@ -30,19 +30,4 @@ apply_changes() { rsync -a "${present_working_dir}/overrides/" "${patched_src_dir}" } -custom_path="" -while [[ $# -gt 0 ]]; do - case $1 in - -h|--help) - echo "Usage: $0 [--path ]" - echo " --path: Custom build directory (default: ./vscode)" - exit 0 - ;; - *) - echo "Invalid parameter - '$1'" - echo "Use --help for usage information" - exit 1 - ;; - esac -done -apply_changes "${custom_path}" +apply_changes