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

nmake install returns U1077 'if' : return code '0x1' #129

Closed
vlj opened this Issue Oct 7, 2016 · 5 comments

Comments

Projects
None yet
2 participants
@vlj
Contributor

vlj commented Oct 7, 2016

I'm trying to package harfbuzz ; harfbuzz provides an nmake build for msvc : https://github.com/behdad/harfbuzz/tree/master/win32

I'm using "nmake /f Makefile.vc CFG=release DIRECTWRITE=1" to build the Library and it works however I'm having trouble getting the install target to work. I'd like to avoid copying headers and binaries in the port file so I'm using this snippet :
"vcpkg_execute_required_process(
COMMAND ${NMAKE} -f Makefile.vc PREFIX=${CURRENT_PACKAGES_DIR} install
WORKING_DIRECTORY ${SOURCE_PATH}/win32/
)"

Unfortunatly it doesn't work it fails with this error :
"NMAKE : fatal error U1077: 'if' : return code '0x1'
Stop."

I'm not sure why, some internet search told me that I need to run vcvarsall.bat script before running nmake but this is relevant when running nmake from console.

@ras0219-msft

This comment has been minimized.

Show comment
Hide comment
@ras0219-msft

ras0219-msft Oct 7, 2016

Contributor

Could you paste the portfile here or push it to a branch? We do already run vcvarsall.bat before invoking the portfile, so I don't think that's the issue.

Contributor

ras0219-msft commented Oct 7, 2016

Could you paste the portfile here or push it to a branch? We do already run vcvarsall.bat before invoking the portfile, so I don't think that's the issue.

@vlj

This comment has been minimized.

Show comment
Hide comment
Contributor

vlj commented Oct 7, 2016

@ras0219-msft

This comment has been minimized.

Show comment
Hide comment
@ras0219-msft

ras0219-msft Oct 8, 2016

Contributor

Ok, I managed to find a fix! tl;dr nmake.exe and cmd.exe really do not like forward slashes -- they think they're arguments. The CURRENT_PACKAGES_DIR variable is using generic cmake paths with forward slashes and needs to be converted to native paths via file(TO_NATIVE_PATH...)

file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}" NATIVE_PACKAGES_DIR)

vcpkg_execute_required_process(
    COMMAND ${NMAKE} -f Makefile.vc CFG=release "PREFIX=${NATIVE_PACKAGES_DIR}" install
    WORKING_DIRECTORY ${SOURCE_PATH}/win32/
    LOGNAME make-${TARGET_TRIPLET}-release-install
)

Also, please add a LOGNAME parameter to each of the vcpkg_execute_required_process calls; I'll add a check in master to ensure this isn't forgotten.

Contributor

ras0219-msft commented Oct 8, 2016

Ok, I managed to find a fix! tl;dr nmake.exe and cmd.exe really do not like forward slashes -- they think they're arguments. The CURRENT_PACKAGES_DIR variable is using generic cmake paths with forward slashes and needs to be converted to native paths via file(TO_NATIVE_PATH...)

file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}" NATIVE_PACKAGES_DIR)

vcpkg_execute_required_process(
    COMMAND ${NMAKE} -f Makefile.vc CFG=release "PREFIX=${NATIVE_PACKAGES_DIR}" install
    WORKING_DIRECTORY ${SOURCE_PATH}/win32/
    LOGNAME make-${TARGET_TRIPLET}-release-install
)

Also, please add a LOGNAME parameter to each of the vcpkg_execute_required_process calls; I'll add a check in master to ensure this isn't forgotten.

@vlj

This comment has been minimized.

Show comment
Hide comment
@vlj

vlj Oct 8, 2016

Contributor

It works thanks ! I submitted it as #132

By the way how are build dependencies handled ? "vcpkg.exe install harfbuzz" fails if I don't build ragel before, and vcpkg doesn't attempt to build ragel automatically despite control file having "build-depends: ragel".

Contributor

vlj commented Oct 8, 2016

It works thanks ! I submitted it as #132

By the way how are build dependencies handled ? "vcpkg.exe install harfbuzz" fails if I don't build ragel before, and vcpkg doesn't attempt to build ragel automatically despite control file having "build-depends: ragel".

@ras0219-msft

This comment has been minimized.

Show comment
Hide comment
@ras0219-msft

ras0219-msft Oct 11, 2016

Contributor

I suspect we're doing a case-sensitive comparison. If you use Build-Depends, that should resolve the issue. If it doesn't, please open another issue to track that :).

I'll look into adding detection logic here and give you a better error message in the future.

Contributor

ras0219-msft commented Oct 11, 2016

I suspect we're doing a case-sensitive comparison. If you use Build-Depends, that should resolve the issue. If it doesn't, please open another issue to track that :).

I'll look into adding detection logic here and give you a better error message in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment