Skip to content

Run convert_project in a distinct working directory. #11

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 64 additions & 44 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,12 @@ jobs:

- name: Convert Vsftpd
run: |
cd ${{env.benchmark_conv_dir}}/no-alltypes/vsftpd-3.0.3
mkdir ${{env.benchmark_conv_dir}}/no-alltypes/vsftpd-3.0.3.work
cd ${{env.benchmark_conv_dir}}/no-alltypes/vsftpd-3.0.3.work
${{env.port_tools}}/convert_project.py \
--includeDir ${{env.include_dir}} \
--prog_name ${{env.builddir}}/bin/3c \
--project_path .
--project_path ${{env.benchmark_conv_dir}}/no-alltypes/vsftpd-3.0.3

- name: Build converted Vsftpd
run: |
Expand All @@ -152,12 +153,13 @@ jobs:

- name: Convert Vsftpd
run: |
cd ${{env.benchmark_conv_dir}}/alltypes/vsftpd-3.0.3
mkdir ${{env.benchmark_conv_dir}}/alltypes/vsftpd-3.0.3.work
cd ${{env.benchmark_conv_dir}}/alltypes/vsftpd-3.0.3.work
${{env.port_tools}}/convert_project.py \
--includeDir ${{env.include_dir}} \
--prog_name ${{env.builddir}}/bin/3c \
--extra-3c-arg=-alltypes \
--project_path .
--project_path ${{env.benchmark_conv_dir}}/alltypes/vsftpd-3.0.3

- name: Build converted Vsftpd (ignore failure)
run: |
Expand All @@ -183,11 +185,12 @@ jobs:

- name: Convert anagram
run: |
cd ${{env.benchmark_conv_dir}}/no-alltypes/ptrdist-1.1/anagram
mkdir ${{env.benchmark_conv_dir}}/no-alltypes/ptrdist-1.1/anagram.work
cd ${{env.benchmark_conv_dir}}/no-alltypes/ptrdist-1.1/anagram.work
${{env.port_tools}}/convert_project.py \
--includeDir ${{env.include_dir}} \
--prog_name ${{env.builddir}}/bin/3c \
--project_path .
--project_path ${{env.benchmark_conv_dir}}/no-alltypes/ptrdist-1.1/anagram

- name: Build converted anagram
run: |
Expand All @@ -198,11 +201,12 @@ jobs:

- name: Convert bc
run: |
cd ${{env.benchmark_conv_dir}}/no-alltypes/ptrdist-1.1/bc
mkdir ${{env.benchmark_conv_dir}}/no-alltypes/ptrdist-1.1/bc.work
cd ${{env.benchmark_conv_dir}}/no-alltypes/ptrdist-1.1/bc.work
${{env.port_tools}}/convert_project.py \
--includeDir ${{env.include_dir}} \
--prog_name ${{env.builddir}}/bin/3c \
--project_path .
--project_path ${{env.benchmark_conv_dir}}/no-alltypes/ptrdist-1.1/bc

- name: Build converted bc
run: |
Expand All @@ -213,11 +217,12 @@ jobs:

- name: Convert ft
run: |
cd ${{env.benchmark_conv_dir}}/no-alltypes/ptrdist-1.1/ft
mkdir ${{env.benchmark_conv_dir}}/no-alltypes/ptrdist-1.1/ft.work
cd ${{env.benchmark_conv_dir}}/no-alltypes/ptrdist-1.1/ft.work
${{env.port_tools}}/convert_project.py \
--includeDir ${{env.include_dir}} \
--prog_name ${{env.builddir}}/bin/3c \
--project_path .
--project_path ${{env.benchmark_conv_dir}}/no-alltypes/ptrdist-1.1/ft

- name: Build converted ft
run: |
Expand All @@ -228,11 +233,12 @@ jobs:

- name: Convert ks
run: |
cd ${{env.benchmark_conv_dir}}/no-alltypes/ptrdist-1.1/ks
mkdir ${{env.benchmark_conv_dir}}/no-alltypes/ptrdist-1.1/ks.work
cd ${{env.benchmark_conv_dir}}/no-alltypes/ptrdist-1.1/ks.work
${{env.port_tools}}/convert_project.py \
--includeDir ${{env.include_dir}} \
--prog_name ${{env.builddir}}/bin/3c \
--project_path .
--project_path ${{env.benchmark_conv_dir}}/no-alltypes/ptrdist-1.1/ks

