Skip to content

Fails to build with msvc target #37

Closed
@jminer

Description

@jminer

I tried to cargo install Racer today, but it failed because libz-sys failed to compile. I have cargo installed Racer before, but I think it was with the gnu target. I recently switched to msvc, partially because that's what ring recommends. I'm using

rustc 1.29.0-nightly (54628c8ea 2018-07-30)
i686-pc-windows-msvc
Windows 10 64-bit
Visual Studio 2017 15.7.3

When it wouldn't build with Visual Studio 2017 RC, I updated to 15.7.3 today, but no change.

I just cloned the libz-sys repository, opened a PowerShell window, and it gives the same error:

PS C:\Files\Projects\libz-sys> cargo build
   Compiling cc v1.0.18
   Compiling vcpkg v0.2.4
   Compiling pkg-config v0.3.12
   Compiling libc v0.2.42
   Compiling libz-sys v1.0.18 (file:///C:/Files/Projects/libz-sys)
error: failed to run custom build command for `libz-sys v1.0.18 (file:///C:/Files/Projects/libz-sys)`
process didn't exit successfully: `C:\Files\Projects\libz-sys\target\debug\build\libz-sys-933099ae9f1330d8\build-script-build` (exit code: 1)
--- stdout
cargo:rerun-if-env-changed=LIBZ_SYS_STATIC
cargo:rerun-if-changed=build.rs
note, vcpkg did not find zlib: Could not find Vcpkg tree: No vcpkg.user.targets found. Set the VCPKG_ROOT environment variable or run 'vcpkg integrate install'
running: "nmake.exe" "/nologo" "/f" "C:\\Files\\Projects\\libz-sys\\target\\debug\\build\\libz-sys-7b5cb260792e8afa\\out\\build/win32/Makefile.msc" "zlib.lib"


failed to execute command: The system cannot find the file specified. (os error 2)
Is `nmake.exe` not installed?

Since ring successfully builds, and it also uses the MSVC toolchain, it seems libz-sys should be working too. Looks like VS isn't being detected properly? I tried running nmake from a VS command prompt and that works. (I haven't tried running Cargo from a VS command prompt yet.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions