Skip to content

Commit 77441dc

Browse files
committed
Merge branch 'main' of https://github.com/compiler-explorer/infra into main
2 parents 881e220 + 2fc3b3f commit 77441dc

6 files changed

Lines changed: 64 additions & 10 deletions

File tree

bin/lib/ce_install.py

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ def build(
496496
else:
497497
print(f"Building {installable.name} ({platform.value}) for all")
498498

499-
if force or installable.should_build():
499+
if force or installable.should_build() or (platform == LibraryPlatform.Windows):
500500
was_temp_installed = False
501501

502502
if not installable.is_installed() and temp_install:
@@ -588,11 +588,25 @@ def generate_cpp_windows_props(context: CliContext):
588588

589589
@cli.command(name="list-gh-build-commands")
590590
@click.pass_obj
591+
@click.option("--per-lib", is_flag=True, help="Group by library instead of version")
591592
@click.argument("filter_", metavar="FILTER", nargs=-1)
592-
def list_cmd(context: CliContext, filter_: List[str]):
593-
"""List installation targets matching FILTER."""
594-
for installable in context.get_installables(filter_):
595-
print(f'gh workflow run win-lib-build.yaml --field "library={installable.name}" -R github.com/compiler-explorer/infra')
593+
def list_gh_build_commands(context: CliContext, per_lib: bool, filter_: List[str]):
594+
"""List gh workflow commands matching FILTER."""
595+
grouped = set()
596+
597+
if per_lib:
598+
for installable in context.get_installables(filter_):
599+
shorter_name = installable.name.replace("libraries/c++/", "").split(" ")[0]
600+
grouped.add(shorter_name)
601+
602+
for group in grouped:
603+
print(f'gh workflow run win-lib-build.yaml --field "library={group}" -R github.com/compiler-explorer/infra')
604+
else:
605+
for installable in context.get_installables(filter_):
606+
shorter_name = installable.name.replace("libraries/c++/", "")
607+
print(
608+
f'gh workflow run win-lib-build.yaml --field "library={shorter_name}" -R github.com/compiler-explorer/infra'
609+
)
596610

597611

598612
@cli.command()

bin/lib/installable/installable.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,24 @@ def build(self, buildfor: str, popular_compilers_only: bool, platform: LibraryPl
272272
return cppbuilder.makebuild(buildfor)
273273
elif self.build_config.build_type == "make":
274274
return cppbuilder.makebuild(buildfor)
275+
elif (
276+
self.build_config.build_type == "none"
277+
and self.build_config.lib_type == "headeronly"
278+
and platform == LibraryPlatform.Windows
279+
):
280+
sourcefolder = os.path.join(self.install_context.destination, self.install_path)
281+
cppbuilder = LibraryBuilder(
282+
_LOGGER,
283+
self.language,
284+
self.context[-1],
285+
self.target_name,
286+
sourcefolder,
287+
self.install_context,
288+
self.build_config,
289+
popular_compilers_only,
290+
platform,
291+
)
292+
return cppbuilder.makebuild(buildfor)
275293
elif self.build_config.build_type == "fpm":
276294
sourcefolder = os.path.join(self.install_context.destination, self.install_path)
277295
fbuilder = FortranLibraryBuilder(

bin/lib/library_build_config.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from typing import Optional, Dict, Any
22
from lib.installation_context import is_windows
33

4-
valid_lib_types = ["static", "shared", "cshared"]
4+
valid_lib_types = ["static", "shared", "cshared", "headeronly"]
55

66

77
class LibraryBuildConfig:
@@ -10,11 +10,15 @@ def __init__(self, config: Dict[str, Any]):
1010
self.build_type = self.config_get("build_type", "")
1111
self.build_fixed_arch = self.config_get("build_fixed_arch", "")
1212
self.build_fixed_stdlib = self.config_get("build_fixed_stdlib", "")
13-
self.lib_type = self.config_get("lib_type", "static")
13+
self.lib_type = self.config_get("lib_type", "headeronly")
1414
if not self.lib_type in valid_lib_types:
1515
raise RuntimeError(f"{self.lib_type} not a valid lib_type")
1616
self.staticliblink = self.config_get("staticliblink", [])
1717
self.sharedliblink = self.config_get("sharedliblink", [])
18+
if self.lib_type == "headeronly" and (self.staticliblink != [] or self.sharedliblink != []):
19+
raise RuntimeError(
20+
f"Header-only libraries should not have staticliblink or sharedliblink {self.staticliblink} {self.sharedliblink}"
21+
)
1822
self.url = "None"
1923
self.description = ""
2024
self.configure_flags = self.config_get("configure_flags", [])

bin/lib/library_builder.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def completeBuildConfig(self):
162162
self.buildconfig.sharedliblink = list(
163163
set(self.buildconfig.sharedliblink + specificVersionDetails["liblink"])
164164
)
165-
else:
165+
elif not self.buildconfig.lib_type == "headeronly":
166166
self.logger.debug("No specific library version information found")
167167

168168
if self.buildconfig.lib_type == "static":
@@ -580,7 +580,7 @@ def writebuildscript(
580580

581581
make_utility = self.buildconfig.make_utility
582582

583-
if self.buildconfig.build_type == "cmake":
583+
if self.buildconfig.build_type == "cmake" or self.buildconfig.build_type == "none":
584584
expanded_cmake_args = [
585585
self.expand_make_arg(arg, compilerTypeOrGcc, buildtype, arch, stdver, stdlib)
586586
for arg in self.buildconfig.extra_cmake_arg
@@ -741,6 +741,10 @@ def writebuildscript(
741741
self.setCurrentConanBuildParameters(
742742
buildos, buildtype, "cshared", "cshared", libcxx, arch, stdver, extraflags
743743
)
744+
elif self.buildconfig.lib_type == "headeronly":
745+
self.setCurrentConanBuildParameters(
746+
buildos, buildtype, "headeronly", "headeronly", libcxx, arch, stdver, extraflags
747+
)
744748
else:
745749
self.setCurrentConanBuildParameters(
746750
buildos, buildtype, compilerTypeOrGcc, compiler, libcxx, arch, stdver, extraflags
@@ -1336,6 +1340,16 @@ def makebuild(self, buildfor):
13361340
self.logger.error(
13371341
f"Unknown compiler {checkcompiler} to build cshared lib {self.buildconfig.sharedliblink}"
13381342
)
1343+
elif self.buildconfig.lib_type == "headeronly":
1344+
if self.platform == LibraryPlatform.Windows:
1345+
checkcompiler = "mingw64_ucrt_gcc_1220"
1346+
self.logger.info(
1347+
f"Header-only library, but running on Windows, so attempting build with {checkcompiler}"
1348+
)
1349+
if checkcompiler not in self.compilerprops:
1350+
self.logger.error(f"Unknown compiler {checkcompiler}")
1351+
else:
1352+
self.logger.info("Header-only library, no need to build")
13391353
elif buildfor == "nonx86":
13401354
self.forcebuild = True
13411355
checkcompiler = ""

bin/yaml/libraries.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,7 @@ libraries:
840840
- all
841841
package_install: true
842842
repo: kokkos/kokkos
843+
lib_type: static
843844
staticliblink:
844845
- kokkoscore
845846
- kokkoscontainers

init/settings.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ compiler:
2828
version: ANY
2929
libcxx: ANY
3030
cshared:
31-
version: ANY
31+
version: [cshared]
32+
libcxx: ANY
33+
headeronly:
34+
version: [headeronly]
3235
libcxx: ANY
3336
llvmmos:
3437
version: ANY

0 commit comments

Comments
 (0)