Skip to content
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

iui = "0.3" in toml - not work, require git folder. Git method - work. #109

Open
Zymlex opened this issue Jan 18, 2021 · 6 comments
Open

Comments

@Zymlex
Copy link

Zymlex commented Jan 18, 2021

Windows Server 2019

error: failed to run custom build command for `ui-sys v0.1.3`
Caused by:
  process didn't exit successfully: `D:\Projects\Test\target\debug\build\ui-sys-54eef348477f7dd2\build-script-build` (exit code: 101)
  --- stdout
  git version 2.30.0.windows.1
  running: "cmake" "D:\\Rust\\cargo\\registry\\src\\github.com-1ecc6299db9ec823\\ui-sys-0.1.3\\libui" "-G" "Visual Studio 16 2019" "-Thost=x64" "-Ax64" "-DCMAKE_INSTALL_PREFIX=D:\\Projects\\Test\\target\\debug\\build\\ui-sys-9f5ae8adb4cc987e\\out" "-DCMAKE_C_FLAGS= -nologo -MD -Brepro" "-DCMAKE_C_FLAGS_RELEASE= -nologo -MD -Brepro" "-DCMAKE_CXX_FLAGS= -nologo -MD -Brepro" "-DCMAKE_CXX_FLAGS_RELEASE= -nologo -MD -Brepro" "-DCMAKE_ASM_FLAGS= -nologo -MD -Brepro" "-DCMAKE_ASM_FLAGS_RELEASE= -nologo -MD -Brepro" "-DCMAKE_BUILD_TYPE=release"
  --- stderr
  fatal: not a git repository (or any of the parent directories): .git
  thread 'main' panicked at '
  failed to execute command: The system cannot find the file specified. (os error 2)
  is `cmake` not installed?
  build script failed, must exit now', D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\cmake-0.1.45\src\lib.rs:894:5
  stack backtrace:
     0: std::panicking::begin_panic_handler
               at /rustc/e38fb306b7f5e65cca34df2dab1f0db15e1defb4\/library\std\src\panicking.rs:493
     1: std::panicking::begin_panic_fmt
               at /rustc/e38fb306b7f5e65cca34df2dab1f0db15e1defb4\/library\std\src\panicking.rs:435
     2: cmake::fail
               at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\cmake-0.1.45\src\lib.rs:894
     3: cmake::run
               at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\cmake-0.1.45\src\lib.rs:864
     4: cmake::Config::build
               at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\cmake-0.1.45\src\lib.rs:707
     5: build_script_build::main
               at .\build.rs:35
     6: core::ops::function::FnOnce::call_once<fn(),tuple<>>
               at D:\Rust\rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ops\function.rs:227
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
warning: build failed, waiting for other jobs to finish...
error: build failed
Process finished with exit code 101
@gbj
Copy link

gbj commented Feb 7, 2021

I’ll just add that I experienced the same thing trying to build IUI for the first time on my Mac today; using this repo in Cargo.toml solved it for me as well.

@nashley
Copy link

nashley commented Mar 7, 2021

#86 removed the dependency on cmake, but that hasn't made it into a release yet. I suspect that installing cmake would let you compile with the released version, but that's nearly 3 years old at this point, so it's probably a good idea to stick with using the git version.

@quickdudley
Copy link

I get the same error if I try to use iui from GitHub as a dependency in another crate, but if I run cd libui-rs/iui; cargo build it compiles without error.

@vstojkovic
Copy link

If people are still interested in this, I just ran into a bunch of issues with the cmake dependency, on Windows 10, and managed to solve them successfully. First, make sure that you install CMake and that it's version is no newer than 3.19. Second, make sure CMake is on your path. The installer can add it there, or you can set it manually. These two things should allow you to build iui version 0.3.0 without problems.

In case anyone is wondering why CMake 3.19, here's an explanation. The build.rs script in ui-sys uses the cmake crate incorrectly, by specifying an empty build target instead of calling no_build_target(true). This results in the command line option --target "" being passed to CMake, which used to work fine with older CMake version. CMake 3.15 added support for multiple build targets, but empty build target still worked the same as omitting the --target switch. Starting with CMake 3.20, specifying an empty target triggers the usage message, which breaks the ui-sys build.

@NoraCodes
Copy link
Collaborator

For what it's worth, I'm likely to have some free time from work soon and hopefully can take the time to fix the build script. Thank you all for this very useful discussion!

@kleinesfilmroellchen
Copy link

This still happens on Windows 10 with version 0.3. (trunk has some different issues with bindgen not finding clang so couldn't test that.) It's very unfortunate that this requires an outdated cmake version (I only have 3.22) and I don't want users of my project to have to apply these hacks in order to get IUI compiling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants