Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add native_aarch64 install option #1267

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions bin/lib/ce_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ def squash_mount_check(rootfolder, subdir, context):
)
@click.option("--enable", metavar="TYPE", multiple=True, help='Enable targets of type TYPE (e.g. "nightly")')
@click.option("--only-nightly", is_flag=True, help="Only install the nightly targets")
@click.option("--only-native-aarch64", is_flag=True, help="Only install the Native Aarch64 targets")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like we probably need a more general --only if we need to start adding lots of these.

@click.option(
"--cache",
metavar="DIR",
Expand Down Expand Up @@ -196,6 +197,7 @@ def cli(
dry_run: bool,
enable: List[str],
only_nightly: bool,
only_native_aarch64: bool,
cache: Optional[Path],
yaml_dir: Path,
allow_unsafe_ssl: bool,
Expand Down Expand Up @@ -224,6 +226,7 @@ def cli(
dry_run=dry_run,
is_nightly_enabled="nightly" in enable,
only_nightly=only_nightly,
only_native_aarch64=only_native_aarch64,
cache=cache,
yaml_dir=yaml_dir,
allow_unsafe_ssl=allow_unsafe_ssl,
Expand Down
3 changes: 3 additions & 0 deletions bin/lib/installable/installable.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ def should_install(self) -> bool:
if self.install_context.only_nightly and not self.nightly_like:
return False

if self.install_context.only_native_aarch64 and self.config_get("if", "") != "native_aarch64":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pragmatic, but I can't help wondering if a more general --only=native_aarch64 would be easier and more extensible. The nightly flag is special as we heuristically guess it rather than it being an actual if check in some cases

Copy link
Member Author

@partouf partouf May 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--only=... is not possible, i have experimented with it, but it breaks all the dependency handling and whatnot

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't it be exactly the same as what you have there? Like..

if self.install_context.only and self.config_get("if", "") != self.install_context.only:

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see that way, hmm, maybe. I experimented with making the filter do the work with narrowing the selection, but it's very hard to work with that code in general because the if information is not complete there like it is with config_get().

I'll give it a try

return False

return self.install_always or not self.is_installed()

def should_build(self):
Expand Down
2 changes: 2 additions & 0 deletions bin/lib/installation_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def __init__(
dry_run: bool,
is_nightly_enabled: bool,
only_nightly: bool,
only_native_aarch64: bool,
cache: Optional[Path],
yaml_dir: Path,
allow_unsafe_ssl: bool,
Expand All @@ -58,6 +59,7 @@ def __init__(
self.dry_run = dry_run
self.is_nightly_enabled = is_nightly_enabled
self.only_nightly = only_nightly
self.only_native_aarch64 = only_native_aarch64
retry_strategy = requests.adapters.Retry(
total=10,
backoff_factor=1,
Expand Down
2 changes: 2 additions & 0 deletions bin/test/installable/git_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ def _ensure_no_global_config():
def fake_context_fixture():
ctx = mock.Mock(spec=InstallationContext)
ctx.only_nightly = False
ctx.only_native_aarch64 = False
return ctx


@pytest.fixture(name="fake_context_nightly")
def fake_context_nightly_fixture():
ctx = mock.Mock(spec=InstallationContext)
ctx.only_nightly = True
ctx.only_native_aarch64 = False
return ctx


Expand Down
14 changes: 14 additions & 0 deletions bin/yaml/cpp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1302,3 +1302,17 @@ compilers:
- name: 4.9.4
tag: v2.6
name_no_dots: 494
native_aarch64:
if: native_aarch64
armofficial:
type: script
dir: "{subdir}/arm-clang-{name}"
check_file: "arm-linux-compiler-23.10_Ubuntu-22.04/llvm-bin/clang++"
subdir: native_aarch64
script: |
tar -xf "archive.tar" --strip-components=1
arm-compiler-for-linux_23.10_Ubuntu-22.04/arm-compiler-for-linux_23.10_Ubuntu-22.04.sh -a -i "{destination}/{dir}"
targets:
- name: 23.10
fetch:
- https://developer.arm.com/-/media/Files/downloads/hpc/arm-compiler-for-linux/23-10/arm-compiler-for-linux_23.10_Ubuntu-22.04_aarch64.tar archive.tar
Loading