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

Pulled latest, vcpkg fails to build #1149

Closed
cugone opened this issue Jan 19, 2024 · 10 comments
Closed

Pulled latest, vcpkg fails to build #1149

cugone opened this issue Jan 19, 2024 · 10 comments

Comments

@cugone
Copy link
Contributor

cugone commented Jan 19, 2024

Pulling latest on master and attempting to build throws a bunch of vcpkg errors, (I pulled latest on vcpkg as well) :

Build started at 6:16 PM...
1>------ Build started: Project: NAS2D, Configuration: Debug Win32 ------
1>Installing vcpkg dependencies to E:\Git\nas2d-core_fork\vcpkg_installed\x86-windows\
1>"E:\Git\vcpkg\vcpkg.exe" install  --x-wait-for-lock --triplet "x86-windows" --vcpkg-root "E:\Git\vcpkg\\" "--x-manifest-root=E:\Git\nas2d-core_fork\\" "--x-install-root=E:\Git\nas2d-core_fork\vcpkg_installed\x86-windows\\"
1>Errors occurred while parsing E:\Git\nas2d-core_fork\vcpkg.json
1>    $ (vcpkg.json): expected a versioning field (example: version-string)
1>See https://github.com/Microsoft/vcpkg/tree/master/docs/users/manifests.md for more information.
1>E:\Git\vcpkg\scripts\buildsystems\msbuild\vcpkg.targets(183,5): error MSB3073: The command ""E:\Git\vcpkg\vcpkg.exe" install  --x-wait-for-lock --triplet "x86-windows" --vcpkg-root "E:\Git\vcpkg\\" "--x-manifest-root=E:\Git\nas2d-core_fork\\" "--x-install-root=E:\Git\nas2d-core_fork\vcpkg_installed\x86-windows\\" " exited with code 1.
1>Done building project "NAS2D.vcxproj" -- FAILED.
2>------ Build started: Project: test-graphics, Configuration: Debug Win32 ------
3>------ Build started: Project: test, Configuration: Debug Win32 ------
2>Installing vcpkg dependencies to E:\Git\nas2d-core_fork\vcpkg_installed\x86-windows\
2>"E:\Git\vcpkg\vcpkg.exe" install  --x-wait-for-lock --triplet "x86-windows" --vcpkg-root "E:\Git\vcpkg\\" "--x-manifest-root=E:\Git\nas2d-core_fork\\" "--x-install-root=E:\Git\nas2d-core_fork\vcpkg_installed\x86-windows\\"
3>Installing vcpkg dependencies to E:\Git\nas2d-core_fork\vcpkg_installed\x86-windows\
3>"E:\Git\vcpkg\vcpkg.exe" install  --x-wait-for-lock --triplet "x86-windows" --vcpkg-root "E:\Git\vcpkg\\" "--x-manifest-root=E:\Git\nas2d-core_fork\\" "--x-install-root=E:\Git\nas2d-core_fork\vcpkg_installed\x86-windows\\"
2>Errors occurred while parsing E:\Git\nas2d-core_fork\vcpkg.json
2>    $ (vcpkg.json): expected a versioning field (example: version-string)
2>See https://github.com/Microsoft/vcpkg/tree/master/docs/users/manifests.md for more information.
2>E:\Git\vcpkg\scripts\buildsystems\msbuild\vcpkg.targets(183,5): error MSB3073: The command ""E:\Git\vcpkg\vcpkg.exe" install  --x-wait-for-lock --triplet "x86-windows" --vcpkg-root "E:\Git\vcpkg\\" "--x-manifest-root=E:\Git\nas2d-core_fork\\" "--x-install-root=E:\Git\nas2d-core_fork\vcpkg_installed\x86-windows\\" " exited with code 1.
2>Done building project "test-graphics.vcxproj" -- FAILED.
3>Errors occurred while parsing E:\Git\nas2d-core_fork\vcpkg.json
3>    $ (vcpkg.json): expected a versioning field (example: version-string)
3>See https://github.com/Microsoft/vcpkg/tree/master/docs/users/manifests.md for more information.
3>E:\Git\vcpkg\scripts\buildsystems\msbuild\vcpkg.targets(183,5): error MSB3073: The command ""E:\Git\vcpkg\vcpkg.exe" install  --x-wait-for-lock --triplet "x86-windows" --vcpkg-root "E:\Git\vcpkg\\" "--x-manifest-root=E:\Git\nas2d-core_fork\\" "--x-install-root=E:\Git\nas2d-core_fork\vcpkg_installed\x86-windows\\" " exited with code 1.
3>Done building project "test.vcxproj" -- FAILED.
========== Build: 0 succeeded, 3 failed, 0 up-to-date, 0 skipped ==========
========== Build completed at 6:16 PM and took 00.771 seconds ==========

@cugone
Copy link
Contributor Author

cugone commented Jan 23, 2024

@DanRStevens

Adding this for context since the workflow dispatch seems to work but local compilation still fails.

Further investigation points to "missing versioning field". Adding "version": "1" below the name field "almost" works. It downloads cmake and 7zip but during the extraction of 7zip, vcpkg crashes. with:

