Skip to content

Conversation

@osa1
Copy link
Member

@osa1 osa1 commented Jul 8, 2022

In #698 we forgot to add cross-compilation support to benchmark builder, which
broke Golem.

This PR implements cross compilation support for AOT snapshots.

Changes:

  • AOT target is no longer enabled by default

  • When using --target=aot, we now expect one extra parameter and one env variable:

    • --aot-target=[x64|armv7hf|armv8] target platform of the snapshot

    • $DART_SDK env variable specifies the SDK path. We use this path to invoke
      precompiler2.

We could avoid adding --aot-target with a syntax like --target=aot=x64. I
don't know how common this syntax is.

Path to Dart SDK is an env variable as in my experience you usually set it in
your shell rc and we have other dev tools that expect DART_SDK to be set.

@mkustermann @sigurdm any thoughts?

}

/// Maps `--aot-target` arguments to their [AotTarget]s
const aotTargets = <String, AotTarget>{
Copy link
Collaborator

Choose a reason for hiding this comment

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

(to avoid duplication you could use AotTarget.values and their string representation)

});
}

const aotTarget = Target('aot', aotProcessArgs);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this aotTarget and aotProcessArgs unused now?

return Target('aot', (sourceFile) {
final baseName = path.basename(sourceFile);
final baseNameNoExt = path.withoutExtension(baseName);
// TODO: Do we need `-Ddart.vm.product=true`?
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes :)

@osa1
Copy link
Member Author

osa1 commented Aug 19, 2025

Not sure if this is still necessary...

@osa1 osa1 closed this Aug 19, 2025
@osa1 osa1 deleted the benchmark_cross_comp branch August 19, 2025 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants