-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Binary file from dart2native can't be used from Linux's path #38912
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
Comments
Thank you for reporting this issue. I'm investigating. In the meantime, can I get you to test if you're able to work around the issue by running the binary via a path instead of just the binary name? I.e.:
|
Both ways of running it, from absolute/relative-path, work correctly. |
Loading of appended snapshots used to try read the executable itself via arg[0] which holds the "path" to the executable. However, when the executable is being invoked via PATH the "path" can be just the name of the executable with no actual path. This would cause the file reading to fail to find the file and therefore fail to read. This in turn caused standalone executables to fail to run when invoked via PATH. Bug: #38912 Change-Id: I08501661441db90ce6cff96a9337a5770ec3524d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121853 Commit-Queue: Clement Skau <[email protected]> Reviewed-by: Martin Kustermann <[email protected]>
Loading of appended snapshots used to try read the executable itself via arg[0] which holds the "path" to the executable. However, when the executable is being invoked via PATH the "path" can be just the name of the executable with no actual path. This would cause the file reading to fail to find the file and therefore fail to read. This in turn caused standalone executables to fail to run when invoked via PATH. Bug: #38912 Change-Id: I08501661441db90ce6cff96a9337a5770ec3524d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121853 Commit-Queue: Clement Skau <[email protected]> Reviewed-by: Martin Kustermann <[email protected]>
This should now have been fixed at HEAD so I'll go ahead and close this issue. |
Does someone know if version 2.7.0 already includes this fix ? I think i have the same problem after generating an executable on Ubuntu and uploading it via SCP to a Debian machine. I try to run the executable on the Debian machine and it prints out the usage message. |
@cskau-g Do you have any information about my question ? |
@cskau-g I tried it again with version 2.7.1 but still the same problem.
|
@Ephenodrom, It should work in 2.7.1, yes. Testing it locally confirms this as well. It is of course possible you're running into a separate problem. You could try testing dart2native locally on your Debian system and verify you can at least run executables built there. If you continue to experience issues like this, feel free to start a new issue to track this. Thanks. |
The single binary files that created with dart2native can't be put and used from Linux's path, it will print the usage message instead, like:
I've found this issue with Dart 2.6.0-dev.7.0 on Linux.
The text was updated successfully, but these errors were encountered: