When working with cloud nodes (where the node may only exist for a single build before being replaced), the Auto cleanup and sync and Sync only populate options can lead to errors where files are not appropriately synced from Perforce Helix.
- With Auto cleanup and sync, use of p4 resolve prior to p4 sync can lead to spurious errors "cannot clobber writable file" because the havelist doesn't match what exists in the workspace (because the workspace is empty from being on a brand new node).
- With Sync only, Perforce relies on the inaccurate havelist and only syncs new files, leading to all other files being missing from the build.
The only option that works reliably for us right now is the "not recommended" Forced clean and sync. This, however, is overkill, because I don't actually need to wipe out the workspace because I already know it to be empty.
It would be very nice to have an option to "Flush and sync only" that runs only flush -f and sync -pf. Thereby, the inaccurate havelist could be bypassed entirely without the extra overhead of reset, sync #none, and rm.
Hello,
I found that there is a feature request for a “Flush and sync only” option in the Perforce Jenkins plugin. This option would run p4 flush -f and p4 sync -pf to bypass the havelist and sync only the files that are needed for the build. However, this feature has not been implemented yet, and there is no ETA for when it will be available.
As a workaround, you could try to use the Graph force clean and sync option, which is similar to the Forced clean and sync option, but uses the p4 clean -f https://www.beballplayers.com/ command instead of p4 sync #none and rm. This command is faster and more efficient, as it only removes the files that are not in sync with the depot. You can also use the p4 clean -f -e option to exclude files that are opened for edit.
I hope this helps you improve your build performance and avoid errors.
Best regards,
Latonya