vcpkg
vcpkg copied to clipboard
vcpkg_configure_make seems to ignore SKIP_CONFIGURE
Describe the bug
Calling vcpkg_configure_make
with SKIP_CONFIGURE
fails with:
CMake Error at scripts/cmake/vcpkg_configure_make.cmake:196 (message):
Could not determine method to configure make
Environment
- OS: Ubuntu 20.04.1 LTS on Windows 10 x86_64
- Cmake: 3.16.3
To Reproduce
I couldn't find any ports that actually use the option, but it can be reproduced with a minimal portfile.cmake
(I've setup a GitHub repository with the code and I'm using vcpkg_from_github
to download it):
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO ianichitei/test
REF c2b1eafd43d66099fdfd27a634d75020a216ca7b
SHA512 807132f7132fdb6418b72f016b55989d99b02a26a69e58918f037805c1550c12a9c63d1b606ffc3f9d5d00e27096c217acea6a38eb7432adc0593300505f1f28
HEAD_REF master
)
vcpkg_configure_make(
SOURCE_PATH ${SOURCE_PATH}
SKIP_CONFIGURE
)
With this added to ports/test
it can be reproduced by running ./vcpkg install test
, full output below:
$ ./vcpkg install test
Computing installation plan...
The following packages will be built and installed:
test[core]:x64-linux
Detecting compiler hash for triplet x64-linux...
Starting package 1/1: test:x64-linux
Building package test[core]:x64-linux...
Could not locate cached archive: /home/ianichitei-lx/.cache/vcpkg/archives/48/48d81d0fa04e5266d6f5ed6f84525206e124f875.zip
-- Using cached /mnt/c/work/public/vcpkg/downloads/ianichitei-test-c2b1eafd43d66099fdfd27a634d75020a216ca7b.tar.gz
-- Cleaning sources at /mnt/c/work/public/vcpkg/buildtrees/test/src/20a216ca7b-d186164bf6.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source /mnt/c/work/public/vcpkg/downloads/ianichitei-test-c2b1eafd43d66099fdfd27a634d75020a216ca7b.tar.gz
-- Using source at /mnt/c/work/public/vcpkg/buildtrees/test/src/20a216ca7b-d186164bf6.clean
CMake Error at scripts/cmake/vcpkg_configure_make.cmake:196 (message):
Could not determine method to configure make
Call Stack (most recent call first):
ports/test/portfile.cmake:9 (vcpkg_configure_make)
scripts/ports.cmake:135 (include)
Error: Building package test:x64-linux failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `./vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
Package: test:x64-linux
Vcpkg version: 2020.06.15-unknownhash
Additionally, attach any relevant sections from the log files above.
Expected behavior
vcpkg_configure_make
should succeed and no errors should be reported.
Failure logs
No log files were generated.
Additional context
I'm fairly new to vcpkg and I want to write a portfile for a codebase that is using makefiles without autoconf
or other similar tools. Initially I was using an older version of vcpkg (from commit 458c20e94b9) and it was working as intended.
I was debating if this would have been better suited as a question, but since it was working with an older version I decided to post it as a bug report.
Can you provide a full port folder?
Thanks.
Can you provide a full port folder?
Thanks.
Sorry about that. I wasn't sure what would be the best way of doing that. Forking vcpkg just for this seemed a bit too much, but I can do that if it helps. Is a diff useful in this case?
diff --git a/ports/test/CONTROL b/ports/test/CONTROL
new file mode 100644
index 000000000..55f8d6eb2
--- /dev/null
+++ b/ports/test/CONTROL
@@ -0,0 +1,3 @@
+Source: test
+Version: 0.0.1
+Description: Just a test.
\ No newline at end of file
diff --git a/ports/test/LICENSE b/ports/test/LICENSE
new file mode 100644
index 000000000..6b3bbd057
--- /dev/null
+++ b/ports/test/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2020 Anichitei Ionel-Cristinel
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/ports/test/portfile.cmake b/ports/test/portfile.cmake
new file mode 100644
index 000000000..e849f543a
--- /dev/null
+++ b/ports/test/portfile.cmake
@@ -0,0 +1,14 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO ianichitei/test
+ REF c2b1eafd43d66099fdfd27a634d75020a216ca7b
+ SHA512 807132f7132fdb6418b72f016b55989d99b02a26a69e58918f037805c1550c12a9c63d1b606ffc3f9d5d00e27096c217acea6a38eb7432adc0593300505f1f28
+ HEAD_REF master
+ )
+
+vcpkg_configure_make(
+ SOURCE_PATH ${SOURCE_PATH}
+ SKIP_CONFIGURE
+ )
+
+vcpkg_install_make(BUILD_TARGET all)
@ianichitei enough, thanks!
Any news on this? Is ther a way to make it work in the mean time?
Running into the same issue. Using latest vcpkg.
Yes. SKIP_CONFIGURE
is not used when both confgure
and configure.ac
are present:
https://github.com/microsoft/vcpkg/blob/9f04533f307a8560cc1cc5c1fdee0d88d6d7d818/scripts/cmake/vcpkg_configure_make.cmake#L247-L253
@dg0yt SKIP_CONFIGURE
temporary can't be used now.
@dg0yt
SKIP_CONFIGURE
temporary can't be used now.
"Can't be used" == "defect"
Hi!
I too am in the process of making a port for a public GitHub project for which there's no port-file already, and which uses a Makefile to build, but with no configure step.
The GitHug project is Sparkle: https://github.com/sparkle-project/Sparkle
By adapting the instructions here, I've created the required directory structure, and portfile.cmake for sparkle, which currently is as follows:
`vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO sparkle-project/Sparkle REF 2.2.1 SHA512 ab2eff3224136a606df87d161399669405bc46b30e28ec7f49ac1e33d3a3e42ed0439f8d3e39a684446878555746302ff44cbab8e8a787b84ee149e42efdf6ec HEAD_REF master )
vcpkg_configure_make(SOURCE_PATH "${SOURCE_PATH}" SKIP_CONFIGURE)
vcpkg_build_make() # vcpkg_build_make(SOURCE_PATH) vcpkg_fixup_pkgconfig() `
Running however results in the following:
$ ./submodules/vcpkg/vcpkg install --overlay-ports=../vcpkg-registry/ports/sparkle
**_CMake Error at scripts/cmake/vcpkg_configure_make.cmake:161 (message):
Could not determine method to configure make_**
Am I correct to assume that I've done what I should, and have run into this SKIP_CONFIGURE bug?
I see from reading these issues: https://github.com/microsoft/vcpkg/pull/14402 https://github.com/microsoft/vcpkg/pull/15495
That I should "copy the source code" as a workaround, but the latter, which implements 'vcpkg_copy_source', has not been merged AND is now closed.
Any advice going forward? I expect the bug is indeed the same as OP's, since the issue is open. What workaround would you recommend? I'm not sure how I would "copy the source" myself, and would in that case be greatful for a pointer!
Thank you!
I've gotten as far as copying the files myself, into the directories needed via CMake's copy functionality, but then those target folders are emptied an re-created:
OUT_SOURCE_PATH SOURCE_PATH
REPO sparkle-project/Sparkle
REF 2.2.1
SHA512 ab2eff3224136a606df87d161399669405bc46b30e28ec7f49ac1e33d3a3e42ed0439f8d3e39a684446878555746302ff44cbab8e8a787b84ee149e42efdf6ec
HEAD_REF master
)
foreach(BUILDTYPE "debug" "release")
if(BUILDTYPE STREQUAL "debug")
set(SHORT_BUILDTYPE "-dbg")
set(CMAKE_BUILDTYPE "DEBUG")
set(PATH_SUFFIX "/debug")
else()
if (_VCPKG_NO_DEBUG)
set(SHORT_BUILDTYPE "")
else()
set(SHORT_BUILDTYPE "-rel")
endif()
set(CMAKE_BUILDTYPE "RELEASE")
set(PATH_SUFFIX "")
endif()
set(WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}${SHORT_BUILDTYPE}")
if (NOT EXISTS "${WORKING_DIRECTORY}")
file(MAKE_DIRECTORY "${WORKING_DIRECTORY}")
endif()
message(STATUS "Sourcepath: ${SOURCE_PATH}")
message(STATUS "Destination: ${WORKING_DIRECTORY}")
file(COPY ${SOURCE_PATH} DESTINATION ${WORKING_DIRECTORY})
endforeach()
vcpkg_build_make()
vcpkg_fixup_pkgconfig()
The files are copied properly into the working directory (/submodules/vcpkg/buildtrees/sparkle/x64-osx-dbg/), but then vcpkg_build_make() promptly empties that directory before trying to run make.