unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#24862: guile 2.0.13 build error under macOS 10.12 Sierra
@ 2016-11-02 21:18 Marius Schamschula
  2016-11-08  1:28 ` Matt Wette
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Marius Schamschula @ 2016-11-02 21:18 UTC (permalink / raw)
  To: 24862

[-- Attachment #1: Type: text/plain, Size: 221 bytes --]

Hi all,

While building guile under macOS 10.12 I get a build error. This error has previously been reported by other MacPorts users:

https://trac.macports.org/ticket/52613

I’m attaching the entire build log


[-- Attachment #2: guile-main.log.gz --]
[-- Type: application/x-gzip, Size: 41980 bytes --]

[-- Attachment #3: Type: text/plain, Size: 8 bytes --]



Marius

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#24862: guile 2.0.13 build error under macOS 10.12 Sierra
  2016-11-02 21:18 bug#24862: guile 2.0.13 build error under macOS 10.12 Sierra Marius Schamschula
@ 2016-11-08  1:28 ` Matt Wette
  2016-11-08  2:21   ` Matt Wette
  2016-11-10  3:20 ` Matt Wette
  2017-03-19 23:55 ` Matt Wette
  2 siblings, 1 reply; 9+ messages in thread
From: Matt Wette @ 2016-11-08  1:28 UTC (permalink / raw)
  To: 24862

[-- Attachment #1: Type: text/plain, Size: 2881 bytes --]

I am trying to work this.   I have a MacBook Pro running Sierra (Mac OS 10.12.1).  

I have macports installed, and was able to get guile 2.0.12 installed in the macports tree (/opt/local) using a custom macports file.

Note: Sierra seems to have issues running gdb.  Apparently the SIP needs to be turned off.  Instead I have been using the Xcode lldb debugger.

Note: Sierra has an issue with DYLD_LIBRARY_PATH.  Namely, it will not copy that env variable to sub-shells:

mwette$ export DYLD_LIBRARY_PATH=abc
mwette$ DYLD_LIBRARY_PATH=def echo $DYLD_LIBRARY_PATH
abc

I downloaded guile-2.0.13 and applied the macports sierra.patch (attached).  I used

CC=gcc-mp-6 CFLAGS=-g LDFLAGS=-g ./configure --prefix=/opt/local --enable-guile-debug --disable-shared

Build when trying to compile eval.scm => eval.go.  I set up the associated environment in my shell and found that executing in build-env or not makes a difference.  

mwette$ env | grep GUILE
GUILE=/Users/mwette/proj/scheme/guile/guile-2.0.13/libguile/guile
GUILE_LOAD_PATH=/Users/mwette/proj/scheme/guile/guile-2.0.13/module:/Users/mwette/proj/scheme/guile/guile-2.0.13/guile-readline:/Users/mwette/proj/scheme/guile/guile-2.0.13
GUILE_LOAD_COMPILED_PATH=/Users/mwette/proj/scheme/guile/guile-2.0.13/module:/Users/mwette/proj/scheme/guile/guile-2.0.13/guile-readline
GUILE_WARN_DEPRECATED=detailed
GUILE_INSTALL_LOCALE=1
GUILE_SYSTEM_PATH=
GUILE_AUTO_COMPILE=0
GUILE_SYSTEM_EXTENSIONS_PATH=

Within build-env it takes 12 seconds to crash.  Without build-env it returns immediately.  I don’t know if that means it is working or not: it does create a eval.go file.

mwette$ time build-env guild compile --target="x86_64-apple-darwin16.1.0" -Wunbound-variable -Warity-mismatch -Wformat  -L "/Users/mwette/proj/scheme/guile/guile-2.0.13/module" -L /Users/mwette/proj/scheme/guile/guile-2.0.13/module/  -L /Users/mwette/proj/scheme/guile/guile-2.0.13/guile-readline/  -o "ice-9/eval.go" "ice-9/eval.scm" 
Backtrace:
In unknown file:
   ?: 3 [apply-smob/1 #<boot-closure 106933000 (_ _ _)> #t ...]
   ?: 2 [apply-smob/1 #<catch-closure 107017ce0>]
   ?: 1 [primitive-eval ((@ # %) (begin # # #))]
   ?: 0 [mkstemp! "ice-9/eval.go.XXXXXX" "wb"]

ERROR: 
real	0m12.227s
user	0m12.598s
sys	0m0.098s


mwette$ time guild compile --target="x86_64-apple-darwin16.1.0" -Wunbound-variable -Warity-mismatch -Wformat  -L "/Users/mwette/proj/scheme/guile/guile-2.0.13/module" -L /Users/mwette/proj/scheme/guile/guile-2.0.13/module/  -L /Users/mwette/proj/scheme/guile/guile-2.0.13/guile-readline/  -o "ice-9/eval.go" "ice-9/eval.scm" 
;;; note: source file /Users/mwette/proj/scheme/guile/guile-2.0.13/module/system/base/target.scm
;;;       newer than compiled /opt/local/lib/guile/2.0/ccache/system/base/target.go
wrote `ice-9/eval.go'

