using unmerged PRs

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Thu Dec 25 12:50:28 PST 2014


On Thu, 25 Dec 2014 20:15:10 +0000
Vlad Levenfeld via Digitalmars-d <digitalmars-d at puremagic.com> wrote:

> I was looking at some of the PRs for DIPs and was wondering how
> to go ahead and use them in my code. A few of the forum regulars
> have mentioned applying their own patches before, and so I would
> like to ask those of you that do, what your preferred method is,
> or if this is an all-around bad idea and I should just wait for
> the PRs to be merged?

as for me, i have a build script for that. my directory structure looks
like this:

dmd_git
 dmd      # cloned git repo of dmd
 druntime # clone git of runtime
 phobos   # you got the idea
 tools    # and this too
 BUILD    # update and build scripts
 PATCHES  # here they all!
  dmd
  druntime
  phobos
  tools

build script in BUILD/ does `git reset --hard ; git clean -dxf` for all
repos, and then applies *.patch files found in corresponding subdirs of
PATHCES to corresponding components. it also does alphanumeric sorting
of patch files, so i can control the order of applying.

to temporarily disable some patch i can rename it to something like
"abc.patch.no" (any extension, actually).

also i'm adding some comments and dependencies to patch files. patch
utility ignores that.

my build script accept some args too:
% ./build.sh -h
--noreset  -- don't do 'git reset --hard'
--nopatch  -- don't do patching
--phobos   -- build phobos
--runtime  -- build runtime
--dmd      -- build dmd
--debug    -- enable debug build
--all      -- build all (default)
--cdgc     -- build with CDGC

this is not the best way to manage patches, it simply emerges from
my simplistic build scripts as i was adding features over time.

i also has 'install.sh' script, which installs fresh DMD into my local
binary dir, writes proper dmd.conf, builds tools and copies them to the
place where DMD binary is.

and 'update.sh' script, which updates all components and writes update
logs. update logs are just a snippets of 'git log' -- from the new HEAD
till the old HEAD, so i can easily read what's new here while building
fresh DMD in another terminal.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20141225/37cc23a3/attachment.sig>


More information about the Digitalmars-d mailing list