lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fix build failure on GNU Hurd (issue 319400043 by address@hidden)


From: pkx166h
Subject: Fix build failure on GNU Hurd (issue 319400043 by address@hidden)
Date: Fri, 24 Feb 2017 07:12:42 -0800

Reviewers: ,

Message:
This passes make and a full make doc, but I cannot run the usual pattern
of

make,
make test-baseline
apply patch
make clean
make
make check
make doc

It fails on the second 'make' (after make clean) ..

--snip---

tml
mkdir -p ./out
touch ./out/dummy.dep
echo '*' > ./out/.gitignore
For tracking crashes: use

    grep sourcefilename `grep -L systems.texi
out/lybook-testdb/*/*log|sed s/log/ly/g`

make --no-builtin-rules -C input/regression out=test local-test
make[1]: Entering directory
'/home/jlowe/lilypond-git/build/input/regression'
mkdir -p ./out-test
touch ./out-test/dummy.dep
echo '' > ./out-test/.gitignore
rm -f ./out-test/collated-files.html
if test -d /home/jlowe/lilypond-git/.git ; then \ echo -e 'HEAD
is:\n\n\t' ; \ (cd /home/jlowe/lilypond-git && git log --max-count=1
--pretty=oneline ) ;\ echo -e '\n\n\n' ; \ (cd /home/jlowe/lilypond-git
&& git diff ) ; \ fi > ./out-test/tree.gittxt
make LILYPOND_BOOK_LILYPOND_FLAGS="-dbackend=eps --formats=ps
-djob-count=4 -dseparate-log-files -dinclude-eps-fonts
-dgs-load-lily-fonts --header=texidoc -I
/home/jlowe/lilypond-git/Documentation/included/ -ddump-profile
-dcheck-internal-types -ddump-signatures -danti-alias-factor=1"
LILYPOND_BOOK_WARN= ./out-test/collated-files.html
LYS_OUTPUT_DIR=/home/jlowe/lilypond-git/build/out/lybook-testdb
make[2]: Entering directory
'/home/jlowe/lilypond-git/build/input/regression'
/usr/bin/python -tt
/home/jlowe/lilypond-git/scripts/build/create-version-itexi.py >
out-test/version.itexi
/usr/bin/python -tt
/home/jlowe/lilypond-git/scripts/build/create-weblinks-itexi.py >
out-test/weblinks.itexi
/home/jlowe/lilypond-git/build/scripts/build/out/lys-to-tely
--name=./out-test/collated-files.tely --title="LilyPond Regression
Tests" --author="Han-Wen Nienhuys and Jan Nieuwenhuizen"
--input-filename=out-test/collated-files.list
/bin/sh: 1:
/home/jlowe/lilypond-git/build/scripts/build/out/lys-to-tely: not found
/home/jlowe/lilypond-git/./make/lysdoc-rules.make:19: recipe for target
'out-test/collated-files.tely' failed
make[2]: [out-test/collated-files.tely] Error 127
make[2]: Waiting for unfinished jobs....
Traceback (most recent call last):
File "/home/jlowe/lilypond-git/scripts/build/create-weblinks-itexi.py",
line 15, in <module>
import langdefs
ImportError: No module named langdefs
/home/jlowe/lilypond-git/stepmake/stepmake/texinfo-rules.make:95: recipe
for target 'out-test/weblinks.itexi' failed
make[2]: [out-test/weblinks.itexi] Error 1
make[2]: Leaving directory
'/home/jlowe/lilypond-git/build/input/regression'
/home/jlowe/lilypond-git/./make/lysdoc-targets.make:12: recipe for
target 'local-test' failed
make[1]: [local-test] Error 2
make[1]: Leaving directory
'/home/jlowe/lilypond-git/build/input/regression'
/home/jlowe/lilypond-git/GNUmakefile.in:308: recipe for target 'test'
failed
make: ** [test] Error 2

--snip--

Is this something that is bound to happen and cannot be tested normally
or is this something that the patch submitter didn't take into account
on our side or something else such as a specific configuration
environment that isn't universal?

Description:
Fix build failure on GNU Hurd

Issue 5077

LilyPond failed to build on
GNU Hurd because Hurd does
not have PATH_MAX.

The cause seem to be a typo
in the file
debian/patches/hurd_file_name_support,
checking for _GNU_SOURCE_
instead of _GNU_SOURCE
(at least that is what
the getcwd() manual page
claim to look for).

Please review this at https://codereview.appspot.com/319400043/

Affected files (+23, -2 lines):
  M flower/file-name.cc
  M flower/test-file-path.cc


Index: flower/file-name.cc
diff --git a/flower/file-name.cc b/flower/file-name.cc
index c65d8fc7ed8c9ecfdfaba536d450b3ec70c010de..e5dd6f61602369773f53406d56bc4bd1ef12c4fa 100644
--- a/flower/file-name.cc
+++ b/flower/file-name.cc
@@ -77,9 +77,16 @@ dir_name (const string &file_name)
 string
 get_working_directory ()
 {
+#ifdef _GNU_SOURCE
+  char *cwd = get_current_dir_name();
+  string scwd(cwd);
+  free(cwd);
+  return scwd;
+#else
   char cwd[PATH_MAX];
// getcwd returns NULL upon a failure, contents of cwd would be undefined!
   return string (getcwd (cwd, PATH_MAX));
+#endif
 }

 /* Join components to full file_name. */
Index: flower/test-file-path.cc
diff --git a/flower/test-file-path.cc b/flower/test-file-path.cc
index a20364b98cf6214e0f727ec9a9672fef85f217d0..f49db47ed77a08f009cebb5e6332874808349a94 100644
--- a/flower/test-file-path.cc
+++ b/flower/test-file-path.cc
@@ -6,12 +6,26 @@
 #include "yaffut.hh"
 #include "config.hh"

+string
+get_working_directory ()
+{
+#ifdef _GNU_SOURCE
+  char *cwd = get_current_dir_name();
+  string scwd(cwd);
+  free(cwd);
+  return scwd;
+#else
+  char cwd[PATH_MAX];
+ // getcwd returns NULL upon a failure, contents of cwd would be undefined!
+  return string (getcwd (cwd, PATH_MAX));
+#endif
+}
+
 TEST (File_path, Find)
 {
   char const *extensions[] = {"ly", "", 0};
   string file = "init";
-  char cwd[PATH_MAX];
-  if (!getcwd (cwd, PATH_MAX))
+  if (get_working_directory().empty())
     {
       cerr << "Could not get current work directory\n";
       exit (1);





reply via email to

[Prev in Thread] Current Thread [Next in Thread]