Workaround timeouts in DRC by hackily bumping it

This commit is contained in:
Pierre Chevalier 2020-10-17 18:49:51 +01:00
parent ed456da428
commit a58e97022a
3 changed files with 24 additions and 20 deletions

View File

@ -2,11 +2,11 @@
rule 0_1_base_erc
command = ./run_erc.sh 0.1/base && touch build/0.1/base/erc_success
build build/0.1/base/erc_success: 0_1_base_erc
build build/0.1/base/erc_success: 0_1_base_erc ./run_erc.sh
rule 0_1_base_drc
command = ./run_drc.sh 0.1/base && touch build/0.1/base/drc_success
build build/0.1/base/drc_success: 0_1_base_drc
build build/0.1/base/drc_success: 0_1_base_drc ./run_drc.sh
rule 0_1_base_gerbers
command = mkdir -p build/0.1/base && kiplot -b 0.1/base/ferris.kicad_pcb $
@ -36,11 +36,11 @@ build build/0_1_base_gerbers.zip: 0_1_base_gerbers_zip $
rule 0_1_compact_erc
command = ./run_erc.sh 0.1/compact && touch build/0.1/compact/erc_success
build build/0.1/compact/erc_success: 0_1_compact_erc
build build/0.1/compact/erc_success: 0_1_compact_erc ./run_erc.sh
rule 0_1_compact_drc
command = ./run_drc.sh 0.1/compact && touch build/0.1/compact/drc_success
build build/0.1/compact/drc_success: 0_1_compact_drc
build build/0.1/compact/drc_success: 0_1_compact_drc ./run_drc.sh
rule 0_1_compact_gerbers
command = mkdir -p build/0.1/compact && kiplot -b $
@ -75,11 +75,11 @@ build build/0_1_compact_gerbers.zip: 0_1_compact_gerbers_zip $
rule 0_1_high_erc
command = ./run_erc.sh 0.1/high && touch build/0.1/high/erc_success
build build/0.1/high/erc_success: 0_1_high_erc
build build/0.1/high/erc_success: 0_1_high_erc ./run_erc.sh
rule 0_1_high_drc
command = ./run_drc.sh 0.1/high && touch build/0.1/high/drc_success
build build/0.1/high/drc_success: 0_1_high_drc
build build/0.1/high/drc_success: 0_1_high_drc ./run_drc.sh
rule 0_1_high_gerbers
command = mkdir -p build/0.1/high && kiplot -b 0.1/high/ferris.kicad_pcb $
@ -109,11 +109,11 @@ build build/0_1_high_gerbers.zip: 0_1_high_gerbers_zip $
rule 0_1_low_erc
command = ./run_erc.sh 0.1/low && touch build/0.1/low/erc_success
build build/0.1/low/erc_success: 0_1_low_erc
build build/0.1/low/erc_success: 0_1_low_erc ./run_erc.sh
rule 0_1_low_drc
command = ./run_drc.sh 0.1/low && touch build/0.1/low/drc_success
build build/0.1/low/drc_success: 0_1_low_drc
build build/0.1/low/drc_success: 0_1_low_drc ./run_drc.sh
rule 0_1_low_gerbers
command = mkdir -p build/0.1/low && kiplot -b 0.1/low/ferris.kicad_pcb -c $
@ -142,11 +142,11 @@ build build/0_1_low_gerbers.zip: 0_1_low_gerbers_zip $
rule 0_2_bling_erc
command = ./run_erc.sh 0.2/bling && touch build/0.2/bling/erc_success
build build/0.2/bling/erc_success: 0_2_bling_erc
build build/0.2/bling/erc_success: 0_2_bling_erc ./run_erc.sh
rule 0_2_bling_drc
command = ./run_drc.sh 0.2/bling && touch build/0.2/bling/drc_success
build build/0.2/bling/drc_success: 0_2_bling_drc
build build/0.2/bling/drc_success: 0_2_bling_drc ./run_drc.sh
rule 0_2_bling_gerbers
command = mkdir -p build/0.2/bling && kiplot -b $
@ -176,11 +176,11 @@ build build/0_2_bling_gerbers.zip: 0_2_bling_gerbers_zip $
rule 0_2_compact_erc
command = ./run_erc.sh 0.2/compact && touch build/0.2/compact/erc_success
build build/0.2/compact/erc_success: 0_2_compact_erc
build build/0.2/compact/erc_success: 0_2_compact_erc ./run_erc.sh
rule 0_2_compact_drc
command = ./run_drc.sh 0.2/compact && touch build/0.2/compact/drc_success
build build/0.2/compact/drc_success: 0_2_compact_drc
build build/0.2/compact/drc_success: 0_2_compact_drc ./run_drc.sh
rule 0_2_compact_gerbers
command = mkdir -p build/0.2/compact && kiplot -b $
@ -215,11 +215,11 @@ build build/0_2_compact_gerbers.zip: 0_2_compact_gerbers_zip $
rule 0_2_high_erc
command = ./run_erc.sh 0.2/high && touch build/0.2/high/erc_success
build build/0.2/high/erc_success: 0_2_high_erc
build build/0.2/high/erc_success: 0_2_high_erc ./run_erc.sh
rule 0_2_high_drc
command = ./run_drc.sh 0.2/high && touch build/0.2/high/drc_success
build build/0.2/high/drc_success: 0_2_high_drc
build build/0.2/high/drc_success: 0_2_high_drc ./run_drc.sh
rule 0_2_high_gerbers
command = mkdir -p build/0.2/high && kiplot -b 0.2/high/ferris.kicad_pcb $
@ -249,11 +249,11 @@ build build/0_2_high_gerbers.zip: 0_2_high_gerbers_zip $
rule 0_2_mini_erc
command = ./run_erc.sh 0.2/mini && touch build/0.2/mini/erc_success
build build/0.2/mini/erc_success: 0_2_mini_erc
build build/0.2/mini/erc_success: 0_2_mini_erc ./run_erc.sh
rule 0_2_mini_drc
command = ./run_drc.sh 0.2/mini && touch build/0.2/mini/drc_success
build build/0.2/mini/drc_success: 0_2_mini_drc
build build/0.2/mini/drc_success: 0_2_mini_drc ./run_drc.sh
rule 0_2_mini_gerbers
command = mkdir -p build/0.2/mini && kiplot -b 0.2/mini/ferris.kicad_pcb $

