From ae6826cc3ecb940f8cdac627916815e4538c4b6c Mon Sep 17 00:00:00 2001 From: toofar Date: Sun, 25 Feb 2024 15:18:25 +1300 Subject: ci: maybe fix --debug patching on all platforms It seems `sed -i` is not very portable. Initially we were using this command: sed -i '' '/.-d., .--debug.,/s/$/ default=True,/' qutebrowser/qutebrowser.py and then that started breaking on windows, I'm not sure why, with "can't read /.-d., .--debug.,/s/$/ default=True,/: No such file or directory". Then we changed to: sed -i '/.-d., .--debug.,/s/$/ default=True,/' qutebrowser/qutebrowser.py so without the extension argument, but that broke on mac with "1: "qutebrowser/qutebrowser.py": extra characters at the end of q command" then we tried: sed -i'' '/.-d., .--debug.,/s/$/ default=True,/' qutebrowser/qutebrowser.py and that also broke on mac with the same error. On the recommendation of stackoverflow I just changed it no not use in-place editing and do a good old fashioned move afterwards. https://unix.stackexchange.com/questions/92895/how-can-i-achieve-portability-with-sed-i-in-place-editing --- .github/workflows/nightly.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 400d65559..a78590de9 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -59,7 +59,8 @@ jobs: - name: Patch qutebrowser for debugging if: "contains(matrix.args, '--debug')" run: | - sed -i'' '/.-d., .--debug.,/s/$/ default=True,/' qutebrowser/qutebrowser.py + sed '/.-d., .--debug.,/s/$/ default=True,/' qutebrowser/qutebrowser.py > qutebrowser/qutebrowser.py.tmp + mv qutebrowser/qutebrowser.py.tmp qutebrowser/qutebrowser.py - name: Run tox run: "tox -e ${{ matrix.toxenv }} -- --gh-token ${{ secrets.GITHUB_TOKEN }} ${{ matrix.args }}" - name: Gather info -- cgit v1.2.3-54-g00ecf