[p4] trigger change-content - compile before commit submission

Slava Imeshev imeshev at yahoo.com
Mon Jan 15 15:47:26 PST 2007


Hi Danny,

The problem with preventing submission by running builds in a Perforce
trigger is that in any environment were builds are longer than a couple
of seconds and number of submissions is little such triggers become
a serious performance bottleneck. Also, this violates usage pattern
for any VCS: checkout -> change -> commit. There is a bunch of
other issues but these are the major ones.

A more scalable approach is using an integration build when a
build management server picks up changes and re-builds everything
in a clean environment. It signals if there is a problem with new submissions.
This approach was first introduced by OS/360 team back in sixties. It is
also known as continuous integration. There are plenty of high quality
commercial implementations (I represent Parabuild) and do-it-yourself
open source projects.

Using existing products allow you quickly bootstrap a build management
infrastructure in your organization. Sure, it is much more fun to develop
it from scratches but it will take time, and all this time your team will
be breaking the build without knowing it.

With a continuous integration server running, the typical pattern
for a developer is the following:

1. Make changes
2. Run local build cleanly
3. Run local tests cleanly
4. Submit
5. Receive a failure notification if any
6. Fix the build breakage

You might want to check this tech note on common causes
of build breakage and ways to avoid them:

http://tinyurl.com/v5637

Hope this helps.

Regards,

Slava Imeshev
vimeshev at viewtier.com
www.viewtier.com


----- Original Message ----- 
From: "Danny Bird" <Danny.Bird at systemc.com>
To: <perforce-user at perforce.com>
Sent: Monday, January 15, 2007 5:45 AM
Subject: [p4] trigger change-content - compile before commit submission


> Hi
>
> Is it possible using the change-content trigger to sync out all the
> files within the changelist before they are committed so they can be
> compiled to make sure everything is fine with the files being submitted?
> The idea is to make sure the source software compilation is never
> broken.  Try as we may, compilation errors always slip in!
>
> I've got the change-commit working fine, which does a build on the
> changelist and emails the developers when they broke something, but
> would be nice to pre-empt the submission.
>
> My trigger runs a dos batch file that notifies a perforce build machine
> that will sync the files and build the projects - if the build fails
> then fail the submission.
>
> Is it possible?
>
> thanks
> danny
>
>
> This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom
they are addressed ("the addressee"). If you have received this email in error please notify the system manager at System C
Healthcare plc. This email and its attachments (if any) contain(s) confidential information the property of System C Healthcare plc
and is/are intended only for the addressee. If you are not the addressee you should not use, disseminate, distribute or copy this
e-mail or any attachment.
>
> System C Healthcare plc.
> Reg in England no: 1754990
> _______________________________________________
> perforce-user mailing list  -  perforce-user at perforce.com
> http://maillist.perforce.com/mailman/listinfo/perforce-user


More information about the perforce-user mailing list