Skip to content

Commit

Permalink
bug fix "[windows, macos and linux executables] -GCString switch cann…
Browse files Browse the repository at this point in the history
…ot run normally"

cmhughes#531
  • Loading branch information
saxyx committed Mar 26, 2024
1 parent c05b4af commit 830db86
Show file tree
Hide file tree
Showing 3 changed files with 141 additions and 56 deletions.
141 changes: 119 additions & 22 deletions .github/workflows/batch-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ jobs:
$files = Get-ChildItem test-cases\check-switch-tests\*tex
foreach ($file in $files) {perl latexindent.pl --check -s $file}
cjk-windows-exe-test:
needs: check-pm-files-changed
if: ${{fromJSON(needs.check-pm-files-changed.outputs.anychanged)}}
#needs: check-pm-files-changed
#if: ${{fromJSON(needs.check-pm-files-changed.outputs.anychanged)}}
name: 'create Windows executable latexindent.exe using Strawberry Perl 5.32 on Windows'
runs-on: 'windows-latest'
steps:
Expand All @@ -152,34 +152,18 @@ jobs:
cpanm Unicode::GCString
cpanm --force Win32::Unicode::File
cpanm --force Win32::API
- name: rebuild and install PAR-Packer-master
#If the version number of PAR::Packer does not exceed 1.061, it is necessary to rebuild and install PAR-Packer-master
#https://github.com/rschupp/PAR-Packer/issues/84
#Issue #84: pass UTF-16 command line down to my_perl (using _wspawnvp)
run: |
Invoke-WebRequest -Uri https://github.com/rschupp/PAR-Packer/archive/refs/heads/master.zip -OutFile PAR-Packer-master.zip
unzip PAR-Packer-master.zip
cd PAR-Packer-master
perl Makefile.PL
gmake
gmake install
- name: preparations for PAR packer
run: |
sed -i'.bak' -r 's,eval\s\"use\sUnicode::GCString\"\sif\s\$switches\{GCString\},use Unicode::GCString,' latexindent.pl
SET PAR_VERBATIM=1
#
# https://metacpan.org/pod/pp
# https://github.com/plk/biber/blob/dev/dist/MSWIN64/build.bat
#
- name: create latexindent.exe using PAR Packer
run: >-
pp
-T
-M Win32::Unicode
--addfile="defaultSettings.yaml;lib/LatexIndent/defaultSettings.yaml"
--cachedeps=scancache
--output latexindent.exe
latexindent.pl
shell: cmd
run: |
set PAR_VERBATIM=1
pp -T -M Win32::Unicode --addfile="defaultSettings.yaml;lib/LatexIndent/defaultSettings.yaml" --cachedeps=scancache --output latexindent.exe latexindent.pl
- name: latexindent.exe help
run: |
./latexindent.exe --help
Expand All @@ -204,3 +188,116 @@ jobs:
cat test-cases/back-up-tests/indent.log
./latexindent.exe test-cases/back-up-tests/新建äö.tex -g="新建äö.log" -c="D:/新建"
cat D:/新建/新建äö.log
- name: latexindent.exe -GCString test, issue 531
# https://github.com/cmhughes/latexindent.pl/issues/531
run: |
./latexindent.exe test-cases/GCString-test/GCString.tex -y="defaultIndent: ' '" -GCString -g="indent.log" -o=++
cat test-cases/GCString-test/indent.log
linux-executable-GCString-test:
name: 'create Linux executable latexindent'
runs-on: 'ubuntu-latest'
steps:
#
# checkout github.com/cmhughes/latexindent.pl
# https://github.com/actions/checkout
#
- name: load the "base actions/checkout" so as to access latexindent.pl
uses: actions/checkout@v4
#
# https://github.com/marketplace/actions/setup-perl-environment
#
- name: install Perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: '5.32'
- name: install Perl modules using cpan
run: |
cpanm -f PAR::Packer
cpanm YAML::Tiny
cpanm File::HomeDir
cpanm Unicode::GCString
- name: preparations for PAR packer
run: |
sed -i'.bak' -r 's,eval\s\"use\sUnicode::GCString\"\sif\s\$switches\{GCString\},use Unicode::GCString,' latexindent.pl
PAR_VERBATIM=1
#
# https://metacpan.org/pod/pp
# https://github.com/plk/biber/blob/dev/dist/linux-musl_x86_64/build.sh
#
- name: create Linux executable latexindent using PAR Packer
run: >-
pp
--addfile="defaultSettings.yaml;lib/LatexIndent/defaultSettings.yaml"
--cachedeps=scancache
--output latexindent-linux
latexindent.pl
- name: latexindent-linux -GCString test, issue 531
# https://github.com/cmhughes/latexindent.pl/issues/531
run: |
./latexindent-linux test-cases/GCString-test/GCString.tex -y="defaultIndent: ' '" -GCString -g="indent1.log" -o=++
cat test-cases/GCString-test/indent1.log
continue-on-error: true
- name: create Linux executable latexindent using PAR Packer
run: |
export PAR_VERBATIM=1
pp --addfile="defaultSettings.yaml;lib/LatexIndent/defaultSettings.yaml" --cachedeps=scancache --output latexindent-linux2 latexindent.pl
- name: latexindent-linux2 -GCString test, issue 531
# https://github.com/cmhughes/latexindent.pl/issues/531
run: |
./latexindent-linux2 test-cases/GCString-test/GCString.tex -y="defaultIndent: ' '" -GCString -g="indent2.log" -o=++
cat test-cases/GCString-test/indent2.log
macos-executable-GCString-test:
name: 'create MacOS executable latexindent'
runs-on: 'macos-latest'
steps:
#
# checkout github.com/cmhughes/latexindent.pl
# https://github.com/actions/checkout
#
- name: load the "base actions/checkout" so as to access latexindent.pl
uses: actions/checkout@v4
#
# https://github.com/marketplace/actions/setup-perl-environment
#
- name: install Perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: '5.32'
- name: install Perl modules using cpan
run: |
cpanm -f PAR::Packer
cpanm YAML::Tiny
cpanm -f File::HomeDir
cpanm Unicode::GCString
- name: preparations for PAR packer
run: |
sed -i'.bak' -r 's,eval\s\"use\sUnicode::GCString\"\sif\s\$switches\{GCString\},use Unicode::GCString,' latexindent.pl
PAR_VERBATIM=1
#
# https://metacpan.org/pod/pp
# https://github.com/plk/biber/blob/dev/dist/linux-musl_x86_64/build.sh
#
- name: create MacOS executable latexindent using PAR Packer
run: >-
pp
--addfile="defaultSettings.yaml;lib/LatexIndent/defaultSettings.yaml"
--cachedeps=scancache
--output latexindent-macos
latexindent.pl
- name: latexindent-macos -GCString test, issue 531
# https://github.com/cmhughes/latexindent.pl/issues/531
run: |
./latexindent-macos test-cases/GCString-test/GCString.tex -y="defaultIndent: ' '" -GCString -g="indent1.log" -o=++
cat test-cases/GCString-test/indent1.log
continue-on-error: true
- name: create MacOS executable latexindent using PAR Packer
run: |
export PAR_VERBATIM=1
pp --addfile="defaultSettings.yaml;lib/LatexIndent/defaultSettings.yaml" --cachedeps=scancache --output latexindent-macos2 latexindent.pl
- name: latexindent-macos2 -GCString test, issue 531
# https://github.com/cmhughes/latexindent.pl/issues/531
run: |
./latexindent-macos2 test-cases/GCString-test/GCString.tex -y="defaultIndent: ' '" -GCString -g="indent2.log" -o=++
cat test-cases/GCString-test/indent2.log
43 changes: 9 additions & 34 deletions .github/workflows/build-documentation-and-executables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,34 +88,18 @@ jobs:
cpanm Unicode::GCString
cpanm --force Win32::Unicode::File
cpanm --force Win32::API
- name: rebuild and install PAR-Packer-master
#If the version number of PAR::Packer does not exceed 1.061, it is necessary to rebuild and install PAR-Packer-master
#https://github.com/rschupp/PAR-Packer/issues/84
#Issue #84: pass UTF-16 command line down to my_perl (using _wspawnvp)
run: |
Invoke-WebRequest -Uri https://github.com/rschupp/PAR-Packer/archive/refs/heads/master.zip -OutFile PAR-Packer-master.zip
unzip PAR-Packer-master.zip
cd PAR-Packer-master
perl Makefile.PL
gmake
gmake install
- name: preparations for PAR packer
run: |
sed -i'.bak' -r 's,eval\s\"use\sUnicode::GCString\"\sif\s\$switches\{GCString\},use Unicode::GCString,' latexindent.pl
SET PAR_VERBATIM=1
#
# https://metacpan.org/pod/pp
# https://github.com/plk/biber/blob/dev/dist/MSWIN64/build.bat
#
- name: create latexindent.exe using PAR Packer
run: >-
pp
-T
-M Win32::Unicode
--addfile="defaultSettings.yaml;lib/LatexIndent/defaultSettings.yaml"
--cachedeps=scancache
--output latexindent.exe
latexindent.pl
shell: cmd
run: |
set PAR_VERBATIM=1
pp -T -M Win32::Unicode --addfile="defaultSettings.yaml;lib/LatexIndent/defaultSettings.yaml" --cachedeps=scancache --output latexindent.exe latexindent.pl
- name: move latexindent.exe to release directory
run: |
mkdir -p target/release
Expand Down Expand Up @@ -163,18 +147,14 @@ jobs:
- name: preparations for PAR packer
run: |
sed -i'.bak' -r 's,eval\s\"use\sUnicode::GCString\"\sif\s\$switches\{GCString\},use Unicode::GCString,' latexindent.pl
PAR_VERBATIM=1
#
# https://metacpan.org/pod/pp
# https://github.com/plk/biber/blob/dev/dist/linux-musl_x86_64/build.sh
#
- name: create Linux executable latexindent using PAR Packer
run: >-
pp
--addfile="defaultSettings.yaml;lib/LatexIndent/defaultSettings.yaml"
--cachedeps=scancache
--output latexindent-linux
latexindent.pl
run: |
export PAR_VERBATIM=1
pp --addfile="defaultSettings.yaml;lib/LatexIndent/defaultSettings.yaml" --cachedeps=scancache --output latexindent-linux latexindent.pl
- name: move Linux latexindent to release directory
run: |
mkdir -p target/release
Expand Down Expand Up @@ -222,18 +202,13 @@ jobs:
- name: preparations for PAR packer
run: |
sed -i'.bak' -r 's,eval\s\"use\sUnicode::GCString\"\sif\s\$switches\{GCString\},use Unicode::GCString,' latexindent.pl
PAR_VERBATIM=1
#
# https://metacpan.org/pod/pp
# https://github.com/plk/biber/blob/dev/dist/linux-musl_x86_64/build.sh
#
- name: create MacOS executable latexindent using PAR Packer
run: >-
pp
--addfile="defaultSettings.yaml;lib/LatexIndent/defaultSettings.yaml"
--cachedeps=scancache
--output latexindent-macos
latexindent.pl
run: |
export PAR_VERBATIM=1 pp --addfile="defaultSettings.yaml;lib/LatexIndent/defaultSettings.yaml" --cachedeps=scancache --output latexindent-macos latexindent.pl
- name: move MacOS latexindent to release directory
run: |
mkdir -p target/release
Expand Down
13 changes: 13 additions & 0 deletions test-cases/GCString-test/GCString.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
\begin{table}[H]
\centering
\begin{tblr}{
hlines,
vlines,
cells = {c,m}}
5:30 & 起床 & 12:30~14:00 & 午休 \\
6:00~7:00 & 早操 & 14:00~17:30 & 集训 \\
7:00~7:50 & 早餐 & 17:30~18:30 & 晚餐 \\
7:50~11:00 & 集训 & 19:00~21:00 & 晚自习 \\
11:00~12:30 & 午餐 & 23:00 & 熄灯 \\
\end{tblr}
\end{table}

0 comments on commit 830db86

Please sign in to comment.