-
Notifications
You must be signed in to change notification settings - Fork 83
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
Use path library for path manipulation #266
base: master
Are you sure you want to change the base?
Use path library for path manipulation #266
Conversation
Previously, this action relied heavily on string manipulation techniques to compose paths. This approach is prone to error, particularly in the context of Windows and inconsistent use of native path delimiters.
This is definitely a big improvement and the right path. But I can't help but point out that passing output of Btw if poking at paths already, I think that this: |
If there's still value in unit testing feel free to pull in the Looks like the failed test is just flakiness? |
I think unit testing is a really good idea, but I'd like to keep that separate from this PR for now.
The failed test does not appear related to the changes in this PR. Relevant code: install-qt-action/.github/workflows/test.yml Lines 138 to 144 in 09d1e79
The failed runs indicate that on some MacOS test runners,
Maybe we could get around it with a glob star, like
|
`path.resolve` joins and normalizes paths, returning an absolute path. We want all environment variables to be set to absolute paths, with all directory separators fixed and root `/` turned to `C:\\` or `D:\\` on Windows. `path.resolve` does that. I thought it was important to use `path.resolve` after any use of `glob.sync`, since those necessarily introduce new `/` into the paths. I left two instances of `path.join` in places where I thought the absolute path didn't matter, because they are either not used to build a path (in `locateQtArchDir`) or upstream of a `path.resolve` (in `toolsPaths`). Perhaps this is the wrong approach, and will lead to future inconsistency; perhaps not. Hopefully the tests will be enough.
That Xcode failure is related to actions/runner-images#10703 and I don't think it's possible to build with Qt < 6.5.3 on GitHub Actions with the newer runners (macOS 14/15) anymore; only macOS 13 and the soon-to-be-retired macOS 12 runners. |
Fix #259.
Currently, this action relies heavily on string manipulation techniques to compose paths. This approach is prone to error, particularly in the context of Windows and inconsistent use of native path delimiters. This PR uses the standard Node
path
library to manipulate paths./
and test runnerwindows-latest
: https://github.com/ddalcino/install-qt-action/actions/runs/11786060831/job/32828603078#step:9:1Note the broken environment variables:
QT_ROOT_DIR
variable: https://github.com/ddalcino/install-qt-action/actions/runs/11786135722/job/32828835488#step:8:1Note the fixed environment variables:
path.resolve
instead ofpath.join
),IQTA_TOOLS
now has a drive letter: https://github.com/jurplel/install-qt-action/actions/runs/11788985029/job/32836995662?pr=266#step:8:1