# Fix gen3-middleware ci_hsc SConscript

XMLWordPrintable

## Details

• Type: Bug
• Status: Done
• Resolution: Done
• Fix Version/s: None
• Component/s:
• Labels:
• Story Points:
1
• Sprint:
BG3_F18_07
• Team:
Data Release Production

## Description

From Andy Salnikov on Slack:

OK, I think I know what is happening. If I do rm DATA/gen3.sqlite3 DATA/butler.yaml; makeButlerRepo.py DATA; bin/gen3.py then it runs successfully (or it fails with different exception). If I do rm DATA/gen3.sqlite3 DATA/butler.yaml; scons gen3repo then it fails with the above exception (no such table: Camera). I watched DATA directory and I see that gen3.sqlite3 is removed between execution of makeButlerRepo.py and gen3.py. Looking at SConscript I think this happens because scons believes that gen3.sqlite3 is produced by gen3.py when in reality it is produced by makeButlerRepo.py and updated by gen3.py. Scons by default removes target file before rebuilding it, so it does that before executing gen3.py.
I'm not sure what is the best way to fix this but scons has Precious function to prevent removal of target before rebuilding (https://scons.org/doc/3.0.1/HTML/scons-user.html#chap-file-removal), maybe we should use that

## Activity

Hide
Jim Bosch added a comment -

Doing this now; I need to use ci_hsc to test DM-15189 and I might as well fix this at the same time.

Show
Jim Bosch added a comment - Doing this now; I need to use ci_hsc to test DM-15189 and I might as well fix this at the same time.
Hide
Jim Bosch added a comment -

Andy Salnikov, your suggestion for how to fix the SConstruct worked perfectly.  Mind reviewing the one-line change?

Show
Jim Bosch added a comment - Andy Salnikov , your suggestion for how to fix the SConstruct worked perfectly.  Mind reviewing the one-line change?
Hide
Andy Salnikov added a comment -

Looks OK to me, one minor comment on PR.

Show
Andy Salnikov added a comment - Looks OK to me, one minor comment on PR.
Hide
Jim Bosch added a comment -

Merged to master.

Show
Jim Bosch added a comment - Merged to master.

## People

• Assignee:
Jim Bosch
Reporter:
Jim Bosch
Reviewers:
Andy Salnikov
Watchers:
Andy Salnikov, Jim Bosch