Skip to content

Commit

Permalink
Add library lookupname to support binary builds for boost (compiler-e…
Browse files Browse the repository at this point in the history
  • Loading branch information
partouf authored Sep 4, 2024
1 parent f9cfbf2 commit 3a278ad
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 6 deletions.
4 changes: 3 additions & 1 deletion etc/config/c++.amazon.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions lib/buildenvsetup/ceconan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,28 +245,31 @@ 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),
});
}
});

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);
}),
);
Expand Down
6 changes: 6 additions & 0 deletions lib/options-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export type VersionInfo = {
path: string[];
libpath: string[];
liblink: string[];
lookupname?: PropertyValue;
lookupversion?: PropertyValue;
options: string[];
hidden: boolean;
Expand Down Expand Up @@ -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<string>(lang, libVersionName + '.path');
if (includes) {
versionObject.path = includes.split(path.delimiter);
Expand Down
2 changes: 2 additions & 0 deletions static/options.interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ export type LibraryVersion = {
libId: string;
used: boolean;
version?: string;
lookupname?: string;
lookupversion?: string;
};

export type Library = {
Expand Down
10 changes: 8 additions & 2 deletions static/widgets/libs-widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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 `<div id="${popupId}">Loading...</div>`;
} else {
return `<div id="${popupId}">No version selected</div>`;
Expand Down

0 comments on commit 3a278ad

Please sign in to comment.