- name: Build converted ks
run: |
Expand All @@ -243,11 +249,12 @@ jobs:

- name: Convert yacr2
run: |
cd ${{env.benchmark_conv_dir}}/no-alltypes/ptrdist-1.1/yacr2
mkdir ${{env.benchmark_conv_dir}}/no-alltypes/ptrdist-1.1/yacr2.work
cd ${{env.benchmark_conv_dir}}/no-alltypes/ptrdist-1.1/yacr2.work
${{env.port_tools}}/convert_project.py \
--includeDir ${{env.include_dir}} \
--prog_name ${{env.builddir}}/bin/3c \
--project_path .
--project_path ${{env.benchmark_conv_dir}}/no-alltypes/ptrdist-1.1/yacr2

- name: Build converted yacr2
run: |
Expand All @@ -273,12 +280,13 @@ jobs:

- name: Convert anagram
run: |
cd ${{env.benchmark_conv_dir}}/alltypes/ptrdist-1.1/anagram
mkdir ${{env.benchmark_conv_dir}}/alltypes/ptrdist-1.1/anagram.work
cd ${{env.benchmark_conv_dir}}/alltypes/ptrdist-1.1/anagram.work
${{env.port_tools}}/convert_project.py \
--includeDir ${{env.include_dir}} \
--prog_name ${{env.builddir}}/bin/3c \
--extra-3c-arg=-alltypes \
--project_path .
--project_path ${{env.benchmark_conv_dir}}/alltypes/ptrdist-1.1/anagram

- name: Build converted anagram (ignore failure)
run: |
Expand All @@ -289,12 +297,13 @@ jobs:

- name: Convert bc
run: |
cd ${{env.benchmark_conv_dir}}/alltypes/ptrdist-1.1/bc
mkdir ${{env.benchmark_conv_dir}}/alltypes/ptrdist-1.1/bc.work
cd ${{env.benchmark_conv_dir}}/alltypes/ptrdist-1.1/bc.work
${{env.port_tools}}/convert_project.py \
--includeDir ${{env.include_dir}} \
--prog_name ${{env.builddir}}/bin/3c \
--extra-3c-arg=-alltypes \
--project_path .
--project_path ${{env.benchmark_conv_dir}}/alltypes/ptrdist-1.1/bc

- name: Build converted bc (ignore failure)
run: |
Expand All @@ -305,12 +314,13 @@ jobs:

- name: Convert ft
run: |
cd ${{env.benchmark_conv_dir}}/alltypes/ptrdist-1.1/ft
mkdir ${{env.benchmark_conv_dir}}/alltypes/ptrdist-1.1/ft.work
cd ${{env.benchmark_conv_dir}}/alltypes/ptrdist-1.1/ft.work
${{env.port_tools}}/convert_project.py \
--includeDir ${{env.include_dir}} \
--prog_name ${{env.builddir}}/bin/3c \
--extra-3c-arg=-alltypes \
--project_path .
--project_path ${{env.benchmark_conv_dir}}/alltypes/ptrdist-1.1/ft

- name: Build converted ft (ignore failure)
run: |
Expand All @@ -321,12 +331,13 @@ jobs:

- name: Convert ks
run: |
cd ${{env.benchmark_conv_dir}}/alltypes/ptrdist-1.1/ks
mkdir ${{env.benchmark_conv_dir}}/alltypes/ptrdist-1.1/ks.work
cd ${{env.benchmark_conv_dir}}/alltypes/ptrdist-1.1/ks.work
${{env.port_tools}}/convert_project.py \
--includeDir ${{env.include_dir}} \
--prog_name ${{env.builddir}}/bin/3c \
--extra-3c-arg=-alltypes \
--project_path .
--project_path ${{env.benchmark_conv_dir}}/alltypes/ptrdist-1.1/ks

- name: Build converted ks (ignore failure)
run: |
Expand All @@ -337,12 +348,13 @@ jobs:

