Skip to content

Commit

Permalink
Fix submodule CI cache stamps
Browse files Browse the repository at this point in the history
Since we don't sync submodules in our checkout for build unless we
have to, we need to pass `--cached` or else the commit we get might be
whatever is lying around.
  • Loading branch information
msullivan committed Mar 15, 2024
1 parent 72421db commit b36e59b
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,23 +386,24 @@ def _get_git_rev(repo, ref):

def _get_pg_source_stamp():
output = subprocess.check_output(
['git', 'submodule', 'status', 'postgres'],
['git', 'submodule', 'status', '--cached', 'postgres'],
universal_newlines=True,
cwd=ROOT_PATH,
)
revision, _, _ = output[1:].partition(' ')
source_stamp = revision + '+' + PGVECTOR_COMMIT
return source_stamp
return source_stamp.strip()


def _get_libpg_query_source_stamp():
output = subprocess.check_output(
['git', 'submodule', 'status', 'edb/pgsql/parser/libpg_query'],
['git', 'submodule', 'status', '--cached',
'edb/pgsql/parser/libpg_query'],
universal_newlines=True,
cwd=ROOT_PATH,
)
revision, _, _ = output[1:].partition(' ')
return revision
return revision.strip()


def _compile_cli(build_base, build_temp):
Expand Down Expand Up @@ -546,10 +547,10 @@ def run(self):
print(binascii.hexlify(parser_hash).decode())

elif self.type == 'postgres':
print(_get_pg_source_stamp().strip())
print(_get_pg_source_stamp())

elif self.type == 'libpg_query':
print(_get_libpg_query_source_stamp().strip())
print(_get_libpg_query_source_stamp())

elif self.type == 'bootstrap':
bootstrap_hash = hash_dirs(
Expand All @@ -576,7 +577,10 @@ def run(self):
(pkg_dir, '.pxd'),
(pkg_dir, '.pxi'),
])
print(binascii.hexlify(ext_hash).decode())
print(
binascii.hexlify(ext_hash).decode() + '-'
+ _get_libpg_query_source_stamp()
)

elif self.type == 'cli':
print(_get_git_rev(EDGEDBCLI_REPO, EDGEDBCLI_COMMIT))
Expand Down

0 comments on commit b36e59b

Please sign in to comment.