summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-07-26 15:50:09 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-08-24 11:10:15 +0200
commit98525094d44ceff0794cfb36c5494a7bd50c26a0 (patch)
tree511c812e14f2fd4b48c781f157122d5f5b3e8ff4
parent31d4bf625f88e2fc9b2057ad7bb7bd943d1c7871 (diff)
gbuild: strip away unexpected CR char at the end of Windows filenames
As reported at e.g. <https://ask.libreoffice.org/en/question/90346/building-libreoffice-in-cygwin-leads-to-infinite-loop/>, sometimes MSVC (seen with 2013 on libreoffice-5-2, but there is no indication that 2015 on master would be different) emits CR characters at the end of filenames, resulting in unnecessary rebuilds at per-module builds, and actually to an infinite loop when doing toplevel make. Given that CR characters are unexpected in any filenames, it should be safe to just strip those away unconditionally. Change-Id: I3d56670b4d930a32489f889085711bfd436de82a Reviewed-on: https://gerrit.libreoffice.org/40452 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit e9b9a456221b4b0660f90efa1ee092ea00c2c728)
-rwxr-xr-xsolenv/gbuild/platform/filter-showIncludes.awk7
1 files changed, 7 insertions, 0 deletions
diff --git a/solenv/gbuild/platform/filter-showIncludes.awk b/solenv/gbuild/platform/filter-showIncludes.awk
index 21a458521308..05a9a2c8d5ec 100755
--- a/solenv/gbuild/platform/filter-showIncludes.awk
+++ b/solenv/gbuild/platform/filter-showIncludes.awk
@@ -44,6 +44,13 @@ BEGIN {
if (index($0, showincludes_prefix) == 1) {
$0 = substr($0, length(showincludes_prefix) + 1)
sub(/^ */, "")
+
+ # The output from MSVC may contain a carriage return character at the
+ # end of filenames, in which case the translation unit will depend on a
+ # non-existing header, resulting in constant rebuild of all files,
+ # prevent that.
+ sub(/ /, "")
+
gsub(/\\/, "/")
gsub(/ /, "\\ ")
if ($0 ~ whitelist) { # filter out system headers