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

[protobuf] Build error: "ninja: error: mkdir".... #23462

Closed
Sand2Silicon opened this issue Mar 9, 2022 · 5 comments
Closed

[protobuf] Build error: "ninja: error: mkdir".... #23462

Sand2Silicon opened this issue Mar 9, 2022 · 5 comments
Assignees
Labels
category:question This issue is a question info:manifests This PR or Issue pertains to the Manifests feature

Comments

@Sand2Silicon
Copy link

Sand2Silicon commented Mar 9, 2022

Host Environment

  • OS: Windows 10 Pro
  • Compiler: Visual Studio 2019

Steps to reproduce the behavior:
Running in VCPkg Manifest mode, to install Protobuf and GRPC. Logs report the exact command that produced the error is this. I pasted this to the (Powershell)command line and got the same Ninja error.

vcpkg/downloads/tools/cmake-3.22.2-windows/cmake-3.22.2-windows-i386/bin/cmake.exe --build . --config Debug --target install -- -v -j45

Failure logs

-- Using cached protocolbuffers-protobuf-v3.18.0.tar.gz.
-- Cleaning sources at C:/source/project-main/src/FooModule/ExternalDependencies/vcpkg/buildtrees/protobuf/src/v3.18.0-44e21376af.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source C:/source/project-main/src/FooModule/ExternalDependencies/vcpkg/downloads/protocolbuffers-protobuf-v3.18.0.tar.gz
-- Applying patch fix-static-build.patch
-- Applying patch fix-default-proto-file-path.patch
-- Applying patch fix-uwp-build.patch
-- Using source at C:/source/project-main/src/FooModule/ExternalDependencies/vcpkg/buildtrees/protobuf/src/v3.18.0-44e21376af.clean
-- Configuring x64-windows-static
-- Building x64-windows-static-dbg
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:158 (message):
    Command failed: C:/source/project-main/src/FooModule/ExternalDependencies/vcpkg/downloads/tools/cmake-3.22.2-windows/cmake-3.22.2-windows-i386/bin/cmake.exe --build . --config Debug --target install -- -v -j45
    Working Directory: C:/source/project-main/src/FooModule/ExternalDependencies/vcpkg/buildtrees/protobuf/x64-windows-static-dbg
    See logs for more information:
      C:\source\project-main\src\FooModule\ExternalDependencies\vcpkg\buildtrees\protobuf\install-x64-windows-static-dbg-out.log
      C:\source\project-main\src\FooModule\ExternalDependencies\vcpkg\buildtrees\protobuf\install-x64-windows-static-dbg-err.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_build_cmake.cmake:106 (vcpkg_execute_build_process)
  scripts/cmake/vcpkg_install_cmake.cmake:44 (vcpkg_build_cmake)
  buildtrees/versioning_/versions/protobuf/19c2bf45c235e6126161bae36aa7ff7e1fcda479/portfile.cmake:47 (vcpkg_install_cmake)
  scripts/ports.cmake:145 (include)
Error: Building package protobuf:x64-windows-static failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `git pull` and `.\vcpkg update`.
Then check for known issues at:
  https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+protobuf
You can submit a new issue at:
  https://github.com/microsoft/vcpkg/issues/new?template=report-package-build-failure.md&title=[protobuf]+Build+error
including:
  package: protobuf[core,zlib]:x64-windows-static -> 3.18.0
    vcpkg-tool version: 2022-03-08-85dc3d9d4e1e7b643f811eac0b9d884419fead79
    vcpkg-scripts version: 857bccdad 2022-03-08 (16 hours ago)

Additionally, attach any relevant sections from the log files above.
ninja: error: mkdir(CMakeFiles/libprotobuf-lite.dir/C_/source/project-main/src/FooModule/ExternalDependencies): No such file or directory

Additional context
The overall project is CMake driven, and is using VCPkg in manifest mode (there is a vcpkg.json, alongside the top-level CMakeLists.txt) to pull in GRPC and Protobuf automatically.

{
    "name": "ourproject",
    "version":  "0.2",
    "dependencies": [
        {
            "name": "protobuf",
            "default-features": true,
            "features": [ "zlib" ]
        },
        {
            "name": "grpc",
            "default-features": true,
            "features": [ "codegen" ]
        }
    ],
    "builtin-baseline": "4ffe8b020f04c3acbd5883566672c19a022c4394",
    "overrides": [
        {
            "name": "protobuf",
            "version": "3.18.0"
        },
        {
            "name": "grpc",
            "version-string": "1.41.0"            
        }
    ]
}

To my knowledge this was working last week, possibly earlier this week; then today I did a fresh checkout from our version-control, kicked off CMake, and after VCPkg installed itself(*), it failed during the Protobuf build/install.

(*)That is to say our setup.bat that I actually run does a lot, including checking for .\ExternalDependencies\vcpkg, and if needed running git clone clone https://github.com/Microsoft/vcpkg.git, followed by the vcpkg\bootstrap-vcpkg.bat, and ultimately kicking off CMake with the appropriate arguments.

@LilyWangLL LilyWangLL added info:manifests This PR or Issue pertains to the Manifests feature requires:repro The issue is not currently repro-able labels Mar 10, 2022
@LilyWangLL
Copy link
Contributor

Thanks for posting this issue. Maybe PR #23410 and #23411 can fix this issue. There two PRs fix find moudle on CMake. I test this locally, and I can installed protobuf and grpc succeed. Could you update VCPKG and try again?

@LilyWangLL
Copy link
Contributor

Ping @Sand2Silicon for response.

@Sand2Silicon
Copy link
Author

Sand2Silicon commented Mar 14, 2022

I do not believe #23410 is involved as we hit the corresponding bug #23402 and then saw it resolved before encountering this issue.

