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

Fix an issue when library was unable to build under windows environment #357

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Pzixel
Copy link

@Pzixel Pzixel commented May 12, 2018

I'm trying to build zlib-sys which is depended on this library. When I'm trying to build it I get an error:

PS C:\Users\Alex\CLionProjects\untitled3> cargo build -vv
       Fresh pkg-config v0.3.11
       Fresh cc v1.0.15
       Fresh libc v0.2.40
   Compiling libz-sys v1.0.18
     Running `C:\Users\Alex\CLionProjects\untitled3\target\debug\build\libz-sys-8b69be095153c22a\build-script-build`
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
DEBUG = Some("true")
running: "make" "-f" "win32/Makefile.gcc" "install" "prefix=/C/Users/Alex/CLionProjects/untitled3/target/debug/build/libz-sys-20101f4439ca4593/out" "IMPLIB=" "INCLUDE_PATH=/C/Users/Alex/CLionProjects/untitled3/target/debug/build/libz-sys-20101f4439ca4593/out/include" "LIBRARY_PATH=/C/Users/Alex/CLionProjects/untitled3/target/debug/build/libz-sys-20101f4439ca4593/out/lib" "BINARY_PATH=/C/Users/Alex/CLionProjects/untitled3/target/debug/build/libz-sys-20101f4439ca4593/out/bin"
-z was unexpected at this time.
make: *** [win32/Makefile.gcc:128: install] Error 255


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


error: failed to run custom build command for `libz-sys v1.0.18`
process didn't exit successfully: `C:\Users\Alex\CLionProjects\untitled3\target\debug\build\libz-sys-8b69be095153c22a\build-script-build` (exit code: 1)
--- stdout
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
DEBUG = Some("true")
running: "make" "-f" "win32/Makefile.gcc" "install" "prefix=/C/Users/Alex/CLionProjects/untitled3/target/debug/build/libz-sys-20101f4439ca4593/out" "IMPLIB=" "INCLUDE_PATH=/C/Users/Alex/CLionProjects/untitled3/target/debug/build/libz-sys-20101f4439ca4593/out/include" "LIBRARY_PATH=/C/Users/Alex/CLionProjects/untitled3/target/debug/build/libz-sys-20101f4439ca4593/out/lib" "BINARY_PATH=/C/Users/Alex/CLionProjects/untitled3/target/debug/build/libz-sys-20101f4439ca4593/out/bin"


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



--- stderr
-z was unexpected at this time.
make: *** [win32/Makefile.gcc:128: install] Error 255

It happens because of this line:

@if test -z "$(DESTDIR)$(INCLUDE_PATH)" -o -z "$(DESTDIR)$(LIBRARY_PATH)" -o -z "$(DESTDIR)$(BINARY_PATH)"; then \

test -z is not a valid batch code as you can check yourself:

image

This is an attempt to fix this issue for Windows.

@Pzixel Pzixel changed the title Windows fix Fix an issue when library was unable to build under windows environment May 12, 2018
@Pzixel
Copy link
Author

Pzixel commented May 12, 2018

Relates to rust-lang/libz-sys#34

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

Successfully merging this pull request may close these issues.

1 participant