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

dart2aot doesn't list command-line options #36902

Closed
nex3 opened this issue May 9, 2019 · 7 comments
Closed

dart2aot doesn't list command-line options #36902

nex3 opened this issue May 9, 2019 · 7 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.

Comments

@nex3
Copy link
Member

nex3 commented May 9, 2019

dart2aot --help prints:

Usage: dart2aot [options] <dart-source-file> <dart-aot-file>

Dart AOT (ahead-of-time) compile Dart source code into native machine code.

This indicates that there are options that can be passed, but it doesn't indicate what they are.

@mit-mit mit-mit added the area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. label May 14, 2019
@mit-mit mit-mit assigned ghost and szakarias May 14, 2019
@GauravPatni
Copy link

Hi Natalie,
have you found details on this?

Also, for me, while doing "dart2aot main.dart main.dart.aot" from the project directory, it shows

"C:\Program' is not recognized as an internal or external command,
operable program or batch file."

System: windows7

Thanks,
Gaurav

@sayhicoelho
Copy link

Here facing with the same issue, @GauravPatni

@idraper
Copy link

idraper commented Jul 10, 2019

@GauravPatni @sayhicoelho I experienced this problem ('C:\Program' not recognized...) and created an issue here with my workaround until the issue is resolved officially:
#37130

@thosakwe
Copy link

After some digging, the accepted options are:

  • --packages
  • --enable-asserts
  • --build-elf - Build an assembly file that is then assembled into an ELF format object
  • --tfa, --no-tfa - "Enable global type flow analysis and related transformations in AOT mode."
  • -Dfoo, -Dfoo=bar - these options are passed directly to gen_kernel
  • Any other remaining options starting with -- are passed directly to gen_snapshot.

gen_kernel = dart $DART_SDK/bin/snapshots/gen_kernel.dart.snapshot
and gen_snapshot = $DART_SDK/utils/gen_snapshot (not a Dart file, it's a standalone executable)

Hopefully this is helpful to someone. This Github issue was the first result for "dart2aot options", so maybe it will be.

@nex3
Copy link
Member Author

nex3 commented Jul 28, 2019

Nice detective work! 🕵️‍♂️ Can you tell if --tfa is enabled by default?

@thosakwe
Copy link

Thanks! And yes, it is:

   --[no-]tfa                            Enable global type flow analysis and related transformations in AOT mode.
                                          (defaults to on)

@mkustermann
Copy link
Member

The current dart2native does print available options:

% dart2native --help
Usage: dart2native <main-dart-file> [<options>]

Generates an executable or an AOT snapshot from <main-dart-file>.

-D, --define=<key=value>            Set values of environment variables. To specify multiple variables, use multiple options or use commas to separate key-value pairs.
                                    E.g.: dart2native -Da=1,b=2 main.dart
    --enable-asserts                Enable assert statements.
-h, --help                          Display this help message.
-k, --output-kind=<aot|exe>         
          [aot]                     Generate an AOT snapshot.
          [exe] (default)           Generate a standalone executable.

-o, --output=<path>                 Set the output filename. <path> can be relative or absolute.
                                    E.g.: dart2native main.dart -o ../bin/my_app.exe
-p, --packages=<path>               Get package locations from the specified file instead of .packages. <path> can be relative or absolute.
                                    E.g.: dart2native --packages=/tmp/pkgs main.dart
-S, --save-debugging-info=<path>    Remove debugging information from the output and save it separately to the specified file. <path> can be relative or absolute.
-v, --verbose                       Show verbose output.

So I'm assuming this issue has been addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
Projects
None yet
Development

No branches or pull requests

8 participants