"EXEC : error : vcpkg has crashed; no additional details are available."
The source line is C:\a\l\s\src\vcpkg\archive.cpp(94)

@DanRStevens DanRStevens pinned this issue Jan 23, 2024
@DanRStevens DanRStevens unpinned this issue Jan 23, 2024
@DanRStevens
Copy link
Collaborator

Thought I'd link to the documentation for vcpkg.json:
https://learn.microsoft.com/en-us/vcpkg/reference/vcpkg-json#version

Noticed this comment for the version field:

Required for libraries, optional for top-level projects.

@DanRStevens
Copy link
Collaborator

I'm curious if this is still an issue, or was a temporary problem as vcpkg went through version upgrades. It's not something that is reproduced on the CI builds.

@cugone
Copy link
Contributor Author

cugone commented Oct 30, 2024

Pulled latest on vcpkg and nas2d-core. Still doesn't work. Same issues.

@DanRStevens
Copy link
Collaborator

May be unrelated, though I noticed your logs showed a Win32 Debug build. The CI workflow only does Release builds.

Doing a CI run with Debug mode does show a failure for Win32 Debug. The error message doesn't match your logs though, so may be unrelated. Still, it is curious that one configuration failed.

https://github.com/lairworks/nas2d-core/actions/runs/11865258795/job/33070125347

NAS2D.lib(MathUtils.obj) : error LNK4075: ignoring '/EDITANDCONTINUE' due to '/SAFESEH' specification [D:\a\nas2d-core\nas2d-core\test\test.vcxproj]

Might be a good idea to check if the reported build failure applies to all configurations, or only that one configuration.

I don't have a working Windows VM right now, so the only easy way I have to test this is through the CI builds.

@cugone
Copy link
Contributor Author

cugone commented Nov 16, 2024

Just for completeness, Release builds (both x86 and x64) also fail immediately with the same errors.

@cugone
Copy link
Contributor Author

cugone commented Nov 18, 2024

The local build regardless of configuration is still broken with same vcpkg errors, but a new symptom popped up: The Github actions for linux/unix builds actually ran but failed after 2 minutes because they could not find a remote branch named "main".

@DanRStevens
Copy link
Collaborator

DanRStevens commented Nov 19, 2024

I just took a look at your fork:
https://github.com/cugone/nas2d-core

I see the build failure:
https://github.com/cugone/nas2d-core/actions/runs/11885797690/job/33116015919

Starting job container
/usr/bin/docker --config /home/runner/work/_temp/.docker_b72ab8fa-e737-4512-81e5-b1c96c2cf77f login ghcr.io -u cugone --password-stdin
/usr/bin/docker --config /home/runner/work/_temp/.docker_b72ab8fa-e737-4512-81e5-b1c96c2cf77f pull ghcr.io/cugone/build-env-nas2d-arch:1.5
Error response from daemon: manifest unknown

That error is likely related to recent work for:

In particular, the changes that moved the Docker image from DockerHub to the GitHub registry:

-     image: "outpostuniverse/${{ matrix.image }}"
+     image: "ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}"

Note the ${{ github.repository_owner }}. That means a forked repo will look for the Docker image from it's own repo. That allows you to use your own custom build images, though it does mean you'd need to build them yourself. There is a second workflow .github/workflows/buildDockerBuildEnv.yml used to build and push Docker images. It also uses ${{ github.repository_owner }}, so you should be able to run it to build and push an image to your own GitHub Docker registry.


Edit: Oh, I see that workflow also tried to run, and also failed:
https://github.com/cugone/nas2d-core/actions/runs/11885797689/job/33116015458

Run git remote set-branches --add origin main
git remote set-branches --add origin main
git fetch --depth 1
shell: /usr/bin/bash -e {0}
fatal: couldn't find remote ref refs/heads/main

I'll take a look. Should maybe move this discussion to the other issue.

Edit: Oh, got it. Your fork still uses master as the default branch name, while the original repo changed to use main as the default branch name. GitHub started changing their default branch name from master to main for new repos. I updated some of the repos to match, so there would be consistency between new and old projects.

@DanRStevens
Copy link
Collaborator

Is it possible that you updated your vcpkg ports tree by running a git pull, and never ran a corresponding bootstrap-vcpkg to rebuild for the updated source? That would have the potential to give strange errors as you can end up with newer versions of the ports tree being used by an older version of the executable. I saw an issue for an error related to parsing vcpkg.json because of that recently.

It may help to check the output of vcpkg --version, and compare it to the head commit of your vcpkg repo which you have at E:\Git\vcpkg\. It might also help to take a look at the date on the vcpkg binary in that folder.

On the off chance that is the problem, you'll see an older version before running bootstrap-vcpkg than after running it.

@DanRStevens
Copy link
Collaborator

I don't think there's anything further we can do on this issue. At least not without additional feedback to understand the problem. There were some suggestions above, but no clear results. We've been unable to reproduce this on CI, and none of the Windows developers have had a similar issue. I suspect it may have been an oddity of some local setup, which we don't have the details to. As such I'm going to close this issue.

If the problem persists, and more details can be given, then we can re-open and revisit. I would be curious to learn what the root cause of the problem was.

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

No branches or pull requests

2 participants