[backend] add buildenv collection code for PTF generation

Still need to adapt worker to use the collected files.