Vcpkg: Cannot build openssl on Linux

Created on 2 Aug 2018  Â·  6Comments  Â·  Source: microsoft/vcpkg

Running:

vcpkg install openssl

fails for me with this error in the log:

/bin/sh: cp: command not found

The problem is that the build script manages to do this:

export "PATH=/usr/bin:<skipped>:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin;/usr/bin"

Note the semi-colon in the path, right after :/bin. That tells the shell to search for binaries in /bin;/usr/bin a directory that does not exist. I cannot figure out what exactly is doing that, but maybe it is obvious to the maintainers.

I can workaround the problem by running:

PATH=$PATH:/dummy vcpkg install openssl
port-bug

Most helpful comment

@ras0219-msft
The problem is in vcpkg_configure_cmake.cmake.

问题在 vcpkg_configure_cmake.cmake。

    # If we use Ninja, make sure it's on PATH
    if(GENERATOR STREQUAL "Ninja")
        vcpkg_find_acquire_program(NINJA)
        get_filename_component(NINJA_PATH ${NINJA} DIRECTORY)
        set(ENV{PATH} "$ENV{PATH};${NINJA_PATH}")
        list(APPEND _csc_OPTIONS "-DCMAKE_MAKE_PROGRAM=${NINJA}")
    endif()

All 6 comments

Thanks for letting us know about this issue; I believe I have a fix in dev/roschuma/4001.

Could you let me know if that resolves the problem?

Unfortunately it does not seem to (I might have bade a mistake checking out the branch or something).

I am attaching a Dockerfile.txt that should help you repro the problem on demand.

@ras0219-msft
The problem is in vcpkg_configure_cmake.cmake.

问题在 vcpkg_configure_cmake.cmake。

    # If we use Ninja, make sure it's on PATH
    if(GENERATOR STREQUAL "Ninja")
        vcpkg_find_acquire_program(NINJA)
        get_filename_component(NINJA_PATH ${NINJA} DIRECTORY)
        set(ENV{PATH} "$ENV{PATH};${NINJA_PATH}")
        list(APPEND _csc_OPTIONS "-DCMAKE_MAKE_PROGRAM=${NINJA}")
    endif()

@icedream2linxi Thanks a bunch for the pointer!

@coryan I've grep'd for all uses of $ENV{PATH} and pushed fixes for all of them to dev/roschuma/4001. I'll try to get docker set up soon, but if you get a chance first could you try it out?

Just finished building using the Dockerfile from above. It built cleanly, on the first try. Nice.

💃 Pushed to master. Thanks for letting us know and providing a really solid description of the issue!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jack17529 picture jack17529  Â·  3Comments

aspioupiou picture aspioupiou  Â·  3Comments

madkoala picture madkoala  Â·  3Comments

cskrisz picture cskrisz  Â·  3Comments

spindensity picture spindensity  Â·  3Comments