Ship Windows x64 through a separately signed official GNU release channel

This commit is contained in:
2026-11-18 10:53:16 +01:00
parent 7ddd579888
commit 663e846415
16 changed files with 110 additions and 45 deletions
+9 -3
View File
@@ -15,10 +15,14 @@ import uuid
from dev_stage import ssh_prefix
def publish(tenant, platform, release, *, root=Path('/opt/rust-discovery/devstate/mvp-releases'),
def publish(tenant, platform, release, official_windows=False, *, root=Path('/opt/rust-discovery/devstate/mvp-releases'),
database_container='rust-discovery-server-postgres-1', service_uid=10001):
labels = {'x86_64-pc-windows-gnu': 'windows-gnu', 'x86_64-unknown-linux-gnu': 'linux'}
label = labels[platform]
if official_windows:
if platform != 'x86_64-pc-windows-gnu':
raise ValueError('Official Windows starter requires GNU x64')
label = 'windows-gnu-official'
source = root / 'objects' / tenant
config = root / 'config'
dest = config / 'customer-starters'
@@ -71,7 +75,8 @@ def publish(tenant, platform, release, *, root=Path('/opt/rust-discovery/devstat
if not stat.S_ISREG(info.st_mode) or info.st_size!=size:
raise ValueError('Missing regular package file')
write(digest,iter(lambda:f.read(1024*1024),b''))
write(platform+'.json',[json.dumps(desc,separators=(',',':')).encode()])
descriptor = platform + ('-official.json' if official_windows else '.json')
write(descriptor,[json.dumps(desc,separators=(',',':')).encode()])
directory_fd = os.open(dest, os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW)
try:
os.fsync(directory_fd)
@@ -84,10 +89,11 @@ def main():
parser=argparse.ArgumentParser(description=__doc__)
parser.add_argument('--tenant',required=True,type=uuid.UUID)
parser.add_argument('--platform',required=True,choices=['x86_64-unknown-linux-gnu','x86_64-pc-windows-gnu'])
parser.add_argument('--official-windows',action='store_true')
parser.add_argument('--release',required=True,type=uuid.UUID)
args=parser.parse_args()
imports='import hashlib,json,os,re,stat,subprocess,tempfile\nfrom pathlib import Path\n'
script=imports+inspect.getsource(publish)+'\npublish'+repr((str(args.tenant),args.platform,str(args.release)))
script=imports+inspect.getsource(publish)+'\npublish'+repr((str(args.tenant),args.platform,str(args.release),args.official_windows))
subprocess.run([*ssh_prefix('server'),'python3 -I -'],input=script,text=True,check=True)