ardaku / whoami

Rust crate to get the current user and environment.
Apache License 2.0
195 stars 31 forks source link

Android wapm crash at missing /etc/os-release #28

Closed truboxl closed 3 years ago

truboxl commented 3 years ago

Describe the bug Tried building Android version wapm which uses whoami, getting crashes when running wapm on Android Not sure how to try experiment patching as I am unfamiliar how cargo works Deps and all are picked up by cargo automatically

To Reproduce Unlikely to suggest a very fast way to set up as I am using a complex environment But it will be a good try to see what happens when /etc/os-release does not exist which is true for Android

Expected behavior Should not crash

Screenshots Screenshot_20210923-152546_Termux

Smartphone (please complete the following information):

Additional context Tried upgrading from whoami 0.5.3 to whoami 1.1.3 in wapm still stuck here

AldaronLau commented 3 years ago

@truboxl Thanks, for opening the issue! I'll look into fixing it.

AldaronLau commented 3 years ago

@truboxl Do you want to test #29? It should fix the issue.

truboxl commented 3 years ago

Wow that works! wapm no longer crashes 🤣 Took me quite some time to really understand how to patch using cargo and manifest file https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#working-with-an-unpublished-minor-version https://github.com/rust-lang/cargo/issues/8690

Screenshot: Screenshot_20210926-122520_Termux

I think you can close this once landed I think I will submit PR at wasmer side to use the latest whoami

AldaronLau commented 3 years ago

@truboxl Just released version 1.1.4 released with the patch.