Skip to content

Commit 3df728e

Browse files
authored
Don't stop if a variant can't be synthesized (#14)
1 parent 67571bb commit 3df728e

File tree

2 files changed

+25
-7
lines changed

2 files changed

+25
-7
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ jobs:
139139
- name: Synthesize the variants
140140
run: |
141141
build/envelope-tool synthesize \
142+
--ignore-errors \
142143
--toit-root=toit \
143144
--output-root=synthesized \
144145
--sdk-path=build/host/sdk \
@@ -158,6 +159,11 @@ jobs:
158159
ccache -s
159160
for variant in $VARIANTS; do
160161
mkdir -p build/$variant
162+
if [ -e synthesized/$variant/failed ]; then
163+
echo "Skipping $variant to due failed synthesis."
164+
touch build/$variant/failed
165+
continue
166+
fi
161167
(cd synthesized/$variant && make) || touch build/$variant/failed
162168
done
163169
ccache -s

tools/main.toit

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ main args:
6262
cli.Option "variants-root"
6363
--short_help="The root directory of the variants."
6464
--required,
65+
cli.Flag "ignore-errors"
66+
--short_help="Ignore errors when synthesizing variants.",
6567
]
6668
--rest=[
6769
cli.Option "variant"
@@ -121,14 +123,24 @@ variant_synthesize parsed/cli.Parsed --ui/cli.Ui:
121123
sdk_path := parsed["sdk-path"]
122124
variants_root := parsed["variants-root"]
123125
variants := parsed["variant"]
126+
ignore_errors := parsed["ignore-errors"]
127+
128+
variants.do: | variant/string |
129+
exception := catch:
130+
variant_synthesize
131+
--variant_path="$variants_root/$variant"
132+
--toit_root=toit_root
133+
--output="$output_root/$variant"
134+
--build_path="$build_root/$variant"
135+
--sdk_path=sdk_path
136+
--ui=ui
137+
if exception:
138+
ui.print "Failed to synthesize variant '$variant': $exception."
139+
if not ignore_errors: ui.abort
140+
catch:
141+
directory.mkdir --recursive "$output_root/$variant"
142+
file.write-content --path="$output_root/$variant/failed" "$exception"
124143

125-
variants.do: variant_synthesize
126-
--variant_path="$variants_root/$it"
127-
--toit_root=toit_root
128-
--output="$output_root/$it"
129-
--build_path="$build_root/$it"
130-
--sdk_path=sdk_path
131-
--ui=ui
132144

133145
variant_synthesize
134146
--variant_path/string

0 commit comments

Comments
 (0)