I just re-ran this and it it succeeded with warning. Not sure if the warnings are related to the issue I was reporting. Total time was 15min 53 seconds for 18 packages, based on the manifest above requesting GRPC and Protobuf; much longer than usual, so I think everything in the /appdata/ cache got updated. The specific warnings in the logs are:

Starting package 8/18: openssl:x64-windows-static
Building package openssl[core]:x64-windows-static...
-- Installing port from location: C:\source\project-main\ExternalDependencies\vcpkg\buildtrees\versioning_\versions\openssl\d25384246619019a1e44f018546cdfcaf1800174
-- Downloading https://www.openssl.org/source/openssl-1.1.1l.tar.gz;https://www.openssl.org/source/old/1.1.1/openssl-1.1.1l.tar.gz -> openssl-1.1.1l.tar.gz...
-- Downloading https://strawberryperl.com/download/5.32.1.1/strawberry-perl-5.32.1.1-32bit.zip -> strawberry-perl-5.32.1.1-32bit.zip...
CMake Warning at scripts/cmake/vcpkg_fail_port_install.cmake:45 (message):
  vcpkg_fail_port_install has been removed and all values should be moved by
  adding `supports` field to manifest file or directly adding `openssl:=fail`
  to _scripts/ci.baseline.txt_.

  Please remove `vcpkg_fail_port_install(...)`.

Call Stack (most recent call first):
  buildtrees/versioning_/versions/openssl/d25384246619019a1e44f018546cdfcaf1800174/windows/portfile.cmake:1 (vcpkg_fail_port_install)
  buildtrees/versioning_/versions/openssl/d25384246619019a1e44f018546cdfcaf1800174/portfile.cmake:20 (include)
  scripts/ports.cmake:145 (include)
  
  
----------------------
  Starting package 12/18: openssl:x64-windows
Building package openssl[core]:x64-windows...
-- Installing port from location: C:\source\project-main\ExternalDependencies\vcpkg\buildtrees\versioning_\versions\openssl\d25384246619019a1e44f018546cdfcaf1800174
-- Using cached openssl-1.1.1l.tar.gz.
CMake Warning at scripts/cmake/vcpkg_fail_port_install.cmake:45 (message):
  vcpkg_fail_port_install has been removed and all values should be moved by
  adding `supports` field to manifest file or directly adding `openssl:=fail`
  to _scripts/ci.baseline.txt_.

  Please remove `vcpkg_fail_port_install(...)`.

Call Stack (most recent call first):
  buildtrees/versioning_/versions/openssl/d25384246619019a1e44f018546cdfcaf1800174/windows/portfile.cmake:1 (vcpkg_fail_port_install)
  buildtrees/versioning_/versions/openssl/d25384246619019a1e44f018546cdfcaf1800174/portfile.cmake:20 (include)
  scripts/ports.cmake:145 (include)


----------------------
Starting package 13/18: c-ares:x64-windows
Building package c-ares[core]:x64-windows...
-- Installing port from location: C:\source\project-main\ExternalDependencies\vcpkg\buildtrees\versioning_\versions\c-ares\d434c999ea00b87bfbee3d79ddc6fc1b6f12d7fe
CMake Warning at scripts/cmake/vcpkg_fail_port_install.cmake:45 (message):
  vcpkg_fail_port_install has been removed and all values should be moved by
  adding `supports` field to manifest file or directly adding `c-ares:=fail`
  to _scripts/ci.baseline.txt_.

  Please remove `vcpkg_fail_port_install(...)`.

Call Stack (most recent call first):
  buildtrees/versioning_/versions/c-ares/d434c999ea00b87bfbee3d79ddc6fc1b6f12d7fe/portfile.cmake:1 (vcpkg_fail_port_install)
  scripts/ports.cmake:145 (include)
  
  
----------------------  
Starting package 16/18: c-ares:x64-windows-static
Building package c-ares[core]:x64-windows-static...
-- Installing port from location: C:\source\project-main\ExternalDependencies\vcpkg\buildtrees\versioning_\versions\c-ares\d434c999ea00b87bfbee3d79ddc6fc1b6f12d7fe
CMake Warning at scripts/cmake/vcpkg_fail_port_install.cmake:45 (message):
  vcpkg_fail_port_install has been removed and all values should be moved by
  adding `supports` field to manifest file or directly adding `c-ares:=fail`
  to _scripts/ci.baseline.txt_.

  Please remove `vcpkg_fail_port_install(...)`.

Call Stack (most recent call first):
  buildtrees/versioning_/versions/c-ares/d434c999ea00b87bfbee3d79ddc6fc1b6f12d7fe/portfile.cmake:1 (vcpkg_fail_port_install)
  scripts/ports.cmake:145 (include)

[edit]
PS. I just noticed that running vcpkg list in the directory containing the manifest vcpkg.json now returns an error. I'm not sure when that changed, is it intentional? It used to list the "installed packages" relevant to this project.

vcpkg list
No packages are installed. Did you mean `search`?

@LilyWangLL LilyWangLL added category:question This issue is a question and removed requires:repro The issue is not currently repro-able labels Mar 15, 2022
@LilyWangLL
Copy link
Contributor

This warning is not related with your project, it just remind the deprecated function vcpkg_fail_port_install. And I think manifest doesn't support use ./vcpkg list, this command only can check the ports which installed in vcpkg directory, but manifest mode installed port to vcpkg_installed directory. And when you build your project, the dependency ports in vcpkg.json will install again exery time.

@LilyWangLL
Copy link
Contributor

We hope your question was answered to your satisfaction; if it wasn't, you can reopen with more info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:question This issue is a question info:manifests This PR or Issue pertains to the Manifests feature
Projects
None yet
Development

No branches or pull requests

2 participants