Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[install] fix Issue 11579 - dlang.org repo can't be built without git #422

Merged
merged 5 commits into from Dec 29, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
77 changes: 38 additions & 39 deletions posix.mak
Expand Up @@ -22,7 +22,7 @@ DPL_DOCS_FLAGS=--std-macros=std-ddox.ddoc --override-macros=std-ddox-override.dd
# Latest released version
ifeq (,${LATEST})
LATEST:=$(shell cd ${DMD_DIR} && \
git fetch --tags https://github.com/D-Programming-Language/dmd && \
git fetch --tags ${GIT_HOME}/dmd && \
git tag | grep '^v[0-9][0-9.]*$$' | sed 's/^v//' | sort -nr | head -n 1)
endif
ifeq (,${LATEST})
Expand Down Expand Up @@ -167,7 +167,7 @@ clean:
rm -rf $(DOC_OUTPUT_DIR) ${LATEST}.ddoc
rm -rf auto dlangspec-tex.d $(addprefix dlangspec,.aux .d .dvi .fdb_latexmk .fls .log .out .pdf .tex)
rm -f docs.json docs-prerelease.json
@echo You should issue manually: rm -rf ${DMD_DIR}.${LATEST} ${DRUNTIME_DIR}.${LATEST} ${PHOBOS_DIR}.${LATEST}
@echo You should issue manually: rm -rf ${DMD_DIR}-${LATEST} ${DRUNTIME_DIR}-${LATEST} ${PHOBOS_DIR}-${LATEST}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What motivates this change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the name of the tarball root directory (e.g. dmd-2.064.2). The same naming scheme is used/expected by rpmbuild and the deb packaging tool.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, fine with this


rsync : all
rsync -avz $(DOC_OUTPUT_DIR)/ d-programming@digitalmars.com:data/
Expand Down Expand Up @@ -238,65 +238,70 @@ $(DOC_OUTPUT_DIR)/dlangspec.pdf : dlangspec.dvi
dvipdf $^ $@

################################################################################
# dmd compiler, latest released build and current build
# Git clone rules
################################################################################

${DMD_DIR}.${LATEST}/src/dmd :
[ -d ${DMD_DIR}.${LATEST} ] || \
git clone ${GIT_HOME}/dmd ${DMD_DIR}.${LATEST}/
cd ${DMD_DIR}.${LATEST} && git checkout v${LATEST}
${MAKE} --directory=${DMD_DIR}.${LATEST}/src -f posix.mak clean
${MAKE} --directory=${DMD_DIR}.${LATEST}/src -f posix.mak -j 4
# HEAD
../%/.cloned :
[ -d $(@D) ] || git clone ${GIT_HOME}/$* $(@D)/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would we care to git pull if the directory does exist?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only for a clean master maybe, anything else could have unwanted effect.
I don't think it's a good idea.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then the name of the witness is confusing, should be .cloned or .directory - sorry, I know you've been there before and it's exasperating. But if I see .checkout I think of a witness for the last checkout.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

touch $@

# LATEST
../%-${LATEST}/.cloned :
[ -d $(@D) ] || git clone ${GIT_HOME}/$* $(@D)/
if [ -d $(@D)/.git ]; then cd $(@D) && git checkout v${LATEST}; fi
touch $@

${DMD_DIR}/src/dmd :
[ -d ${DMD_DIR} ] || git clone ${GIT_HOME}/dmd ${DMD_DIR}/
################################################################################
# dmd compiler, latest released build and current build
################################################################################

${DMD_DIR}/src/dmd : ${DMD_DIR}/.cloned
${MAKE} --directory=${DMD_DIR}/src -f posix.mak clean
${MAKE} --directory=${DMD_DIR}/src -f posix.mak -j 4

${DMD_DIR}-${LATEST}/src/dmd : ${DMD_DIR}-${LATEST}/.cloned
${MAKE} --directory=${DMD_DIR}-${LATEST}/src -f posix.mak clean
${MAKE} --directory=${DMD_DIR}-${LATEST}/src -f posix.mak -j 4

################################################################################
# druntime, latest released build and current build
################################################################################

druntime-prerelease : ${DOC_OUTPUT_DIR}/phobos-prerelease/object.html
druntime-prerelease : ${DRUNTIME_DIR}/.cloned ${DOC_OUTPUT_DIR}/phobos-prerelease/object.html
${DOC_OUTPUT_DIR}/phobos-prerelease/object.html : ${DMD_DIR}/src/dmd
rm -f $@
${MAKE} --directory=${DRUNTIME_DIR} -f posix.mak -j 4 \
DOCDIR=${DOC_OUTPUT_DIR}/phobos-prerelease \
DOCFMT=`pwd`/std.ddoc