real	0m0.420s
user	0m0.353s
sys	0m0.036s



[-- Attachment #2.1: Type: text/html, Size: 12170 bytes --]

[-- Attachment #2.2: sierra.patch --]
[-- Type: application/octet-stream, Size: 588 bytes --]

--- libguile/stime.c
+++ libguile/stime.c
@@ -834,6 +834,10 @@ scm_init_stime()
 
 #ifdef HAVE_POSIX_CPUTIME
   {
+#ifdef __APPLE__
+    if (clock_gettime (CLOCK_PROCESS_CPUTIME_ID, &posix_run_time_base) == 0)
+      get_internal_run_time = get_internal_run_time_posix_timer;
+#else
     clockid_t dummy;
     
     /* Only use the _POSIX_CPUTIME clock if it's going to work across
@@ -843,6 +847,7 @@ scm_init_stime()
       get_internal_run_time = get_internal_run_time_posix_timer;
     else
       errno = 0;
+#endif
   }
 #endif /* HAVE_POSIX_CPUTIME */
 #endif /* HAVE_CLOCKTIME */

[-- Attachment #2.3: Type: text/html, Size: 401 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#24862: guile 2.0.13 build error under macOS 10.12 Sierra
  2016-11-08  1:28 ` Matt Wette
@ 2016-11-08  2:21   ` Matt Wette
  2016-11-08  2:24     ` Matt Wette
  2016-11-11  1:51     ` Matt Wette
  0 siblings, 2 replies; 9+ messages in thread
From: Matt Wette @ 2016-11-08  2:21 UTC (permalink / raw)
  To: 24862; +Cc: mwette

[-- Attachment #1: Type: text/plain, Size: 646 bytes --]

Using the same process as above I get the following on guile-2.0.12:

mwette$ time build-env guild compile --target="x86_64-apple-darwin16.1.0" -Wunbound-variable -Warity-mismatch -Wformat  -L "/Users/mwette/proj/scheme/guile/guile-2.0.13/module" -L /Users/mwette/proj/scheme/guile/guile-2.0.13/module/  -L /Users/mwette/proj/scheme/guile/guile-2.0.13/guile-readline/  -o "ice-9/eval.go" "ice-9/eval.scm" 
wrote `ice-9/eval.go'

real	0m0.484s
user	0m0.357s
sys	0m0.051s



Also, the “env DYLD… echo $DYLD…” demo above is clearly broken.  But I have verified that DYLD_LIBRARY_PATH is filters out of env copy in the shell.



[-- Attachment #2: Type: text/html, Size: 3167 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#24862: guile 2.0.13 build error under macOS 10.12 Sierra
  2016-11-08  2:21   ` Matt Wette
@ 2016-11-08  2:24     ` Matt Wette
  2016-11-08  2:28       ` Matt Wette
  2016-11-11  1:51     ` Matt Wette
  1 sibling, 1 reply; 9+ messages in thread
From: Matt Wette @ 2016-11-08  2:24 UTC (permalink / raw)
  To: 24862

[-- Attachment #1: Type: text/plain, Size: 836 bytes --]

Now I see this is broken.  I don’ t know why 2.0.13 is showing up :( UGH.

> On Nov 7, 2016, at 6:21 PM, Matt Wette <mwette@alumni.caltech.edu> wrote:
> 
> Using the same process as above I get the following on guile-2.0.12:
> 
> mwette$ time build-env guild compile --target="x86_64-apple-darwin16.1.0" -Wunbound-variable -Warity-mismatch -Wformat  -L "/Users/mwette/proj/scheme/guile/guile-2.0.13/module" -L /Users/mwette/proj/scheme/guile/guile-2.0.13/module/  -L /Users/mwette/proj/scheme/guile/guile-2.0.13/guile-readline/  -o "ice-9/eval.go" "ice-9/eval.scm" 
> wrote `ice-9/eval.go'
> 
> real	0m0.484s
> user	0m0.357s
> sys	0m0.051s
> 
> 
> 
> Also, the “env DYLD… echo $DYLD…” demo above is clearly broken.  But I have verified that DYLD_LIBRARY_PATH is filters out of env copy in the shell.
> 
> 


[-- Attachment #2: Type: text/html, Size: 3758 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#24862: guile 2.0.13 build error under macOS 10.12 Sierra
  2016-11-08  2:24     ` Matt Wette
@ 2016-11-08  2:28       ` Matt Wette
  0 siblings, 0 replies; 9+ messages in thread
From: Matt Wette @ 2016-11-08  2:28 UTC (permalink / raw)
  To: 24862

[-- Attachment #1: Type: text/plain, Size: 353 bytes --]

Fixed:

mwette$ time build-env guild compile --target="x86_64-apple-darwin16.1.0" -Wunbound-variable -Warity-mismatch -Wformat  -L "$DIR/module" -L "$DIR/guile-readline"  -o "ice-9/eval.go" "ice-9/eval.scm" 
wrote `ice-9/eval.go'

real	0m0.484s
user	0m0.358s
sys	0m0.049s

mwette$ echo $DIR
/Users/mwette/proj/scheme/guile/guile-2.0.12




[-- Attachment #2: Type: text/html, Size: 3210 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#24862: guile 2.0.13 build error under macOS 10.12 Sierra
  2016-11-02 21:18 bug#24862: guile 2.0.13 build error under macOS 10.12 Sierra Marius Schamschula
  2016-11-08  1:28 ` Matt Wette
@ 2016-11-10  3:20 ` Matt Wette
  2017-03-19 23:55 ` Matt Wette
  2 siblings, 0 replies; 9+ messages in thread
From: Matt Wette @ 2016-11-10  3:20 UTC (permalink / raw)
  To: 24862

[-- Attachment #1: Type: text/plain, Size: 614 bytes --]

(lldb) n
Process 85754 stopped
* thread #1: tid = 0xe66f2, 0x000000010002c03f guile`scm_i_mkstemp(tmpl=0x0000000104cd09a0, mode=0x0000000100ea34c0) + 238 at filesys.c:1490, queue = 'com.apple.main-thread', stop reason = step over
    frame #0: 0x000000010002c03f guile`scm_i_mkstemp(tmpl=0x0000000104cd09a0, mode=0x0000000100ea34c0) + 238 at filesys.c:1490
   1487	    }
   1488	
   1489	  SCM_SYSCALL (rv = mkostemp (c_tmpl, open_flags));
-> 1490	  if (rv == -1)
   1491	    SCM_SYSERROR;
   1492	
   1493	  scm_substring_move_x (scm_from_locale_string (c_tmpl),
(lldb) p rv
(int) $8 = -1
(lldb) 


[-- Attachment #2: Type: text/html, Size: 4652 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#24862: guile 2.0.13 build error under macOS 10.12 Sierra
  2016-11-08  2:21   ` Matt Wette
  2016-11-08  2:24     ` Matt Wette
@ 2016-11-11  1:51     ` Matt Wette
  2017-03-01 13:38       ` Andy Wingo
  1 sibling, 1 reply; 9+ messages in thread
From: Matt Wette @ 2016-11-11  1:51 UTC (permalink / raw)
  To: 24862

Here is a patch that gets mine working.  Not sure it solves all the Sierra issues.

*** libguile/filesys.c-orig     2016-11-05 07:49:09.000000000 -0700
--- libguile/filesys.c  2016-11-10 05:38:53.000000000 -0800
***************
*** 1486,1491 ****
--- 1486,1494 ----
        mode_bits = scm_i_mode_bits (mode);
      }
  
+ #ifdef __APPLE__
+   open_flags &= O_APPEND|O_SHLOCK|O_EXLOCK|O_CLOEXEC;
+ #endif
    SCM_SYSCALL (rv = mkostemp (c_tmpl, open_flags));
    if (rv == -1)
      SCM_SYSERROR;

The man page for mkstemp says the following:

     The mkostemp() function is like mkstemp() but allows specifying addi-
     tional open(2) flags (defined in <fcntl.h>).  The permitted flags are
     O_APPEND, O_SHLOCK, O_EXLOCK and O_CLOEXEC.


Note that macports includes another patch for Sierra:

--- libguile/stime.c
+++ libguile/stime.c
@@ -834,6 +834,10 @@ scm_init_stime()
 
 #ifdef HAVE_POSIX_CPUTIME
   {
+#ifdef __APPLE__
+    if (clock_gettime (CLOCK_PROCESS_CPUTIME_ID, &posix_run_time_base) == 0)
+      get_internal_run_time = get_internal_run_time_posix_timer;
+#else
     clockid_t dummy;
     
     /* Only use the _POSIX_CPUTIME clock if it's going to work across
@@ -843,6 +847,7 @@ scm_init_stime()
       get_internal_run_time = get_internal_run_time_posix_timer;
     else
       errno = 0;
+#endif
   }
 #endif /* HAVE_POSIX_CPUTIME */
 #endif /* HAVE_CLOCKTIME */







^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#24862: guile 2.0.13 build error under macOS 10.12 Sierra
  2016-11-11  1:51     ` Matt Wette
@ 2017-03-01 13:38       ` Andy Wingo
  0 siblings, 0 replies; 9+ messages in thread
From: Andy Wingo @ 2017-03-01 13:38 UTC (permalink / raw)
  To: Matt Wette; +Cc: 24862

Hi Matt :)

On Fri 11 Nov 2016 02:51, Matt Wette <mwette@alumni.caltech.edu> writes:

> Here is a patch that gets mine working.  Not sure it solves all the Sierra issues.
>
> *** libguile/filesys.c-orig     2016-11-05 07:49:09.000000000 -0700
> --- libguile/filesys.c  2016-11-10 05:38:53.000000000 -0800
> ***************
> *** 1486,1491 ****
> --- 1486,1494 ----
>         mode_bits = scm_i_mode_bits (mode);
>       }
>   
> + #ifdef __APPLE__
> +   open_flags &= O_APPEND|O_SHLOCK|O_EXLOCK|O_CLOEXEC;
> + #endif

Thanks for doing this investigation.  This patch is applied, thanks to
your efforts.  Do you know if this bug has additional pending items or
is it resolved?  If it is resolved, feel free to respond to the bug,
adding "-done" to the email address (e.g. 24862-done@debbugs.gnu.org).

Cheers,

Andy





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#24862: guile 2.0.13 build error under macOS 10.12 Sierra
  2016-11-02 21:18 bug#24862: guile 2.0.13 build error under macOS 10.12 Sierra Marius Schamschula
  2016-11-08  1:28 ` Matt Wette
  2016-11-10  3:20 ` Matt Wette
@ 2017-03-19 23:55 ` Matt Wette
  2 siblings, 0 replies; 9+ messages in thread
From: Matt Wette @ 2017-03-19 23:55 UTC (permalink / raw)
  To: 24862-done

This should be closed. — Matt




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-03-19 23:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-02 21:18 bug#24862: guile 2.0.13 build error under macOS 10.12 Sierra Marius Schamschula
2016-11-08  1:28 ` Matt Wette
2016-11-08  2:21   ` Matt Wette
2016-11-08  2:24     ` Matt Wette
2016-11-08  2:28       ` Matt Wette
2016-11-11  1:51     ` Matt Wette
2017-03-01 13:38       ` Andy Wingo
2016-11-10  3:20 ` Matt Wette
2017-03-19 23:55 ` Matt Wette

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).