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

dart2native: Clarify usage of -D/environment variables/environment declarations #42136

Closed
knaeckeKami opened this issue Jun 1, 2020 · 4 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.

Comments

@knaeckeKami
Copy link

dart2native --help prints:

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

I was confused by this. I didn't think of environment declarations that will be read via [int|String...].fromEnvironment, but of actual OS environment variables, so that option did not make much sense for me.
This wording is also not very googleable, as "dart environment variables" returns no related result.

I suggest replacing "environment variables" with "environment declarations". This is consistent with the documentation of String.fromRuntime for example:

Returns the string value of the environment declaration name. Environment declarations are provided by the surrounding system compiling or running the Dart program. Declarations map a string key to a string value.

https://api.flutter.dev/flutter/dart-core/String/String.fromEnvironment.html

Related: #17262

Dart Version

./dart --version
Dart VM version: 2.8.3 (stable) (Tue May 26 18:39:38 2020 +0200) on "macos_x64"

@vsmenon vsmenon added the area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. label Jun 2, 2020
@mkustermann
Copy link
Member

Tentatively assigning @mit-mit, since you were looking at this recently IIRC

@mit-mit
Copy link
Member

mit-mit commented Jun 2, 2020

CL in https://dart-review.googlesource.com/c/sdk/+/149595/1

@mit-mit
Copy link
Member

mit-mit commented Jun 3, 2020

Thanks @knaeckeKami for bringing this to our attention, we've updated both our product help and dart.dev documentation!

@mit-mit
Copy link
Member

mit-mit commented Aug 31, 2020

dart-bot pushed a commit that referenced this issue Aug 31, 2020
Related to #42136

Followup to https://dart-review.googlesource.com/c/sdk/+/149595/1

Change-Id: I9427374434d9d38c6b83f71466445edf6db5ea02
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161107
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
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

4 participants