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

Action does not work without run-vcpkg with no vcpkg.json #142

Open
LecrisUT opened this issue Jun 24, 2024 · 4 comments
Open

Action does not work without run-vcpkg with no vcpkg.json #142

LecrisUT opened this issue Jun 24, 2024 · 4 comments

Comments

@LecrisUT
Copy link

LecrisUT commented Jun 24, 2024

I have encountered this issue in: https://github.com/spglib/spglib/actions/runs/9647881847/job/26607773265

I was trying to update run-cmake to v10, but on windoes-latest (related to the fix in v10.6) I get an error of:

error: Could not locate a manifest (vcpkg.json) above the current working directory.
This vcpkg distribution does not have a classic mode instance.

    at Object.<anonymous> (D:\a\_actions\lukka\run-cmake\v10\dist\index.js:6984:23)
    at Generator.next (<anonymous>)
    at fulfilled (D:\a\_actions\lukka\run-cmake\v10\dist\index.js:6942:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Error: run-cmake action execution failed: 'Error: vcpkg failed with: 

error: Could not locate a manifest (vcpkg.json) above the current working directory.
This vcpkg distribution does not have a classic mode instance.
'
Error: The step failed and an error occurred when attempting to determine whether to continue on error.
Error: The template is not valid. spglib/spglib/.github/workflows/step_test.yaml@2e8efab81cdff5825fddad6c5c3d35c127aa08db (Line: 75, Col: 28): Unexpected value ''

The project does not have any vcpkg.json yet as I am still thinking on how to package this. Any possibilities to make it fallback when no vcpkg.json is found?

@lukka
Copy link
Owner

lukka commented Jun 25, 2024

@LecrisUT this should be a regression introduced recently in vcpkg, you may find out if you try using an older version of vpkg: it would be super helpful if you can identify in which version this occurred.

To work around this, you may try removing VCPKG_ROOT entry from the env variables, e.g. like

uses: run-cmake
env:
  VCPKG_ROOT:

That way run-cmake does not attempt to set up the environment using the vcpkg env command (see the last block at the bottom of the flowchart).

@LecrisUT
Copy link
Author

That might be difficult because I can't run run-vcpkg because I don't have a vcpkg.json. What I was considering is to have a try...catch around the first vcpkg command and if the error message contains "Could not locate a manifest" or has an equivalent exit code, than move on aa if there is no vcpkg support. Afaiu the only check is at VCPKG_ROOT, but maybe an additional check or even a glob check for **/vcpkg.json would be helpful here.

mywave82 added a commit to henricj/libbinio that referenced this issue Jul 9, 2024
mywave82 added a commit to henricj/libbinio that referenced this issue Jul 9, 2024
mywave82 added a commit to henricj/libbinio that referenced this issue Jul 12, 2024
mywave82 added a commit to adplug/libbinio that referenced this issue Jul 12, 2024
mywave82 added a commit to henricj/adplug that referenced this issue Jul 13, 2024
@lukka
Copy link
Owner

lukka commented Sep 10, 2024

@LecrisUT I am afraid I was not clear enough. In your case, the error is happening because run-cmake, since it detects your Windows environment has VCPKG_ROOT env var set, it is trying to setup the environment for MSVC by using the command vcpkg env. What I am suggesting is that you can suppress this behavior by removing the definition of VCPKG_ROOT env var (only for the run-cmake the VCPKG_ROOT is going to be removed, it will stay there for the rest of the workflow).

OTOH, the run-cmake action should not fatally fail on such occasion, but should just print a warning and proceed forward. Probably there are other sensible solutions too, open to feedback.

@LecrisUT
Copy link
Author

OTOH, the run-cmake action should not fatally fail on such occasion, but should just print a warning and proceed forward. Probably there are other sensible solutions too, open to feedback.

This is basically my thought on the issue. If vcpkg was intended to be used but not used, there would be other helpful error messages afterwards, so this restriction can be relaxed. And iirc users can also suppress warning messages in their workflow, so it wouldn't be much disadvantage.

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