Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#52613 closed defect (fixed)

Guile-2.0.13 fails to build on Sierra

Reported by: mouse07410 (Mouse) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.3.4
Keywords: sierra Cc: Schamschula (Marius Schamschula), todmorrison (Tod Morrison), mwette, MarcusCalhoun-Lopez (Marcus Calhoun-Lopez), mouse07410 (Mouse), basmac, fhgwright (Fred Wright), favadi (Diep Pham), mndavidoff (Monte Davidoff), fracai, markemer (Mark Anderson), dimkab, eddieh (Eddie Hillenbrand)
Port: guile

Description

MacOS Sierra. Guile-2.0.12 was installed as a dependency of autogen. Now "port upgrade outdated" fails to upgrade Guile:

. . . . .
:info:build Making all in module
:info:build make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_guile/guile/work/guile-2.0.13/module'
:info:build GUILE_INSTALL_LOCALE=1 GUILE_AUTO_COMPILE=0 \
:info:build     ../meta/build-env                               \
:info:build     guild compile --target="x86_64-apple-darwin16" -Wunbound-variable -Warity-mismatch -Wformat     \
:info:build       -L "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_guile/guile/work/guile-2.0.13/module" -L "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_guile/guile/work/guile-2.0.13/module"         \
:info:build       -L "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_guile/guile/work/guile-2.0.13/guile-readline"                        \
:info:build       -o "ice-9/eval.go" "ice-9/eval.scm"
:info:build Backtrace:
:info:build In unknown file:
:info:build    ?: 3 [apply-smob/1 #<boot-closure 11011fb00 (_ _ _)> #t ...]
:info:build    ?: 2 [apply-smob/1 #<catch-closure 1102b3680>]
:info:build    ?: 1 [primitive-eval ((@ # %) (begin # # #))]
:info:build    ?: 0 [mkstemp! "ice-9/eval.go.XXXXXX" "wb"]
:info:build 
:info:build ERROR: make[2]: *** [ice-9/eval.go] Error 1
:info:build make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_guile/guile/work/guile-2.0.13/module'
. . . . .

Attachments (5)

guile.txt (658.8 KB) - added by mouse07410 (Mouse) 8 years ago.
Complete build log
guile-build-log.txt (187.7 KB) - added by mouse07410 (Mouse) 7 years ago.
mksfifo.patch (367 bytes) - added by mwette 7 years ago.
files/mksfifo.patch
Portfile.diff (423 bytes) - added by mwette 7 years ago.
Portfile.patch
Portfile.patch (423 bytes) - added by mwette 7 years ago.
Portfile.patch

Download all attachments as: .zip

Change History (46)

Changed 8 years ago by mouse07410 (Mouse)

Attachment: guile.txt added

Complete build log

comment:1 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: nomaintainer@… removed
Keywords: sierra added

comment:2 Changed 8 years ago by Schamschula (Marius Schamschula)

Cc: mps@… added

Cc Me!

comment:3 Changed 8 years ago by howarth.at.macports@…

A related issue to watch out for is that even on 10.11, when the test commands from Ticket #52556 are added, the resulting build fails three additional tests not seen in 2.0.12 on darwin...

ERROR: 00-repl-server.test: repl-server: simple expression - arguments: ((system-error "fport_fill_input" "~A" ("Socket is not connected") (57)))
ERROR: 00-repl-server.test: repl-server: HTTP inter-protocol attack - arguments: ((system-error "fport_fill_input" "~A" ("Socket is not connected") (57)))
FAIL: check-grille

Note that passing ac_cv_have_thread_storage_class=no to configure when building guile 2.0.12 produces clean test suite results.

Last edited 8 years ago by howarth.at.macports@… (previous) (diff)

comment:4 Changed 8 years ago by todmorrison (Tod Morrison)

Cc: todmorrison@… added

Cc Me!

comment:5 Changed 8 years ago by mwette

Cc: mwette@… added

Cc Me!

comment:6 Changed 8 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Cc: mcalhoun@… added

Cc Me!

comment:7 Changed 8 years ago by ksze (Kal Sze)

Cc: ksze added

comment:8 Changed 8 years ago by mouse07410 (Mouse)

Cc: mouse07410 added

comment:9 Changed 7 years ago by mouse07410 (Mouse)

I have a request to make. The current guile-2.0.13 is broken, both the Macports port and the upstream (on Sierra at least).

Can you please, pretty-please make port of guile-2.0.12 available (again)? That one works, and seems fine (at least for me) on both Sierra and El Capitan. That would allow me to install and use other ports that depend on guile, while you're working on this problem.

Thanks!

comment:10 Changed 7 years ago by ken-cunningham-webuse

You can do this for any port you like, whenever you like.

wiki:howto/InstallingOlderPort

first find it

$ port info guile
guile @2.0.13 (lang)

then go to the svn repo

browser:trunk/dports/lang/guile

click on 'revision log' (top right )

select any revision you want ( goes back 14 years)

note the revision number, e.g. 151758

and check it out

$ svn checkout -r 151758 https://svn.macports.org/repository/macports/trunk/dports/lang/guile

go into the directory where you downloaded that info

and build it

sudo port install

you are done.

add it to your own local rep and it'll never ask to be updated again.

Last edited 7 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:11 Changed 7 years ago by ken-cunningham-webuse

no doubt these instructions will change someday for git, but this works for ports from the past 14 years.

comment:12 Changed 7 years ago by mouse07410 (Mouse)

Thank you for the recipe - I'll write it down (useful for this and other ports as well).

The main/only reason I need guile is because I need autogen port, and it depends on guile.

Since guile-2.0.13 is broken (on Sierra for sure), and the fix does not seem to be forthcoming - could you possibly retract 2.0.13 and revert the "standard" current port to 2.0.12 (which, as I said, works fine on El Capitan and Sierra)?

It is a small inconvenience to be unable to say sudo port upgrade outdated, and having to manually upgrade every (working) port because guile sticks new the top and breaks the automatic process. But it is an inconvenience nonetheless.

I can't imagine anybody needing 2.0.13 because it simply does not work. 2.0.12 does - why not stay at that version until you figure out how to fix 2.0.13 (probably having upstream people involved)?

comment:13 Changed 7 years ago by mwette

I found that Guile will not build with /usr/bin/clang on El Capitan by downloading the guile-2.0.13 tarball from gnu.org and sucessfully building with /opt/local/bin/gcc-mp-4 and failing with /usr/bin/clang.

I then got guile-2.0.13 to build under macports by

  1. creating my own ports directory /path/to/ports
  2. adding file:///path/to/ports before the rsync line in /opt/local/etc/macports/source.conf
  3. grabbing Portfile and files/sierra.patch from github.com
  4. adding CC="${prefix}/bin/gcc-mp-4" to configargs entry
  5. running portindex in /path/to/ports
  6. port clean --all guile
  7. port upgrade guile

Now trying on Sierra at home.

comment:14 Changed 7 years ago by Schamschula (Marius Schamschula)

FYI: I did report this issue upstream:

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24862

comment:15 Changed 7 years ago by mwette

Not working on Sierra. Dies trying to build ice-9/eval.go. I will look into it later.

comment:16 Changed 7 years ago by mouse07410 (Mouse)

Yes, the above matched my experience 100%.

comment:17 Changed 7 years ago by mwette

I am building guile-2.0.13 standalone using --prefix=/opt/local. It fails as in the macports build. I can recreate the fail with traceback from mkstemp!. Also, have to use /usr/bin/lldb as using /opt/local/bin/ggdb on Sierra is going to be very non-straightforward.

comment:18 Changed 7 years ago by mwette

I am still testing but I think I have found a fix. Here is a patch:

*** 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;

Changed 7 years ago by mouse07410 (Mouse)

Attachment: guile-build-log.txt added

comment:19 Changed 7 years ago by mouse07410 (Mouse)

Your patch makes things much better, and the build can progress much farther with it - but it doesn't resolve all the problems: build still aborts with an error. See the attached guile-build-log.txt that shows what happens with your patch (and sierra.patch).

comment:20 Changed 7 years ago by mwette

Could you try with compiler that is not /usr/bin/clang? I had issues on another machine (El Capitan?) with /usr/bin/clang and was able to get guile to build with /opt/local/bin/gcc-mp-6. $ CC=/opt/local/bin/gcc-mp-5 ./configure ...

comment:21 Changed 7 years ago by mouse07410 (Mouse)

I tried with /usr/bin/clang, and with /opt/local/bin/clang...

Will try gcc6 and report.

comment:22 Changed 7 years ago by mouse07410 (Mouse)

First build (with Xcode clang) was from scratch, on the freshly untarred dir. Second one with Macports clang-3.9 - I confess I did not do distclean...

Will make sure I'll make distclean before trying Macports gcc6.

comment:23 Changed 7 years ago by mwette

I verified for myself that 2.0.13 will build with /usr/bin/clang on Sierra, with the two patches.

I also named the above patch to mksfifo.patch, added it to the files/ subdir of my guile port, updated the Portfile by adding mksfifo.patch to the patchfiles command, and saw "port upgrade outdated" complete perform a successful guile of guile-2.0.13 on Sierra.

mwette$ diff ,old/Portfile-2.0.13 Portfile 
62c62
< patchfiles          sierra.patch
---
> patchfiles          sierra.patch mksfifo.patch

comment:24 Changed 7 years ago by mwette

I have attached proposed files/mksfifo.patch and a patch for the Portfile.

comment:25 Changed 7 years ago by basmac

Cc: basmac added

comment:26 Changed 7 years ago by mf2k (Frank Schima)

Thanks. Per the guidelines, please instead attach the patches as unified diffs.

Changed 7 years ago by mwette

Attachment: mksfifo.patch added

files/mksfifo.patch

Changed 7 years ago by mwette

Attachment: Portfile.diff added

Portfile.patch

Changed 7 years ago by mwette

Attachment: Portfile.patch added

Portfile.patch

comment:27 Changed 7 years ago by mwette

Uploaded "diff -u" version of mksfifo.patch and Portfile.patch (also Portfile.diff, oops).

comment:28 Changed 7 years ago by fhgwright (Fred Wright)

FYI - it's been broken for a while on Mavericks as well. The last version successfully installed was 2.0.11_3. Assuming it's the same problem, it's not worth attaching another logfile.

comment:29 Changed 7 years ago by fhgwright (Fred Wright)

Cc: fhgwright added

comment:30 Changed 7 years ago by favadi (Diep Pham)

I confirm that the problem still happens with macports 2.3.5 on macOS Sierra. Should we merged @mwette's patches? Or those patches should be recreated as a Github PR?

comment:31 Changed 7 years ago by favadi (Diep Pham)

Cc: favadi added

comment:32 Changed 7 years ago by mndavidoff (Monte Davidoff)

Cc: mndavidoff added

comment:33 Changed 7 years ago by fracai

Cc: fracai added

comment:34 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

Ideally, the developers of guile would fix their software and release a new version of it, then MacPorts will update to that version. Perhaps someone could ask the developers of guile how close they are to doing that.

comment:35 Changed 7 years ago by markemer (Mark Anderson)

Cc: markemer added

comment:36 Changed 7 years ago by dimkab

Cc: dimkab added

comment:37 Changed 7 years ago by eddieh (Eddie Hillenbrand)

Cc: eddieh added

comment:38 in reply to:  10 Changed 7 years ago by eddieh (Eddie Hillenbrand)

Replying to ken-cunningham-webuse:

You can do this for any port you like, whenever you like.

wiki:howto/InstallingOlderPort

first find it

$ port info guile
guile @2.0.13 (lang)

then go to the svn repo

browser:trunk/dports/lang/guile

click on 'revision log' (top right )

select any revision you want ( goes back 14 years)

note the revision number, e.g. 151758

and check it out

$ svn checkout -r 151758 https://svn.macports.org/repository/macports/trunk/dports/lang/guile

go into the directory where you downloaded that info

and build it

sudo port install

you are done.

add it to your own local rep and it'll never ask to be updated again.

Unfortunately, this failed to build as well. On 10.12.1 (16B2657).

comment:39 Changed 7 years ago by neverpanic (Clemens Lang)

The problem with mkostemp failing on Sierra happens because Sierra introduces a mkostemp(3) function in unistd.h. This causes libguile to prefer this implementation over its GNUlib implementation, which is has previously shipped.

mkostemp(3) does not accept flags other than O_APPEND, O_SHLOCK, O_EXLOCK and O_CLOEXEC, according to the mktemp(3) manpage. libguile's libguile/filesys.c, however, passes O_WRONLY | O_CREAT | O_TRUNC to it.

These flags are passed because in libguile/filesys.c, in s_scm_i_mkstemp, SCM_UNBNDP (mode) is false and the block that converts the given string argument of "wb" into the corresponding flags using scm_i_mode_to_open_flags() as defined in libguile/fports.c returns O_WRONLY | O_CREAT | O_TRUNC. Opening a file with a random name in read-only mode is pretty pointless, of course, so I'm not sure why that's even an option (and GNUlib's implementation of mkostemp ignores O_WRONLY and adds O_RDWR).

The patch posted in the upstream ticket is correct. I'm committing a fix soon.

comment:40 Changed 7 years ago by neverpanic (Clemens Lang)

Resolution: fixed
Status: newclosed

In 8b7f401/macports-ports:

guile: Fix build on Sierra

macOS Sierra introduces a mkostemp(3) function which is used when
present. Contrary to the GNUlib version of mkostemp(3) that was used
previously, this version fails with 'invalid argument' when flags other
than from a specified set are passed. From mktemp(3):

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

Apply a patch that avoids unsupported flags to fix this problem.

Closes: #52613

comment:41 Changed 7 years ago by neverpanic (Clemens Lang)

In 8b7f401/macports-ports:

guile: Fix build on Sierra

macOS Sierra introduces a mkostemp(3) function which is used when
present. Contrary to the GNUlib version of mkostemp(3) that was used
previously, this version fails with 'invalid argument' when flags other
than from a specified set are passed. From mktemp(3):

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

Apply a patch that avoids unsupported flags to fix this problem.

Closes: #52613

Note: See TracTickets for help on using tickets.