microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
23.33k stars 6.45k forks source link

vcpkg unable to find yasm.exe #10523

Closed ghost closed 4 years ago

ghost commented 4 years ago

Describe the bug vcpkg unable to find yasm.exe within the msbuild process, even though vcpkg downloads yasm.exe and installs it in vcpkg-root/downloads/tools/yasm/1.3.0.6/yasm.exe

Environment

To Reproduce Steps to reproduce the behavior:

  1. On a clean create instance of vcpkg
  2. ./vcpkg install xxxx where xxxx is package using msbuild - so far I have found mpg123 and libvpx
  3. Error is "yasm.exe" is not found or an executable file

Expected behavior vcpkg should be able to find its tools...

Failure logs

Additional context I found a workaround by creating a symlink as follows:

MVoz commented 4 years ago

@timautry as a temporary option, it helped me https://github.com/microsoft/vcpkg/issues/9553#issuecomment-602040082

ghost commented 4 years ago

@Voskrese - thank you, but what I did is basically the same thing but without creating multiple copies of the same binary. In my opinion, the link is a better solution as when the yasm.exe is updated in the tools\yasm folder/directory it will break the link from the Visual Studio tool folder, thus requiring me to recreate the link to use the new version. By copying the binary, one could forget to copy the new binary to the Visual Studio tool folder where one keeps using an older outdated version and possibly causing all kinds of issues. Just a habit from the years I worked on Unix systems, create links instead of copies. Cuts down on maintenance, disk space, backup times, mistakes, etc...

DanRStevens commented 4 years ago

I was bitten by this recently when I tried to install sdl2-mixer (with support for extra audio formats), which depends on mpg123.

vcpkg install sdl2-mixer[core,libflac,mpg123,libmodplug,libvorbis,opusfile]

Installation fails because mpg123 can't find yasm.

From the log file:

'yasm' is not recognized as an internal or external command, operable program or batch file.

kevinlul commented 4 years ago

This occurs for me too, but only on fresh installs on CI and not locally https://github.com/kevinlul/edopro-vcpkg-cache/runs/540903996

Ghabry commented 4 years ago

Have the same problem in a CI system when doing an initial deployment on a machine through jenkins (empty workspace). Last time this worked for me was in December, could try to bisect this.

The mklink workaround works for me, but I used yasm.exe from chocolatey because the path stays constant. vcpkg seems to wipe the PATH variable because I tested before with yaml in my PATH but msbuild still failed 🤔

EDIT: I can't reproduce this locally, only during CI build. So this is hard to bisect and a bit strange because Jenkins just spawns a CMD shell and behaves like a local session o.O

mcmtroffaes commented 4 years ago

Seeing the same issue on appveyor when building libvpx. See for instance:

https://ci.appveyor.com/project/mcmtroffaes/ffmpeg-msvc-build/builds/32301545/job/a0rpe639rcmgrhn7

Log file: build-x86-windows-static-md-v142-rel-out.log

kevinlul commented 4 years ago

Seems to be resolved with #10952

JackBoosY commented 4 years ago

Hi guys, since #10952 merged, is this issue resolved?

DanRStevens commented 4 years ago

Doesn't seem to be resolved for me.

ghost commented 4 years ago

@JackBoosY It is fixed now with #10952 for my test systems using VS2017 and VS2019. Thanks for the quick turn-around and hard work.

@DanRStevens post the screen and/or error logs and the group can take a look at what may be still causing the issue.

DanRStevens commented 4 years ago

Ahh, my bad. I had two copies of vcpkg and had updated the wrong one. It does work now.