ilammy / msvc-dev-cmd

GitHub Action to setup Developer Command Prompt for Microsoft Visual C++
MIT License
338 stars 49 forks source link

VCINSTALLDIR not exported #22

Closed scamille closed 3 years ago

scamille commented 3 years ago

I am currently trying to get windeployqt.exe from the Qt framework working properly so that it copies the Visual Studio vc_redist files. The problem occurs on our CI setup, but not when executed locally.

After enabling verbose output there, I noticed the message Warning: Cannot find Visual Studio installation directory, VCINSTALLDIR is not set. , and after searching about it I think this is the reason why it is not working.

Looking at https://github.com/ilammy/msvc-dev-cmd/blob/master/index.js#L14 I see that VCINSTALLDIR is not included in InterestingVariables and thus not exported. Would it be ok to include VCINSTALLDIR there?

Let me know if I should just create a pull request for that.

ilammy commented 3 years ago

Would it be ok to include VCINSTALLDIR there?

Yes, that would totally be okay! 👍

That list is manually composed from variables that might be useful to build systems. If you need that one, feel free to make a PR. I'll gladly merge it and publish an update.

ilammy commented 3 years ago

Now that #23 has been merged, could you please check that it works for you? You can try the master branch like this:

- uses: ilammy/msvc-dev-cmd@master

If it works, I'll cut a release with that change in it so that a more stable v1 gets it too.

scamille commented 3 years ago

Ok, I'll try it and report back.

scamille commented 3 years ago

I get a error when running from master, see https://github.com/simulationcraft/simc-publish/runs/1536041372?check_suite_focus=true


Run ilammy/msvc-dev-cmd@master
internal/modules/cjs/loader.js:800
    throw err;
    ^

Error: Cannot find module '@actions/core'
Require stack:
- D:\a\_actions\ilammy\msvc-dev-cmd\master\index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
    at Function.Module._load (internal/modules/cjs/loader.js:690:27)
    at Module.require (internal/modules/cjs/loader.js:852:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (D:\a\_actions\ilammy\msvc-dev-cmd\master\index.js:1:14)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ 'D:\\a\\_actions\\ilammy\\msvc-dev-cmd\\master\\index.js' ]
}
ilammy commented 3 years ago

Damn, I constantly forget about this. GitHub Actions tutorials strongly suggested against committing Node.js deps into development branches, but it's so annoying to not be able to test it that way.

@scamille, could you please try again? Now it should be workable, I hope 🤞

scamille commented 3 years ago

Ok it worked perfectly in https://github.com/simulationcraft/simc-publish/actions/runs/415844010 windeployqt.exe seems to have picked up VCINSTALLDIR, and our finished bundle now contains the vc_redist.x64/x86.exe so that those pesky users lacking it can install it, and we officially distribute all required files 👍

Thanks for your support and quick responses.

ilammy commented 3 years ago

Alrighty. This has been properly published as msvc-dev-cmd@v1.5.0 and msvc-dev-cmd@v1.