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
argv/argc docs needed #113
Comments
@eyberg why the inconsistency? Should the action item to be consistent rather than documenting a possible unnecessary complexity?? |
i think this needs more discussion as both behaviors are potentially correct |
This is mostly a C convention that argv[0] is the name of the executable and many program expect it that way. For example golang argv[0] is the program name and any kind of arg parsing code will do something like this firstArg = os.Args[1] expecting os.Args[0] to be program name. We can change our elf_entry point invoke to always pass in the additional argument[0] with program name |
Without argv[0] filled out, just importing the standard Go package
|
until this is resolved one thing you can do now to get by this is explicitly setting the first arg ->
it's unclear to me whether this is strictly an ops issue or something that needs to be fixed in the manifest for nanos ingest, it's also unclear to me why this behavior exists to begin with - I believe it's leftover cruft from the load/run of ops |
talked this over and the consensus is that this is an ops issue that should be fixed in ops
|
fyi - there's a small chance that we might need to re-roll some pkgs &&|| fix some https://github.com/nanovms/ops-examples - but can do that as an addendum once a fix here is in place |
old/closing - nanos will now fill in the program name if null arguments coming from ops |
not really sure what to say here but tijoy pointed out that some binaries expect the binary name as the first argument and some don't - I noticed this with both nginx && apache when I was trying to load them
for instance w/apache you'll see this ->
that error msg is actually a diff. error mgs it's finding it here but if we leave out the "httpd" part instead of finding the file it'll print this msg instead ->
we should prob. think about documenting this on the "run your own binary" as a faq or something until we drill more into it
The text was updated successfully, but these errors were encountered: