Skip to content

Commit

Permalink
Merge 'rickard/make-fixes-20/OTP-15551' into 'rickard/make-fixes-21/O…
Browse files Browse the repository at this point in the history
…TP-15551'

    * rickard/make-fixes-20/OTP-15551:
        Fix install phase in build system

        - Install of (mainly) documentation caused rebuild and
          modification of the source tree even when the source
          previously had been built. Also otp_patch_apply
          modified the source tree when updating documentation.
          This messed up the installation if installation was
          performed by another user than the user that originally
          built the system which not is an uncommon scenario.

        - Some documentation was installed by copying files
          instead of installing the files which caused faulty
          access rights on files.

        - The documentation was not properly updated when
          applying a patch using otp_patch_apply.
  • Loading branch information
rickard-green committed Mar 4, 2019
2 parents 934f997 + 2599dcf commit b32a929
Show file tree
Hide file tree
Showing 46 changed files with 215 additions and 137 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ JAVADOC-GENERATED
/make/output.mk
/make/emd2exml
/make/make_emakefile
/make/install_dir_data.sh

# Created by "out_build update_primary"
/bootstrap/primary_compiler/
Expand Down Expand Up @@ -307,6 +308,7 @@ JAVADOC-GENERATED
/lib/jinterface/doc/html/java
/lib/jinterface/pom.xml
/lib/jinterface/target
/lib/jinterface/doc/src/jdoc

# kernel

Expand Down Expand Up @@ -361,7 +363,6 @@ JAVADOC-GENERATED
/system/doc/html
/system/doc/xml
/system/doc/top/PR.template
/system/doc/top/erlresolvelinks.js

# test_server

Expand Down
8 changes: 5 additions & 3 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ endif
PATH=$(BOOT_PREFIX)"$${PATH}" \
ERL_TOP=$(ERL_TOP) $(MAKE) TESTROOT="$(RELEASE_ROOT)" DOCGEN=$(BOOTSTRAP_ROOT)/bootstrap/lib/erl_docgen $@
ifneq ($(OTP_SMALL_BUILD),true)
echo "OTP doc built" > $(ERL_TOP)/make/otp_doc_built
test -f $(ERL_TOP)/make/otp_doc_built || echo "OTP doc built" > $(ERL_TOP)/make/otp_doc_built
endif

xmllint: docs
Expand All @@ -450,7 +450,9 @@ else
$(MAKE) -C system/doc $@
endif

mod2app:
mod2app: $(ERL_TOP)/make/$(TARGET)/mod2app.xml

$(ERL_TOP)/make/$(TARGET)/mod2app.xml: erts/doc/src/Makefile lib/*/doc/src/Makefile
PATH=$(BOOT_PREFIX)"$${PATH}" escript $(BOOTSTRAP_ROOT)/bootstrap/lib/erl_docgen/priv/bin/xref_mod_app.escript -topdir $(ERL_TOP) -outfile $(ERL_TOP)/make/$(TARGET)/mod2app.xml

# ----------------------------------------------------------------------
Expand Down Expand Up @@ -488,7 +490,7 @@ else
$(make_verbose)cd lib && \
ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)"$${PATH}" \
$(MAKE) opt BUILD_ALL=true
$(V_at)echo "OTP built" > $(ERL_TOP)/make/otp_built
$(V_at)test -f $(ERL_TOP)/make/otp_built || echo "OTP built" > $(ERL_TOP)/make/otp_built
endif
kernel:
$(make_verbose)cd lib/kernel && \
Expand Down
3 changes: 2 additions & 1 deletion erts/configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -4326,12 +4326,13 @@ AC_CONFIG_FILES([../make/make_emakefile:../make/make_emakefile.in],
dnl
dnl The ones below should be moved to their respective lib
dnl
dnl ../lib/ssl/c_src/$host/Makefile:../lib/ssl/c_src/Makefile.in
AC_CONFIG_FILES([
../lib/os_mon/c_src/$host/Makefile:../lib/os_mon/c_src/Makefile.in
../lib/crypto/c_src/$host/Makefile:../lib/crypto/c_src/Makefile.in
../lib/runtime_tools/c_src/$host/Makefile:../lib/runtime_tools/c_src/Makefile.in
../lib/tools/c_src/$host/Makefile:../lib/tools/c_src/Makefile.in
])

AC_CONFIG_FILES([../make/install_dir_data.sh:../make/install_dir_data.sh.in], [chmod +x ../make/install_dir_data.sh])

AC_OUTPUT
3 changes: 1 addition & 2 deletions lib/debugger/doc/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
$(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
$(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
$(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
($(CP) -rf $(HTMLDIR) "$(RELSYSDIR)/doc")
$(INSTALL_DIR_DATA) $(HTMLDIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
$(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
$(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
Expand Down
10 changes: 2 additions & 8 deletions lib/jinterface/doc/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ clean clean_docs:
jdoc:$(JAVA_SRC_FILES)
(cd ../../java_src;$(JAVADOC) -sourcepath . -d $(JAVADOC_DEST) \
-windowtitle $(JAVADOC_TITLE) $(JAVADOC_PKGS))
touch jdoc

man:

Expand All @@ -152,15 +153,8 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
$(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
$(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
$(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DIR) "$(RELSYSDIR)/doc/html/java/$(JAVA_PKG_PATH)"
$(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
($(CP) -rf ../html "$(RELSYSDIR)/doc")

# $(INSTALL_DATA) $(GIF_FILES) $(EXTRA_FILES) $(HTML_FILES) \
# "$(RELSYSDIR)/doc/html"
# $(INSTALL_DATA) $(JAVA_EXTRA_FILES) "$(RELSYSDIR)/doc/html/java"
# $(INSTALL_DATA) $(TOP_HTML_FILES) "$(RELSYSDIR)/doc"
$(INSTALL_DIR_DATA) $(HTMLDIR) "$(RELSYSDIR)/doc/html"


release_spec:
70 changes: 70 additions & 0 deletions make/install_dir_data.sh.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/bin/sh
#
# %CopyrightBegin%
#
# Copyright Ericsson AB 2019. All Rights Reserved.
#
# The contents of this file are subject to the Erlang Public License,
# Version 1.1, (the "License"); you may not use this file except in
# compliance with the License. You should have received a copy of the
# Erlang Public License along with this software. If not, it can be
# retrieved online at http://www.erlang.org/.
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and limitations
# under the License.
#
# %CopyrightEnd%
#

#
# install_dir_data.sh <SourceDir> <DestDir>
#
# Install all content in <SourceDir> including subdirectories
# into <DestDir>.
#

INSTALL="@INSTALL@"
INSTALL_DIR="@INSTALL_DIR@"
INSTALL_DATA="@INSTALL_DATA@"

debug=yes

error () {
echo "ERROR: $1" 1>&2
exit 1
}

usage () {
error "$1\n Usage $progname <SourceDir> <DestDir>"
}

cmd () {
[ $debug = no ] || echo "$@"
"$@" || exit 1
}

progname="$0"

[ $# -eq 2 ] || usage "Invalid amount of arguments"

src="$1"
dest="$2"

cmd cd "$src"

for dir in `find . -type d`; do
destdir="$dest"
[ "$dir" = "." ] || destdir="$dest/$dir"
cmd $INSTALL_DIR "$destdir"
done

for file in `find . -type f`; do
subdir=`dirname "$file"`
destdir="$dest"
[ "$subdir" = "." ] || destdir="$dest/$subdir"
cmd $INSTALL_DATA "$file" "$destdir"
done

exit 0
3 changes: 3 additions & 0 deletions make/otp.mk.in
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ INSTALL_DIR = @INSTALL_DIR@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_DIR_DATA = $(ERL_TOP)/make/install_dir_data.sh

CC = @CC@
GCC = @GCC@
Expand Down Expand Up @@ -273,7 +274,9 @@ DEFAULT_GIF_FILES = $(HTMLDIR)/min_head.gif
XSLTPROC = @XSLTPROC@
FOP = @FOP@
XMLLINT = @XMLLINT@
RM = @RM@
CP = @CP@
MKDIR = @MKDIR@

DOCGEN=$(ERL_TOP)/lib/erl_docgen
FOP_CONFIG = $(DOCGEN)/priv/fop.xconf
Expand Down
6 changes: 2 additions & 4 deletions otp_patch_apply
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# %CopyrightEnd%
#

version="1.0.1"
version="1.0.2"

force=
lib_path=
Expand Down Expand Up @@ -388,9 +388,7 @@ if [ $install_docs = yes ]; then
TESTROOT="$idir" release_docs) || exit 1
done

(cd "$sdir/system/doc/top" && $MAKE clean)

(cd "$sdir/system/doc/top" && \
(cd "$sdir/system/doc" && \
$MAKE MAKE="$MAKE" RELEASE_ROOT="$idir" RELEASE_PATH="$idir" \
TESTROOT="$idir" release_docs) || exit 1

Expand Down
5 changes: 2 additions & 3 deletions system/doc/design_principles/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ DVIPS_FLAGS +=
# ----------------------------------------------------
# Targets
# ----------------------------------------------------
_create_dirs := $(shell mkdir -p $(HTMLDIR))

$(HTMLDIR)/%.gif: %.gif
$(INSTALL_DATA) $< $@
Expand All @@ -107,8 +106,8 @@ images: $(IMAGE_FILES:%=$(HTMLDIR)/%)
debug opt:

clean clean_docs:
rm -rf $(HTMLDIR)
rm -rf $(XMLDIR)
rm -f $(XMLDIR)/*.xml
rm -f $(HTMLDIR)/*.gif $(HTMLDIR)/*.html
rm -f $(TOP_PDF_FILE) $(TOP_PDF_FILE:%.pdf=%.fo)
rm -f errs core *~

Expand Down
5 changes: 2 additions & 3 deletions system/doc/efficiency_guide/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ DVIPS_FLAGS +=
# ----------------------------------------------------
# Targets
# ----------------------------------------------------
_create_dirs := $(shell mkdir -p $(HTMLDIR))

docs: html

Expand All @@ -98,8 +97,8 @@ html: $(GIF_FILES) $(HTML_UG_FILE)
debug opt:

clean clean_docs:
rm -rf $(HTMLDIR)
rm -rf $(XMLDIR)
rm -f $(XMLDIR)/*.xml
rm -f $(HTMLDIR)/*.gif $(HTMLDIR)/*.html
rm -f $(TOP_PDF_FILE) $(TOP_PDF_FILE:%.pdf=%.fo)
rm -f errs core *~

Expand Down
5 changes: 2 additions & 3 deletions system/doc/embedded/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ DVIPS_FLAGS +=
# ----------------------------------------------------
# Targets
# ----------------------------------------------------
_create_dirs := $(shell mkdir -p $(HTMLDIR))

docs: html

Expand All @@ -86,8 +85,8 @@ html: $(GIF_FILES) $(HTML_UG_FILE)
debug opt:

clean clean_docs:
rm -rf $(HTMLDIR)
rm -rf $(XMLDIR)
rm -f $(XMLDIR)/*.xml
rm -f $(HTMLDIR)/*.gif $(HTMLDIR)/*.html
rm -f $(TOP_PDF_FILE) $(TOP_PDF_FILE:%.pdf=%.fo)
rm -f errs core *~

Expand Down
5 changes: 2 additions & 3 deletions system/doc/getting_started/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ DVIPS_FLAGS +=
# ----------------------------------------------------
# Targets
# ----------------------------------------------------
_create_dirs := $(shell mkdir -p $(HTMLDIR))

docs: html

Expand All @@ -85,8 +84,8 @@ html: $(GIF_FILES) $(HTML_UG_FILE)
debug opt:

clean clean_docs:
rm -rf $(HTMLDIR)
rm -rf $(XMLDIR)
rm -f $(XMLDIR)/*.xml
rm -f $(HTMLDIR)/*.gif $(HTMLDIR)/*.html
rm -f $(TOP_PDF_FILE) $(TOP_PDF_FILE:%.pdf=%.fo)
rm -f errs core *~

Expand Down
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file added system/doc/html/js/.gitignore
Empty file.
Empty file added system/doc/html/oam/.gitignore
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
5 changes: 2 additions & 3 deletions system/doc/installation_guide/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ $(XMLDIR)/%.xml: $(ERL_TOP)/HOWTO/%.md $(ERL_TOP)/make/emd2exml
$(ERL_TOP)/make/emd2exml $< $@

$(REDIRECT_HTML_DIR)/%.html: Makefile
test -d $(REDIRECT_HTML_DIR) || $(INSTALL_DIR) $(REDIRECT_HTML_DIR)
echo "<html><head><meta HTTP-EQUIV=\"REFRESH\"" > $@
echo " content=\"5; url=../"$(notdir $@)"\">" >> $@
echo "<title>This page has moved</title></head><body>" >> $@
Expand All @@ -112,8 +111,8 @@ debug opt:

clean clean_docs:
rm -f $(GENERATED_XML_FILES)
rm -rf $(HTMLDIR)
rm -rf $(XMLDIR)
rm -f $(XMLDIR)/*.xml
rm -f $(HTMLDIR)/*.gif $(HTMLDIR)/*.html
rm -f $(TOP_PDF_FILE) $(TOP_PDF_FILE:%.pdf=%.fo)
rm -f errs core *~

Expand Down
7 changes: 3 additions & 4 deletions system/doc/oam/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,9 @@ DVIPS_FLAGS +=
# ----------------------------------------------------
# Targets
# ----------------------------------------------------
_create_dirs := $(shell mkdir -p $(HTMLDIR))

$(HTMLDIR)/%.gif: %.gif
$(INSTALL_DATA) $< $@
$(CP) $< $@

docs: html

Expand All @@ -87,8 +86,8 @@ gifs: $(GIF_FILES:%=$(HTMLDIR)/%)
debug opt:

clean clean_docs:
rm -rf $(HTMLDIR)
rm -rf $(XMLDIR)
rm -f $(XMLDIR)/*.xml
rm -f $(HTMLDIR)/*.gif $(HTMLDIR)/*.html
rm -f $(TOP_PDF_FILE) $(TOP_PDF_FILE:%.pdf=%.fo)
rm -f errs core *~

Expand Down
5 changes: 2 additions & 3 deletions system/doc/programming_examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ DVIPS_FLAGS +=
# ----------------------------------------------------
# Targets
# ----------------------------------------------------
_create_dirs := $(shell mkdir -p $(HTMLDIR))

docs: html
local_docs: PDFDIR=../../pdf
Expand All @@ -84,8 +83,8 @@ html: $(GIF_FILES) $(HTML_UG_FILE)
debug opt:

clean clean_docs:
rm -rf $(HTMLDIR)
rm -rf $(XMLDIR)
rm -f $(XMLDIR)/*.xml
rm -f $(HTMLDIR)/*.gif $(HTMLDIR)/*.html
rm -f $(TOP_PDF_FILE) $(TOP_PDF_FILE:%.pdf=%.fo)
rm -f errs core *~

Expand Down
5 changes: 2 additions & 3 deletions system/doc/reference_manual/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ DVIPS_FLAGS +=
# ----------------------------------------------------
# Targets
# ----------------------------------------------------
_create_dirs := $(shell mkdir -p $(HTMLDIR))

docs: html

Expand All @@ -95,8 +94,8 @@ html: $(GIF_FILES) $(HTML_UG_FILE)
debug opt:

clean clean_docs:
rm -rf $(HTMLDIR)
rm -rf $(XMLDIR)
rm -f $(XMLDIR)/*.xml
rm -f $(HTMLDIR)/*.gif $(HTMLDIR)/*.html
rm -f $(TOP_PDF_FILE) $(TOP_PDF_FILE:%.pdf=%.fo)
rm -f errs core *~

Expand Down
5 changes: 2 additions & 3 deletions system/doc/system_architecture_intro/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ DVIPS_FLAGS +=
# ----------------------------------------------------
# Targets
# ----------------------------------------------------
_create_dirs := $(shell mkdir -p $(HTMLDIR))

docs: html

Expand All @@ -80,8 +79,8 @@ html: $(GIF_FILES) $(HTML_UG_FILE)
debug opt:

clean clean_docs:
rm -rf $(HTMLDIR)
rm -rf $(XMLDIR)
rm -f $(XMLDIR)/*.xml
rm -f $(HTMLDIR)/*.gif $(HTMLDIR)/*.html
rm -f $(TOP_PDF_FILE) $(TOP_PDF_FILE:%.pdf=%.fo)
rm -f errs core *~

Expand Down
Loading

0 comments on commit b32a929

Please sign in to comment.