r-darwish / topgrade

Upgrade everything
GNU General Public License v3.0
3.36k stars 161 forks source link

[BUG] Could not compile for Android(Termux) #895

Closed MrAdityaAlok closed 2 years ago

MrAdityaAlok commented 2 years ago

What did you expect to happen?

Should compile without errors.

What actually happened?

error[E0425]: cannot find function, tuple struct or tuple variant `SkipStep` in this scope
   --> src/steps/os/unix.rs:160:20
    |
160 |         return Err(SkipStep(String::from("Gnome shell extensions are unregistered in DBus")).into());
    |                    ^^^^^^^^ not found in this scope
    |
help: consider importing this tuple struct
    |
3   | use crate::error::SkipStep;
    |

Additional details

Cross-compiling on ubuntu 20.04

Suggested solution

This patch makes it work, but I thought this should be reported since you may have to patch at other places too.

--- a/src/steps/os/unix.rs  2022-04-12 00:55:54.772532982 +0530
+++ b/src/steps/os/unix.rs  2022-04-12 00:59:10.312532907 +0530
@@ -1,4 +1,4 @@
-#[cfg(target_os = "linux")]
+#[cfg(any(target_os = "linux", target_os = "android"))]
 use crate::error::SkipStep;
 use crate::error::TopgradeError;
 use crate::execution_context::ExecutionContext;
Paste the output of `topgrade -v`
*Not applicable*