This is an archive of the discontinued LLVM Phabricator instance.

Allow to apply cherry-picks when building Docker images.
ClosedPublic

Authored by ilya-biryukov on Dec 19 2017, 6:13 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

ilya-biryukov created this revision.Dec 19 2017, 6:13 AM
ioeric added inline comments.Dec 20 2017, 1:45 AM
utils/docker/scripts/build_install_llvm.sh
84 ↗(On Diff #127517)

Do we want to sort the "cherries" in case they are not ordered? Does the order matter?

  • Sort cherrypicks before applying them.
ilya-biryukov marked an inline comment as done.Dec 20 2017, 2:12 AM
ilya-biryukov added inline comments.
utils/docker/scripts/build_install_llvm.sh
84 ↗(On Diff #127517)

Good point. Applying them in the sorted order is the most natural choice.
Now sorting cherrypicks and removing duplicates before applying them.

ioeric added inline comments.Dec 20 2017, 2:21 AM
utils/docker/scripts/build_install_llvm.sh
185 ↗(On Diff #127673)

I'd do the sorting in apply_cherrypicks.

207 ↗(On Diff #127673)

IIUC,$CHERRYPICKS is a list of cherries for all llvm sub-projects, and we try applying them on each project, even if some of them might not apply for certain projects. Is this safe with svn? Might worth a comment.

ilya-biryukov marked an inline comment as done.Dec 20 2017, 6:16 AM
ilya-biryukov added inline comments.
utils/docker/scripts/build_install_llvm.sh
185 ↗(On Diff #127673)

Why not here? apply_cherrypicks is called multiple times, sorting outside of it seems natural.
Maybe we should define apply_cherrypicks after we do the sorting or add a comment to make it clear that it always applies cherrypicks in a sorted order instead?

207 ↗(On Diff #127673)

Fortunately we're good here, svn diff -c provides empty patches for revisions that don't touch specific repositories so we end up with a no-op.
Will add a comment.

  • Added a comment on applying cherrypicks to all repos
  • Restructured the code to make it clear apply_cherrypicks works on a sorted list of cherrypicks
ilya-biryukov marked 2 inline comments as done.Dec 20 2017, 6:22 AM
  • s/cherry-pick/cherrypick in a comment
ioeric accepted this revision.Dec 20 2017, 6:26 AM

lg after code comment is added.

Do we want to mention this change in the doc?

utils/docker/scripts/build_install_llvm.sh
185 ↗(On Diff #127673)

Sorting inside apply_cherrypicks, you wouldn't need to worry about the state of CHERRYPICKS. The sorting here should also be really cheap. But up to you. This is shell script after all :)

A comment in apply_cherrypicks requiring CHERRYPICKS to be sorted would still be nice.

This revision is now accepted and ready to land.Dec 20 2017, 6:26 AM
This revision was automatically updated to reflect the committed changes.