Can anyone build Mock-Routing on Win?


#21

Microsoft Visual C.

Microsoft = Visual C tools
GNU = GCC

Rust can handle both, try pick GNU/GCC like David said. It’s in the link I provided earlier. Maybe un-install the old Rust? I remember falling back to that one some time ago.

EDIT:

https://www.rust-lang.org/en-US/other-installers.html#which


#22

great, uninstalled and getting this one


#23

ughhh hate coding on windows

uninstalled with a linux command, reinstalling with the gnu ver


#24

idk, uninstalled successfully and reinstalled that version I posted above

but it still gives me the msvc error when building mock r launcher

any idea why none of the changes made a difference?


#25

Between uninstalling and installing did you log out, some of these things will affect your path. Also msvc could have been put in your path before gcc.


#26

yes, logged out in between. still says MSVC problem, I’ll look at my paths again but I swear I have them all set up correctly (above)


#27

Rust can be a pita defaulting to MSVC. I’ve had it before when trying to build the Vault. So even when your path is right it might look for MSVC. It only worked for me after re-installing like you did. No clue what you could try next.


#28

Your system path environment variable seems broken because some essential parts are missing. Here is a screen shot of mine:


#29

Hmm IDK, my screen (above) even looks very different from yours. I have “User Variables” and “System Variables” sections.

Win7. Don’t know which ones to modify to make things work better


#30

Select Path in System variable and then click edit. @polpolrene has shown a screen shot in this post including C:\MinGW\bin part.


#31

I feel dumb, like I’m missing something simple.

Is my path variable above done correctly?


#32

You need to click on it (path) and then click the edit button to see what it is set at. I am not a win user but this part seems that you will need to click edit to see it and ofc change it if needed.


#33

I thought you can see it there, C:/MinGW/bin

I’ll edit it also


#34

In windows 7 and windows 8.1 edit the Path is different that windows 10. You highlight “Path”, press edit and add the new Path in the end after a semicolon. Somethink like that:

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0;C:\MinGW\bin

@WhiteOutMashups, Your use / instead of \ and ,possibly, broke your windows deleting system path. Copy the above text in the path to restore.


#35

ok did it, still same error. nothing has been able to change the error message

it’s ok thanks anyway guys, the Vietnam meeting is over now but we tried!

I won’t waste any more of your guys time! But can’t thank u all enough!

so I officially gave up on this but thanks very much everyone for all your help!!!

will just do practice dev on Linux until mock-routing is ready with authenticator browser. Hope that is Thursday! :smiley: :smiley:


#36

Might be worth solving this before it is next needed (and not marking it solved until it is solved!).

Not saying you should do it Will. But if MaidSafe Solutions need it, maybe they can take it on, or get a Linux laptop perhaps.

Great attempt though Will, you’ve also highlighted how hard this is to set up. I managed to get mock routing working on Linux ages ago, but had help from Viv at the time. None of this is easy. :slight_smile:


#37

I’m not gonna put loads of energy into this but did give it a little try. When you install Rust make sure to choose custom install:

“Default host triple?” should be answered with the GNU version as in the screenshot. That’s even needed while you already downloaded the GNU version of the installer :laughing:.

I downloaded the latest core and started to build it with mock routing:

I got this error at the end:

   Compiling unicode-bidi v0.2.5
   Compiling serde_json v0.9.10
   Compiling idna v0.1.1
