Replies: 4 comments 12 replies
-
Something to play with:
#!/usr/bin/env bash
set -euo pipefail
rm -rf dmd-mono
git clone [email protected]:dlang/dmd.git dmd-mono
cd dmd-mono
git checkout first-merged-dmd-druntime
git checkout -b ldc-monorepo-init
git subtree pull --prefix druntime [email protected]:ldc-developers/druntime.git ldc-pre-monorepo -m "Merge LDC druntime patches"
# extract a subset of the dmd monorepo (druntime source + tests + Makefiles, dmd source + tests + osmodel.mak)
git filter-repo --force \
--path druntime/src --path druntime/test --path-glob 'druntime/*.mak' \
--path compiler/src/dmd --path compiler/test --path compiler/src/osmodel.mak \
--path src --path test # required to keep git history before upstream druntime-merge (and associated directory movals)
# remove unused files
git filter-repo --invert-paths \
--path-regex '(compiler/)?src/dmd/backend' \
--path-regex '(compiler/)?src/dmd/root/(env|response|strtold)\.d' \
--path-regex '(compiler/)?src/dmd/astbase\.d' \
--path-regex '(compiler/)?src/dmd/cpreprocess\.d' \
--path-regex '(compiler/)?src/dmd/dinifile\.d' \
--path-regex '(compiler/)?src/dmd/dmdparams\.d' \
--path-regex '(compiler/)?src/dmd/dmsc\.d' \
--path-regex '(compiler/)?src/dmd/eh\.d' \
--path-regex '(compiler/)?src/dmd/frontend\.d' \
--path-regex '(compiler/)?src/dmd/scan(elf|mach|mscoff|omf)\.d' \
--path-regex '(compiler/)?src/dmd/lib(|elf|mach|mscoff|omf)\.d' \
--path-regex '(compiler/)?src/dmd/link\.d' \
--path-regex '(compiler/)?src/dmd/(e|s)2ir\.d' \
--path-regex '(compiler/)?src/dmd/to(csym|ctype|cvdebug|dt|ir|obj)\.d' \
--path-regex '(compiler/)?src/dmd/iasm(|dmd)\.d' \
--path-regex '(compiler/)?src/dmd/(objc_)?glue\.d' \
--path-glob 'src/*.mak' # remaining Makefiles after moving dmd into compiler/
git filter-repo \
`# move dirs/files` \
--path-rename compiler/src/dmd/:dmd/ \
--path-rename druntime/:runtime/druntime/ \
--path-rename compiler/test/:tests/d2/dmd-testsuite/ \
--path-rename compiler/src/osmodel.mak:tests/d2/src/osmodel.mak \
`# prefix tags` \
--tag-rename :dmd-rewrite- \
`# replace GitHub refs in commit messages` \
--replace-message ../message-filters.txt
|
Beta Was this translation helpful? Give feedback.
-
I'd also like to take the opportunity to move dmd-testsuite (as we'll be stuck with the rewritten directory structure):
|
Beta Was this translation helpful? Give feedback.
-
An argument against automating the As it stands, a manual update is doable in less than 2 mins on my box, compared to currently 5+ mins (not measured) for updating |
Beta Was this translation helpful? Give feedback.
-
Hey @kinke , great that you are working on this (and all the other LDC stuff), sorry I don't have much time to contribute. I don't know how many downstream LDC forks there are, I only know of Weka's fork. Don't worry about Weka's fork. Weka's druntime deltas are small, and I will probably just manually reapply the changes to the monorepo. For the new DMD file problem. Probably new files are added rarely.
where |
Beta Was this translation helpful? Give feedback.
-
Hey guys!
I'm planning on significantly changing/simplifying the way we merge a new frontend incl. runtime libraries, now that upstream druntime has been merged into upstream dmd.
The rough idea is this:
git filter-repo
, via something like this:ldc-developers/dmd-rewrite
repo (or toldc
directly, with renamed branches + tags), and use a scheduled nightly CI job to keep it up-to-date.Then one-time: merge our ldc repo with this (tag
first-merged-dmd-druntime
), right after merging #4141, and replacing the current druntime and dmd-testsuite submodules. Keep our frontend file versions with all LDC specifics, as well as thetests/d2/*
files with our tweaks.In the future, bumping frontend + runtime libraries should be as simple as merging the new tag (or stable branch) of the rewritten DMD repo, and bumping our Phobos submodule (still separate). So frontend, tests and druntime are bumped at once, and we'll have a git history for the frontend files too, with refs to the upstream PRs etc.
Any thoughts, concerns, previous experiences, tips… from your side? @JohanEngelen @thewilsonator @dnadlinger @redstar
Beta Was this translation helpful? Give feedback.
All reactions