View File

@ -44,7 +44,7 @@ def add_erc_rule(ninja, variant):
name=erc_rule,
command=[f"./run_erc.sh {variant} && touch {erc_file}"],
)
ninja.build(outputs=[erc_file], rule=erc_rule)
ninja.build(inputs=["./run_erc.sh"], outputs=[erc_file], rule=erc_rule)
ninja.newline()
@ -64,7 +64,7 @@ def add_drc_rule(ninja, variant):
name=drc_rule,
command=[f"./run_drc.sh {variant} && touch {drc_file}"],
)
ninja.build(outputs=[drc_file], rule=drc_rule)
ninja.build(inputs=["./run_drc.sh"], outputs=[drc_file], rule=drc_rule)
ninja.newline()

View File

@ -1,8 +1,12 @@
DRC_OUTPUT=$(docker run --rm -t -v "$(pwd)"/$1:/kicad-project productize/kicad-automation-scripts python -m kicad-automation.pcbnew_automation.run_drc /kicad-project/ferris.kicad_pcb "$(pwd)"/build | grep "INFO:root" | sed "s/INFO:root//")
# Super hacky: I'm replacing the timeout value in the docker container on the fly so it works with larger projects
FULL_DRC_OUTPUT=$(docker run --rm -t -v "$(pwd)"/$1:/kicad-project productize/kicad-automation-scripts bash -c 'sed -i s/timeout=10/timeout=600/ /usr/lib/python2.7/dist-packages/kicad-automation/util/ui_automation.py && python -m kicad-automation.pcbnew_automation.run_drc /kicad-project/ferris.kicad_pcb "$(pwd)"/build')
DRC_OUTPUT=$(echo $FULL_DRC_OUTPUT | grep "INFO:root" | sed "s/INFO:root//")
if [[ -z "$DRC_OUTPUT" ]]; then
echo -e "\e[1;32mERROR\e[0m"
echo "Missing ERC report line. Something went wrong"
echo "Missing DRC report line. Something went wrong"
echo "$FULL_DRC_OUTPUT"
exit 2
else
if [[ "$DRC_OUTPUT" = *"'drc_errors': 0, 'unconnected_pads': 0"* ]]; then