error: failed to run custom build command for `brotli-sys v0.2.1`
process didn't exit successfully: `C:\Users\user\Desktop\Client\safe_client_libs-master\target\debug\build\brotli-sys-47345598f21360c8\build-script-build` (exit code: 101)
--- stdout
cargo:dec_include=C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\brotli-sys-0.2.1\brotli/dec
cargo:enc_include=C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\brotli-sys-0.2.1\brotli/enc
TARGET = Some("x86_64-pc-windows-gnu")
OPT_LEVEL = Some("0")
TARGET = Some("x86_64-pc-windows-gnu")
HOST = Some("x86_64-pc-windows-gnu")
TARGET = Some("x86_64-pc-windows-gnu")
TARGET = Some("x86_64-pc-windows-gnu")
HOST = Some("x86_64-pc-windows-gnu")
CC_x86_64-pc-windows-gnu = None
CC_x86_64_pc_windows_gnu = None
HOST_CC = None
CC = None
TARGET = Some("x86_64-pc-windows-gnu")
HOST = Some("x86_64-pc-windows-gnu")
CFLAGS_x86_64-pc-windows-gnu = None
CFLAGS_x86_64_pc_windows_gnu = None
HOST_CFLAGS = None
CFLAGS = None
PROFILE = Some("debug")
running: "gcc.exe" "-O0" "-ffunction-sections" "-fdata-sections" "-g" "-m64" "-o" "C:\\Users\\user\\Desktop\\Client\\safe_client_libs-master\\target\\debug\\build\\brotli-sys-4f6c5922c144db5c\\out\\brotli/common\\dictionary.o" "-c" "brotli/common/dictionary.c"
cargo:warning=brotli/common/dictionary.c:1:0: sorry, unimplemented: 64-bit mode not compiled in
cargo:warning= /* Copyright 2013 Google Inc. All Rights Reserved.
cargo:warning= ^
ExitStatus(ExitStatus(1))


command did not execute successfully, got: exit code: 1



--- stderr
thread 'main' panicked at 'explicit panic', C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\gcc-0.3.45\src\lib.rs:1152
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Build failed, waiting for other jobs to finish...
error: build failed

I’m not an expert at this stuff. I guess the devs are busy working on the browser so I won’t call them for help. I guess we’ll have to wait for the SAFE Browser with all stuff included as the launcher is depreciated anyway in some weeks.


#38

Not sure how much difference it makes but the command in the instructions I followed is cargo build --release –features use-mock-routing {no quotes} . I don’t think that’s the issue, but might be worth a try.

I hate to break it to you, but that’s the “straightforward” bit (I can send you the .dll if you like). It’s when you start building the Launcher in nodejs that it gets really annoying. I vowed it would not defeat me, but in the end it did.


#39

Thanks, did give the same error though.
I think I’ll wait for the SAFE Browser with all the features :+1:.


#40

Steps to build routing with the mock-routing feature on Windows 7. These steps were completed on a VM running a clean Windows 7 OS.

  1. Download MinGW-64 - http://mingw-w64.org/doku.php/download/mingw-builds

  2. Run MinGW installer and during installation change architecture to x86_64

  3. Install rust using rustup - https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-gnu/rustup-init.exe - download and run rustup-init.exe - ignore any warnings when asked about installing the Microsoft Visual C++ Build Tools, just continue since you ‘know what you are doing’; Select 2) Customize Installation; host triple is x86_64-windows-pc-gnu; toolchain is stable; modify path is y (for yes); Select 1) Proceed with installation

  4. Install Microsoft .NET Framework 4.5.1 - https://www.microsoft.com/en-us/download/details.aspx?id=40779

  5. Install powershell - https://social.technet.microsoft.com/wiki/contents/articles/21016.how-to-install-windows-powershell-4-0.aspx - all the prerequisites should already be installed.

  6. Download or git-clone safe_client_libs - https://github.com/maidsafe/safe_client_libs - make sure you have the right version, almost certainly not the master branch!

  7. Build safe_client_libs - Start > MinGW-64 > Run Terminal; cd path\to\safe_client_libs; cargo build --release --features use-mock-routing

This setup also works for building safe_vault on windows.

I have succefully compiled safe_client_libs with mock routing but haven’t tried the compiled binary with the launcher yet.


Gotchas:

  • Use MinGW-64 for gcc 64 bit (not 32 bit)
  • Use rustup for easy management of rust environment variables and versions
  • Use gnu toolchain for rust, not msvc (which is the default for most rust with windows)

Using MinGW64 solves this error.