- name: Convert yacr2
run: |
cd ${{env.benchmark_conv_dir}}/alltypes/ptrdist-1.1/yacr2
mkdir ${{env.benchmark_conv_dir}}/alltypes/ptrdist-1.1/yacr2.work
cd ${{env.benchmark_conv_dir}}/alltypes/ptrdist-1.1/yacr2.work
${{env.port_tools}}/convert_project.py \
--includeDir ${{env.include_dir}} \
--prog_name ${{env.builddir}}/bin/3c \
--extra-3c-arg=-alltypes \
--project_path .
--project_path ${{env.benchmark_conv_dir}}/alltypes/ptrdist-1.1/yacr2

- name: Build converted yacr2 (ignore failure)
run: |
Expand All @@ -368,13 +380,14 @@ jobs:

- name: Convert LibArchive
run: |
cd ${{env.benchmark_conv_dir}}/no-alltypes/libarchive-3.4.3
mkdir ${{env.benchmark_conv_dir}}/no-alltypes/libarchive-3.4.3.work
cd ${{env.benchmark_conv_dir}}/no-alltypes/libarchive-3.4.3.work
${{env.port_tools}}/convert_project.py \
--skip '/.*/(test|test_utils|tar|cat|cpio|examples|contrib|libarchive_fe)/.*' \
--includeDir ${{env.include_dir}} \
--prog_name ${{env.builddir}}/bin/3c \
--project_path . \
--build_dir build
--project_path ${{env.benchmark_conv_dir}}/no-alltypes/libarchive-3.4.3 \
--build_dir ${{env.benchmark_conv_dir}}/no-alltypes/libarchive-3.4.3/build

- name: Build converted LibArchive
run: |
Expand All @@ -401,14 +414,15 @@ jobs:

- name: Convert LibArchive
run: |
cd ${{env.benchmark_conv_dir}}/alltypes/libarchive-3.4.3
mkdir ${{env.benchmark_conv_dir}}/alltypes/libarchive-3.4.3.work
cd ${{env.benchmark_conv_dir}}/alltypes/libarchive-3.4.3.work
${{env.port_tools}}/convert_project.py \
--skip '/.*/(test|test_utils|tar|cat|cpio|examples|contrib|libarchive_fe)/.*' \
--includeDir ${{env.include_dir}} \
--prog_name ${{env.builddir}}/bin/3c \
--extra-3c-arg=-alltypes \
--project_path . \
--build_dir build
--project_path ${{env.benchmark_conv_dir}}/alltypes/libarchive-3.4.3 \
--build_dir ${{env.benchmark_conv_dir}}/alltypes/libarchive-3.4.3/build

- name: Build converted LibArchive (ignore failure)
run: |
Expand Down Expand Up @@ -438,11 +452,12 @@ jobs:

- name: Convert Lua
run: |
cd ${{env.benchmark_conv_dir}}/no-alltypes/lua-5.4.1
mkdir ${{env.benchmark_conv_dir}}/no-alltypes/lua-5.4.1.work
cd ${{env.benchmark_conv_dir}}/no-alltypes/lua-5.4.1.work
${{env.port_tools}}/convert_project.py \
--includeDir ${{env.include_dir}} \
--prog_name ${{env.builddir}}/bin/3c \
--project_path .
--project_path ${{env.benchmark_conv_dir}}/no-alltypes/lua-5.4.1

- name: Build converted Lua
run: |
Expand Down Expand Up @@ -471,12 +486,13 @@ jobs:

- name: Convert Lua
run: |
cd ${{env.benchmark_conv_dir}}/alltypes/lua-5.4.1
mkdir ${{env.benchmark_conv_dir}}/alltypes/lua-5.4.1.work
cd ${{env.benchmark_conv_dir}}/alltypes/lua-5.4.1.work
${{env.port_tools}}/convert_project.py \
--includeDir ${{env.include_dir}} \
--prog_name ${{env.builddir}}/bin/3c \
--extra-3c-arg=-alltypes \
--project_path .
--project_path ${{env.benchmark_conv_dir}}/alltypes/lua-5.4.1

- name: Build converted Lua (ignore failure)
run: |
Expand Down Expand Up @@ -507,14 +523,15 @@ jobs:

- name: Convert LibTiff
run: |
cd ${{env.benchmark_conv_dir}}/no-alltypes/tiff-4.1.0
mkdir ${{env.benchmark_conv_dir}}/no-alltypes/tiff-4.1.0.work
cd ${{env.benchmark_conv_dir}}/no-alltypes/tiff-4.1.0.work
${{env.port_tools}}/convert_project.py \
--skip '/.*/tif_stream.cxx' \
--skip '.*/test/.*\.c' \
--skip '.*/contrib/.*\.c' \
--includeDir ${{env.include_dir}} \
--prog_name ${{env.builddir}}/bin/3c \
--project_path .
--project_path ${{env.benchmark_conv_dir}}/no-alltypes/tiff-4.1.0

- name: Build converted LibTiff
run: |
Expand Down Expand Up @@ -545,15 +562,16 @@ jobs:

- name: Convert LibTiff
run: |
cd ${{env.benchmark_conv_dir}}/alltypes/tiff-4.1.0
mkdir ${{env.benchmark_conv_dir}}/alltypes/tiff-4.1.0.work
cd ${{env.benchmark_conv_dir}}/alltypes/tiff-4.1.0.work
${{env.port_tools}}/convert_project.py \
--skip '/.*/tif_stream.cxx' \
--skip '.*/test/.*\.c' \
--skip '.*/contrib/.*\.c' \
--includeDir ${{env.include_dir}} \
--prog_name ${{env.builddir}}/bin/3c \
--extra-3c-arg=-alltypes \
--project_path .
--project_path ${{env.benchmark_conv_dir}}/alltypes/tiff-4.1.0

- name: Build converted LibTiff (ignore failure)
run: |
Expand All @@ -580,13 +598,14 @@ jobs:

- name: Convert ZLib
run: |
cd ${{env.benchmark_conv_dir}}/no-alltypes/zlib-1.2.11
mkdir ${{env.benchmark_conv_dir}}/no-alltypes/zlib-1.2.11.work
cd ${{env.benchmark_conv_dir}}/no-alltypes/zlib-1.2.11.work
${{env.port_tools}}/convert_project.py \
--skip '/.*/test/.*' \
--includeDir ${{env.include_dir}} \
--prog_name ${{env.builddir}}/bin/3c \
--project_path . \
--build_dir build
--project_path ${{env.benchmark_conv_dir}}/no-alltypes/zlib-1.2.11 \
--build_dir ${{env.benchmark_conv_dir}}/no-alltypes/zlib-1.2.11/build

- name: Build converted ZLib
run: |
Expand Down Expand Up @@ -614,14 +633,15 @@ jobs:

- name: Convert ZLib
run: |
cd ${{env.benchmark_conv_dir}}/alltypes/zlib-1.2.11
mkdir ${{env.benchmark_conv_dir}}/alltypes/zlib-1.2.11.work
cd ${{env.benchmark_conv_dir}}/alltypes/zlib-1.2.11.work
${{env.port_tools}}/convert_project.py \
--skip '/.*/test/.*' \
--includeDir ${{env.include_dir}} \
--prog_name ${{env.builddir}}/bin/3c \
--extra-3c-arg=-alltypes \
--project_path . \
--build_dir build
--project_path ${{env.benchmark_conv_dir}}/alltypes/zlib-1.2.11 \
--build_dir ${{env.benchmark_conv_dir}}/alltypes/zlib-1.2.11/build

- name: Build converted ZLib (ignore failure)
run: |
Expand Down
15 changes: 12 additions & 3 deletions generate-workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,17 +338,26 @@ def ensure_trailing_newline(s: str):
'--includeDir ${{env.include_dir}} \\\n' +
'--prog_name ${{env.builddir}}/bin/3c \\\n' +
at_flag +
'--project_path .' +
(f' \\\n--build_dir {component.build_dir}'
f'--project_path {component_dir}' +
(f' \\\n--build_dir {component_dir}/{component.build_dir}'
if component.build_dir is not None else '') +
'\n',
2 * ' ')
# yapf: enable
steps.append(
Step(
'Convert ' + component_friendly_name,
# Choose a working directory different from all the
# other important directories involved (the source
# directory, build directory, etc.) to detect if
# anything called by convert_project inappropriately
# assumes that the working directory matches one of
# those other directories. If anything called by
# convert_project writes diagnostic files to its working
# directory, this also helps to keep them separate.
textwrap.dedent(f'''\
cd {component_dir}
mkdir {component_dir}.work
cd {component_dir}.work
${{{{env.port_tools}}}}/convert_project.py \\
''') + convert_flags))

Expand Down