From 03b94affe6e2e75e4b9a7144d06245dd3559f105 Mon Sep 17 00:00:00 2001 From: Devajith Valaparambil Sreeramaswamy Date: Wed, 29 Oct 2025 10:51:06 +0100 Subject: [PATCH 1/3] [ci][cling] Remove TextInput from cling sync workflow --- .github/workflows/sync_cling.yml | 1 - .github/workflows/utilities/sync_cling.py | 24 ++++++++--------------- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/.github/workflows/sync_cling.yml b/.github/workflows/sync_cling.yml index e28a0664f7ebc..79729de480e8a 100644 --- a/.github/workflows/sync_cling.yml +++ b/.github/workflows/sync_cling.yml @@ -6,7 +6,6 @@ on: - 'master' paths: - 'interpreter/cling/**' - - 'core/textinput/src/textinput/**' workflow_dispatch: jobs: diff --git a/.github/workflows/utilities/sync_cling.py b/.github/workflows/utilities/sync_cling.py index cf45dbafe6910..20a6e6b0fe951 100755 --- a/.github/workflows/utilities/sync_cling.py +++ b/.github/workflows/utilities/sync_cling.py @@ -16,8 +16,6 @@ ROOT_REPO_DIR_NAME = 'root' INTERP_DIR_NAME = 'interpreter/cling' DEST_INTERP_DIR_NAME = '' -TEXTINPUT_DIR_NAME = 'core/textinput/src/textinput' -DEST_TEXTINPUT_DIR_NAME='lib/UserInterface/textinput' def printError(msg): print(f'*** Error: {msg}') @@ -87,26 +85,21 @@ def getHashes(repoDirName, startingHash, dirInRepoName=''): hashes = [line.split(' ', 1)[0] for line in out.split('\n')] return hashes -def createPatches(rootHashes, interpHashes, textinputHashes): +def createPatches(rootHashes, interpHashes): patches = [] # We'll need a few sets to quickly check what to do with ROOT hashes interpHashesSet = set(interpHashes) - textInputHashesSet = set(textinputHashes) - allHashesSet = interpHashesSet | textInputHashesSet # We filter the ROOT hashes that we do not want to sync - rootHashesToSync = list(filter(lambda hash: hash in allHashesSet, rootHashes)) + rootHashesToSync = list(filter(lambda hash: hash in interpHashesSet, rootHashes)) # We loop on ROOT hashes to sync, from oldest to newest - # to return a list of triples [label, hash, patchAsSting], where label allows us - # to disinguish between textinput and interpreter patches and hash is there - # for debugging purposes. - # One commit can be visible in both directories, ergo 2 patches per hash are possible. + # to return a list of triples [dirInRepo, hash, patchAsSting], where dirInRepo is the + # directory and hash is there for debugging purposes. for rootHashtoSync in reversed(rootHashesToSync): keys = [] if rootHashtoSync in interpHashesSet: keys.append(INTERP_DIR_NAME) - if rootHashtoSync in textInputHashesSet: keys.append(TEXTINPUT_DIR_NAME) for key in keys: patchAsStr = execCommand(f"git format-patch -1 {rootHashtoSync} {key} --stdout", ROOT_REPO_DIR_NAME) patches.append([key, rootHashtoSync, patchAsStr]) @@ -115,7 +108,7 @@ def createPatches(rootHashes, interpHashes, textinputHashes): def applyPatches(patches): for dirInRepo, hash, patchAsStr in patches: ignorePathLevel = dirInRepo.count('/') + 2 - destDirName = DEST_INTERP_DIR_NAME if dirInRepo == INTERP_DIR_NAME else DEST_TEXTINPUT_DIR_NAME + destDirName = DEST_INTERP_DIR_NAME directoryOption = f'--directory {destDirName}' if destDirName else '' printInfo(f'Applying {hash} restricted to {dirInRepo} to repository {CLING_REPO_DIR_NAME}') execCommand(f'git am -p {ignorePathLevel} {directoryOption}', CLING_REPO_DIR_NAME, patchAsStr) @@ -158,18 +151,17 @@ def principal(): # to commits in the directories we are interested in for the sync rootHashes = getHashes(ROOT_REPO_DIR_NAME, startingRootHash) interpHashes = getHashes(ROOT_REPO_DIR_NAME, startingRootHash, INTERP_DIR_NAME) - textinputHashes = getHashes(ROOT_REPO_DIR_NAME, startingRootHash, TEXTINPUT_DIR_NAME) # If we have no commits to sync, we quit. - if not interpHashes and not textinputHashes: + if not interpHashes: # nothing to do, we have no commits to sync printInfo('No commit to sync. Exiting now.') return 0 - printInfo(f'We found:\n - {len(interpHashes)} patches from the directory {INTERP_DIR_NAME}\n - {len(textinputHashes)} patches from the directory {TEXTINPUT_DIR_NAME}') + printInfo(f'We found:\n - {len(interpHashes)} patches from the directory {INTERP_DIR_NAME}') # We now create the patches we want to apply to the cling repo - patches = createPatches(rootHashes, interpHashes, textinputHashes) + patches = createPatches(rootHashes, interpHashes) # We now apply the patches if not patches: From 10f9c11c517e23c6532df3d116b08b5a42db9431 Mon Sep 17 00:00:00 2001 From: Devajith Valaparambil Sreeramaswamy Date: Mon, 3 Nov 2025 10:12:11 +0100 Subject: [PATCH 2/3] Testing sync workflow --- .github/workflows/sync_cling.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/sync_cling.yml b/.github/workflows/sync_cling.yml index 79729de480e8a..133ad32772bd2 100644 --- a/.github/workflows/sync_cling.yml +++ b/.github/workflows/sync_cling.yml @@ -1,16 +1,12 @@ name: Sync Cling repo on: - push: - branches: - - 'master' + pull_request: paths: - 'interpreter/cling/**' - workflow_dispatch: - jobs: sync-cling-history: - if: github.repository_owner == 'root-project' + if: github.repository_owner == 'devajithvs' runs-on: ubuntu-latest steps: - name: Checkout ROOT @@ -22,8 +18,8 @@ jobs: - name: Checkout Cling uses: actions/checkout@v4 with: - repository: root-project/cling - token: ${{ secrets.CLING_GIT_TOKEN }} + repository: devajithvs/cling + token: ${{ secrets.CLING_GIT_TOKEN_TESTING }} path: cling fetch-depth: 32768 From 76e0c1727ee89e477af67f725e385e9ca955621c Mon Sep 17 00:00:00 2001 From: Devajith Valaparambil Sreeramaswamy Date: Mon, 3 Nov 2025 11:52:13 +0100 Subject: [PATCH 3/3] Test textinput removal --- .github/workflows/sync_cling.yml | 1 + .github/workflows/utilities/sync_cling.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/.github/workflows/sync_cling.yml b/.github/workflows/sync_cling.yml index 133ad32772bd2..9740b662203b9 100644 --- a/.github/workflows/sync_cling.yml +++ b/.github/workflows/sync_cling.yml @@ -4,6 +4,7 @@ on: pull_request: paths: - 'interpreter/cling/**' + - '.github/workflows/utilities/sync_cling.py' jobs: sync-cling-history: if: github.repository_owner == 'devajithvs' diff --git a/.github/workflows/utilities/sync_cling.py b/.github/workflows/utilities/sync_cling.py index 20a6e6b0fe951..9941eff13c79f 100755 --- a/.github/workflows/utilities/sync_cling.py +++ b/.github/workflows/utilities/sync_cling.py @@ -177,6 +177,10 @@ def principal(): applyPatches(patches) + # Remove text-input directory, revert this after the run. + execCommand(f'git rm lib/UserInterface/textinput -r', CLING_REPO_DIR_NAME) + execCommand(f'git commit -m "Remove `textinput` directory"', CLING_REPO_DIR_NAME) + syncTagAndPush(rootSyncTag, rootHashes[0]) if __name__ == '__main__':