1

I just created a new site with buildkit:

$ civibuild create foo --url http://foo --type drupal-demo

Then I went into CiviCRM and looked at the git repo

$ cd ~/buildkit/build/foo/sites/all/modules/civicrm
$ git status

and I see:

    modified:   CRM/Case/DAO/Case.php
    modified:   CRM/Core/DAO/AllCoreTables.data.php
    modified:   CRM/Financial/DAO/PaymentProcessor.php

Why? I would expect the repo to be clean after a fresh install. The diffs for these files show a different value for GenCodeChecksum within the docblock header for the file, and that's the entirety of the uncommitted changes. What's going on here?

1 Answer 1

1

tldr: It's safe but mildly annoying. Please feel free to send a pull-request to update these files.

Longer: DAO files are auto-generated when civibuild calls the script xml/GenCode.php with the data in xml/schema. However, running GenCode is traditionally pretty slow -- even on a fast workstation, it can add 30 seconds to the build-time.

Starting somewhere in 4.7.x, we did an optimization: if the checksum looks right, then GenCode keeps the DAO. (Hooray, faster!) If the checksum looks wrong, then it regenerates the DAO.

In a typical scenario, you might edit a file in xml/schema, then run GenCode, then observe several changes to your local DAO. The GenCodeChecksum would be one of several changes. You'd commit those changes and send them in with the PR.

Right now, I see something like what you describe -- the only difference between the upstream DAO and the local DAO is the checksum. This can happen occasionally (eg if there were contemporaneous PRs manipulating schema and the precise order-of-operations was unfavorable). The consequences are:

  • GenCode spends an extra second regenerating 1-3 files.
  • Your git diff shows something unexpected on 1-3 files.

That's mildly annoying - but you still wind up with the right code, so it's safe.

You can fix it by submitting a PR to update the DAO's with the latest GenCodeChecksum.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.