From 3a278ad3b378bfa1283903e544e59ed38c21dfbb Mon Sep 17 00:00:00 2001 From: Patrick Quist Date: Wed, 4 Sep 2024 19:18:37 +0200 Subject: [PATCH] Add library lookupname to support binary builds for boost (#6814) --- etc/config/c++.amazon.properties | 4 +++- lib/buildenvsetup/ceconan.ts | 9 ++++++--- lib/options-handler.ts | 6 ++++++ static/options.interfaces.ts | 2 ++ static/widgets/libs-widget.ts | 10 ++++++++-- 5 files changed, 25 insertions(+), 6 deletions(-) diff --git a/etc/config/c++.amazon.properties b/etc/config/c++.amazon.properties index 42d6de6ef3b..4d0d473bb37 100644 --- a/etc/config/c++.amazon.properties +++ b/etc/config/c++.amazon.properties @@ -3874,8 +3874,10 @@ libs.boost.versions.183.version=1.83.0 libs.boost.versions.183.path=/opt/compiler-explorer/libs/boost_1_83_0 libs.boost.versions.184.version=1.84.0 libs.boost.versions.184.path=/opt/compiler-explorer/libs/boost_1_84_0 + libs.boost.versions.185.version=1.85.0 -libs.boost.versions.185.path=/opt/compiler-explorer/libs/boost_1_85_0 +libs.boost.versions.185.packagedheaders=true +libs.boost.versions.185.lookupname=boost_bin libs.bmulti.name=B-Multi libs.bmulti.url=https://gitlab.com/correaa/boost-multi diff --git a/lib/buildenvsetup/ceconan.ts b/lib/buildenvsetup/ceconan.ts index dce9c220d13..5b2a480482a 100644 --- a/lib/buildenvsetup/ceconan.ts +++ b/lib/buildenvsetup/ceconan.ts @@ -245,12 +245,14 @@ export class BuildEnvSetupCeConanDirect extends BuildEnvSetupBase { _.each(libraryDetails, (details, libId) => { if (details.packagedheaders || this.hasBinariesToLink(details)) { + const lookupname = details.lookupname || libId; const lookupversion = details.lookupversion || details.version; allLibraryBuilds.push({ id: libId, version: details.version, + lookupname: details.lookupname, lookupversion: details.lookupversion, - possibleBuilds: this.getAllPossibleBuilds(libId, lookupversion).catch(() => false), + possibleBuilds: this.getAllPossibleBuilds(lookupname, lookupversion).catch(() => false), }); } }); @@ -258,15 +260,16 @@ export class BuildEnvSetupCeConanDirect extends BuildEnvSetupBase { const buildProperties = await this.getConanBuildProperties(key); for (const libVerBuilds of allLibraryBuilds) { + const lookupname = libVerBuilds.lookupname || libVerBuilds.id; const lookupversion = libVerBuilds.lookupversion || libVerBuilds.version; - const libVer = `${libVerBuilds.id}/${lookupversion}`; + const libVer = `${lookupname}/${lookupversion}`; const possibleBuilds = await libVerBuilds.possibleBuilds; if (possibleBuilds) { const hash = await this.findMatchingHash(buildProperties, possibleBuilds); if (hash) { logger.debug(`Found conan hash ${hash} for ${libVer}`); allDownloads.push( - this.getPackageUrl(libVerBuilds.id, lookupversion, hash).then(downloadUrl => { + this.getPackageUrl(lookupname, lookupversion, hash).then(downloadUrl => { return this.downloadAndExtractPackage(libVerBuilds.id, lookupversion, dirPath, downloadUrl); }), ); diff --git a/lib/options-handler.ts b/lib/options-handler.ts index 2ccc3ba8388..908542b7f3e 100755 --- a/lib/options-handler.ts +++ b/lib/options-handler.ts @@ -50,6 +50,7 @@ export type VersionInfo = { path: string[]; libpath: string[]; liblink: string[]; + lookupname?: PropertyValue; lookupversion?: PropertyValue; options: string[]; hidden: boolean; @@ -329,6 +330,11 @@ export class ClientOptionsHandler { versionObject.lookupversion = lookupversion; } + const lookupname = this.compilerProps(lang, libVersionName + '.lookupname'); + if (lookupname) { + versionObject.lookupname = lookupname; + } + const includes = this.compilerProps(lang, libVersionName + '.path'); if (includes) { versionObject.path = includes.split(path.delimiter); diff --git a/static/options.interfaces.ts b/static/options.interfaces.ts index b0052170093..1b3c1c889e0 100644 --- a/static/options.interfaces.ts +++ b/static/options.interfaces.ts @@ -32,6 +32,8 @@ export type LibraryVersion = { libId: string; used: boolean; version?: string; + lookupname?: string; + lookupversion?: string; }; export type Library = { diff --git a/static/widgets/libs-widget.ts b/static/widgets/libs-widget.ts index 610d2753c93..456db01c0c6 100644 --- a/static/widgets/libs-widget.ts +++ b/static/widgets/libs-widget.ts @@ -120,7 +120,7 @@ function shortenMachineName(name: string): string { } else if (name === 'Intel 80386') { return '386'; } else if (name === '') { - return 'amd64'; + return 'default target'; } return name; @@ -477,6 +477,10 @@ export class LibsWidget { } option.attr('value', versionId); option.html(version.version || versionId); + + option.data('lookupname', version.lookupname || libId); + option.data('lookupversion', version.lookupversion || version.version || versionId); + if (version.used || !version.hidden) { hasVisibleVersions = true; versions.append(option); @@ -501,8 +505,10 @@ export class LibsWidget { const popupId = `build-info-content-${nowts}`; const option = versions.find('option:selected'); const semver = option.html(); + const lookupname = option.data('lookupname'); + const lookupversion = option.data('lookupversion'); if (semver !== '-') { - this.loadBuildInfoIntoPopup(popupId, libId, semver, lib.url); + this.loadBuildInfoIntoPopup(popupId, lookupname, lookupversion, lib.url); return `
Loading...
`; } else { return `
No version selected
`;