druntime-release : ${DOC_OUTPUT_DIR}/phobos/object.html
${DOC_OUTPUT_DIR}/phobos/object.html : ${DMD_DIR}.${LATEST}/src/dmd
druntime-release : ${DRUNTIME_DIR}-${LATEST}/.cloned ${DOC_OUTPUT_DIR}/phobos/object.html
${DOC_OUTPUT_DIR}/phobos/object.html : ${DMD_DIR}-${LATEST}/src/dmd
rm -f $@
[ -d ${DRUNTIME_DIR}.${LATEST} ] || \
git clone ${GIT_HOME}/druntime ${DRUNTIME_DIR}.${LATEST}/
cd ${DRUNTIME_DIR}.${LATEST} && git checkout v${LATEST}
${MAKE} --directory=${DRUNTIME_DIR}.${LATEST} -f posix.mak clean
${MAKE} --directory=${DRUNTIME_DIR}.${LATEST} -f posix.mak \
DMD=${DMD_DIR}.${LATEST}/src/dmd \
${MAKE} --directory=${DRUNTIME_DIR}-${LATEST} -f posix.mak clean
${MAKE} --directory=${DRUNTIME_DIR}-${LATEST} -f posix.mak \
DMD=${DMD_DIR}-${LATEST}/src/dmd \
DOCDIR=${DOC_OUTPUT_DIR}/phobos \
DOCFMT=`pwd`/std.ddoc -j 4

################################################################################
# phobos, latest released build and current build
################################################################################

phobos-prerelease : ${DOC_OUTPUT_DIR}/phobos-prerelease/index.html
phobos-prerelease : ${PHOBOS_DIR}/.cloned ${DOC_OUTPUT_DIR}/phobos-prerelease/index.html
${DOC_OUTPUT_DIR}/phobos-prerelease/index.html : std.ddoc \
${DOC_OUTPUT_DIR}/phobos-prerelease/object.html
${MAKE} --directory=${PHOBOS_DIR} -f posix.mak \
DOC_OUTPUT_DIR=${DOC_OUTPUT_DIR}/phobos-prerelease html -j 4

phobos-release: ${DOC_OUTPUT_DIR}/phobos/index.html
phobos-release : ${PHOBOS_DIR}-${LATEST}/.cloned ${DOC_OUTPUT_DIR}/phobos/index.html
${DOC_OUTPUT_DIR}/phobos/index.html : std.ddoc ${LATEST}.ddoc \
${DOC_OUTPUT_DIR}/phobos/object.html
[ -d ${PHOBOS_DIR}.${LATEST} ] || \
git clone ${GIT_HOME}/phobos ${PHOBOS_DIR}.${LATEST}/
cd ${PHOBOS_DIR}.${LATEST} && git checkout v${LATEST}
${MAKE} --directory=${PHOBOS_DIR}.${LATEST} -f posix.mak -j 4 \
${MAKE} --directory=${PHOBOS_DIR}-${LATEST} -f posix.mak -j 4 \
release html \
DMD=${DMD_DIR}.${LATEST}/src/dmd \
DDOC=${DMD_DIR}.${LATEST}/src/dmd \
DRUNTIME_PATH=${DRUNTIME_DIR}.${LATEST} \
DMD=${DMD_DIR}-${LATEST}/src/dmd \
DDOC=${DMD_DIR}-${LATEST}/src/dmd \
DRUNTIME_PATH=${DRUNTIME_DIR}-${LATEST} \
DOC_OUTPUT_DIR=${DOC_OUTPUT_DIR}/phobos \
STDDOC="`pwd`/$(LATEST).ddoc `pwd`/std.ddoc"

Expand All @@ -319,17 +324,11 @@ apidocs-serve : docs-prerelease.json
--override-macros=std-ddox-override.ddoc --package-order=std\
--git-target=master --web-file-dir=. docs-prerelease.json

docs.json : ${DMD_DIR}.${LATEST}/src/dmd
docs.json : ${DMD_DIR}-${LATEST}/src/dmd ${DRUNTIME_DIR}-${LATEST}/.cloned ${PHOBOS_DIR}-${LATEST}/.cloned
mkdir .tmp || true
[ -d ${DRUNTIME_DIR}.${LATEST} ] || \
git clone ${GIT_HOME}/druntime ${DRUNTIME_DIR}.${LATEST}/
cd ${DRUNTIME_DIR}.${LATEST} && git checkout v${LATEST}
[ -d ${PHOBOS_DIR}.${LATEST} ] || \
git clone ${GIT_HOME}/phobos ${PHOBOS_DIR}.${LATEST}/
cd ${PHOBOS_DIR}.${LATEST} && git checkout v${LATEST}
find ${DRUNTIME_DIR}.${LATEST}/src -name '*.d' | sed -e /unittest.d/d -e /gcstub/d > .tmp/files.txt
find ${PHOBOS_DIR}.${LATEST} -name '*.d' | sed -e /unittest.d/d -e /format/d -e /windows/d >> .tmp/files.txt
${DMD_DIR}.${LATEST}/src/dmd -c -o- -version=StdDdoc -Df.tmp/dummy.html -Xfdocs.json @.tmp/files.txt
find ${DRUNTIME_DIR}-${LATEST}/src -name '*.d' | sed -e /unittest.d/d -e /gcstub/d > .tmp/files.txt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not an issue with this diff, but depending on wildcards to find the appropriate files is a bit risky.

find ${PHOBOS_DIR}-${LATEST} -name '*.d' | sed -e /unittest.d/d -e /format/d -e /windows/d >> .tmp/files.txt
${DMD_DIR}-${LATEST}/src/dmd -c -o- -version=StdDdoc -Df.tmp/dummy.html -Xfdocs.json @.tmp/files.txt
${DPL_DOCS} filter docs.json --min-protection=Protected --only-documented
rm -r .tmp

Expand Down