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

wrong parsing paths in configurePresetAdditionalArgs on Windows CI #106

Open
q4a opened this issue Apr 12, 2023 · 2 comments
Open

wrong parsing paths in configurePresetAdditionalArgs on Windows CI #106

q4a opened this issue Apr 12, 2023 · 2 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@q4a
Copy link

q4a commented Apr 12, 2023

If I want to pass

configurePresetAdditionalArgs: "[ '-DD3D9_INCLUDE_DIR=${{ github.workspace }}/cache/Include' ]"

I'll get good enough string in github gui log:

Run lukka/run-cmake@v10
  with:
    cmakeListsTxtPath: D:\a\nine-tests\nine-tests/NineTests/CMakeLists.txt
    configurePreset: default
    configurePresetAdditionalArgs: ['-DD3D9_INCLUDE_DIR=D:\a\nine-tests\nine-tests/cache/Include']

But in raw log I'll see broken/splites lines and build will fail:

2023-04-12T08:47:12.2545415Z Running command '"C:\Program Files\CMake\bin\cmake.exe"' with args '^"--preset^",^"default^",^"-DD3D9_INCLUDE_DIR=D:a
2023-04-12T08:47:12.2545798Z ine-tests
2023-04-12T08:47:12.2546177Z ine-tests/cache/Include^

Full log here: build-log.txt

I also tried different variants of quotation marks:

configurePresetAdditionalArgs: "[ '-DD3D9_INCLUDE_DIR=${{ github.workspace }}/cache/Include' ]"
configurePresetAdditionalArgs: "[ `-DD3D9_INCLUDE_DIR=${{ github.workspace }}/cache/Include` ]"
configurePresetAdditionalArgs: '[ "-DD3D9_INCLUDE_DIR=${{ github.workspace }}/cache/Include" ]`
configurePresetAdditionalArgs: '[ `-DD3D9_INCLUDE_DIR="${{ github.workspace }}/cache/Include"` ]'

But got same problem.

Here is example:
https://github.com/q4a/nine-tests/blob/cc0e8b9c12031a44991c11bbb48bbd3b7b8d6d5f/.github/workflows/ci_windows.yml#L37
Gui build log:
https://github.com/q4a/nine-tests/actions/runs/4676508343/jobs/8282902807
Raw build log:
https://github.com/q4a/nine-tests/commit/cc0e8b9c12031a44991c11bbb48bbd3b7b8d6d5f/checks/12685199096/logs

@q4a
Copy link
Author

q4a commented Apr 12, 2023

Looks similar to: lukka/run-vcpkg#144

@lukka
Copy link
Owner

lukka commented Apr 12, 2023

@q4a I think I'd be glad to see how to solve this problem with a PR contributed from the community. The problem is that the github.workspace contains backslashes on Windows, and the backslashes are going to be interpreted as escaping characters for the arbitrary input provided by the user.

My suggestion would be to avoid its usage, e.g. would a relative path such as -DD3D9_INCLUDE_DIR=./cache/Include work?

Or you could fix up the github.workspace variable by replacing backslashes with fw slashes, such as:

- uses: actions/github-script@v6
  with:
    script: |
       core.exportVariable('wkspath', "${{ github.workspace. }}".replace('\\', '/');

and then use wkspath onward in the workflow.

@lukka lukka added bug Something isn't working help wanted Extra attention is needed labels Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants