Exclude `DEPS.tagged-release` commits when determining `tot` version (#1812) Commits in `emscripten-releases` that modify `DEPS.tagged-release` are release candidates whose dependencies are often branched from an older revision than tip-of-tree `DEPS`. Exclude commits that only modify `DEPS.tagged-release` when finding the latest `tot` build. This recently bit us, resulting in a tagged release being rolled into emscripten: https://github.com/emscripten-core/emscripten/pull/28027.
diff --git a/emsdk.py b/emsdk.py index d7e8644..2da9263 100644 --- a/emsdk.py +++ b/emsdk.py
@@ -766,8 +766,11 @@ return stdout.strip() -def git_recent_commits(repo_path, n=20): - stdout = run_get_output([GIT(), 'log', '-n', str(n), '--pretty="%H"'], cwd=repo_path) +def git_recent_commits(repo_path, n=20, exclude=None): + cmd = [GIT(), 'log', '-n', str(n), '--pretty="%H"'] + if exclude: + cmd += ['--', '.', f':(exclude){exclude}'] + stdout = run_get_output(cmd, cwd=repo_path) return stdout.strip().replace('\r', '').replace('"', '').split('\n') @@ -2362,7 +2365,7 @@ success = git_clone_checkout_and_pull(emscripten_releases_repo, sdk_path('releases'), 'main') if not success: exit_with_error('error checking out emscripten-releases repo') - recent_releases = git_recent_commits(sdk_path('releases')) + recent_releases = git_recent_commits(sdk_path('releases'), exclude='DEPS.tagged-release') # The recent releases are the latest hashes in the git repo. There # may not be a build for the most recent ones yet; find the last # that has uploaded binaries for all platforms.