Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 637102

Summary: dev-perl/Ace on MacOS fails to emerge with "wmake/DARWIN_DEF: No such file or directory"
Product: Gentoo/Alt Reporter: Anton <anton.stay.connected>
Component: Prefix SupportAssignee: Gentoo Prefix <prefix>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: OS X   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log
emerge --info '=dev-perl/Ace-1.290.0-r2::gentoo-prefix'
emerge -pqv '=dev-perl/Ace-1.290.0-r2::gentoo-prefix'
The modification to Ace-1.920.0-r2.ebuild which works-for-me
Updated patch for Ace-1.920.0-r2.ebuild
Updated (2) patch for Ace-1.920.0-r2.ebuild

Description Anton 2017-11-10 22:48:10 UTC
Created attachment 503534 [details]
build.log

The Makefile in the acelib subdirectory imports platform-specific definitions from wmake/$(ACEDB_MACHINE)_DEF which on a Mac becomes wmake/DARWIN_DEF which does not exist.

Looking at the other examples in the same directory, the file should contain, at a minimum:
1. The name of the configuration (should be "DARWIN" as it is later used for conditional compilation)
2. The c compiler command
3. The linker command
4. LIBS variable specifying any additional libraries to link to, such as "-lm"

This bug is actually a feature-request to provide such a file. The necessary build failure info and a works-for-me solution are to be attached.
Comment 1 Anton 2017-11-10 22:50:24 UTC
Created attachment 503536 [details]
emerge --info '=dev-perl/Ace-1.290.0-r2::gentoo-prefix'
Comment 2 Anton 2017-11-10 22:50:59 UTC
Created attachment 503538 [details]
emerge -pqv '=dev-perl/Ace-1.290.0-r2::gentoo-prefix'
Comment 3 Anton 2017-11-10 22:57:59 UTC
Created attachment 503540 [details, diff]
The modification to Ace-1.920.0-r2.ebuild which works-for-me

One way to create the DARWIN_DEF is from within src_prepare() This attached patch works-for-me, but maybe there is a more portable way to determine the compiler and linker.
Comment 4 Fabian Groffen gentoo-dev 2017-11-11 12:03:20 UTC
I think if possible, use tc-getCC and tc-getLD from toolchain-funcs, or tc-export CC LD.
Comment 5 Anton 2017-11-11 23:06:45 UTC
Created attachment 503660 [details, diff]
Updated patch for Ace-1.920.0-r2.ebuild

Thanks Fabian,

Updated the patch to use tc-getCC and tc-getLD.
Comment 6 Fabian Groffen gentoo-dev 2017-11-25 14:42:20 UTC
ok, two nits:

1. combine the two inherits (you can do 'inherit X Y')
2. -lm on Darwin is pointless, as it is a symlink to libSystem (aka libc)

one question:

where does the -fwritable-strings and the two defines come from, is that from the linux definitions or something?
Comment 7 Anton 2017-11-25 21:12:54 UTC
Created attachment 506590 [details, diff]
Updated (2) patch for Ace-1.920.0-r2.ebuild

Combined the inherits, removed "LIBS=-lm" and "-DACEDB4", re-run "emerge -1 dev-perl/Ace", got no complaints.

-fwritable-strings and -DACEDB4 both come from LINUX_4_DEF which I used as the starting point. Thinking about it, it was not smart to blindly copy "-DACEDB4", however "grep -r ACEDB4" from the root of the source directory only shows other _DEF files -- looks like this define is never checked. As for the -fwritable-strings, I'm assuming it's needed for something if it's there?

-DPOSIX I added myself: without this flag the code is trying to forward-declare vsprintf and other standard functions which clashes with the respective macros in the standard headers.
Comment 8 Fabian Groffen gentoo-dev 2017-12-23 15:35:13 UTC
With the patch, I can't get this compiled:

RPC.xs:157:6: error: non-void function 'constant' should return a value
      [-Wreturn-type]
            return _ACECLIENT_;
            ^
1 error generated.

_ACECLIENT_ indeed is defined without a value, while the function should return a double.  It's unclear to me how this is/was supposed to work.
Comment 9 Anton 2018-01-09 15:47:47 UTC
(In reply to Fabian Groffen from comment #8)
> With the patch, I can't get this compiled:
> 
> RPC.xs:157:6: error: non-void function 'constant' should return a value
>       [-Wreturn-type]
>             return _ACECLIENT_;
>             ^
> 1 error generated.
> 
> _ACECLIENT_ indeed is defined without a value, while the function should
> return a double.  It's unclear to me how this is/was supposed to work.

Yes, I filed that separately as https://bugs.gentoo.org/637330 and upstream -- it looks like a separate, not Prefix-specific issue. I'm guessing older versions of C standard used to allow such void returns from non-void functions.
Comment 10 Larry the Git Cow gentoo-dev 2018-03-30 19:12:59 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=960f0cdf44edbcd5ae2ca7f3e36d0f6ad1f54b00

commit 960f0cdf44edbcd5ae2ca7f3e36d0f6ad1f54b00
Author:     Andreas K. Hüttel <dilfridge@gentoo.org>
AuthorDate: 2018-03-30 19:12:32 +0000
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: 2018-03-30 19:12:47 +0000

    dev-perl/Ace: Various fixes for glibc-2.26 and Darwin
    
    Closes: https://bugs.gentoo.org/637114
    Closes: https://bugs.gentoo.org/637102
    Package-Manager: Portage-2.3.24, Repoman-2.3.6

 dev-perl/Ace/Ace-1.920.0-r3.ebuild | 113 +++++++++++++++++++++++++++++++++++++
 1 file changed, 113 insertions(+)
Comment 11 Larry the Git Cow gentoo-dev 2018-04-01 16:49:09 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7070a6dc14c2adb697e05dbe898da461729916b0

commit 7070a6dc14c2adb697e05dbe898da461729916b0
Author:     Kent Fredric <kentnl@gentoo.org>
AuthorDate: 2018-04-01 16:47:27 +0000
Commit:     Kent Fredric <kentnl@gentoo.org>
CommitDate: 2018-04-01 16:47:58 +0000

    dev-perl/Ace: Fixes for bugs #637102 and #637330
    
    - Use toolchain-funcs for Darwin support ( #637102 )
    - Fix 'non-void function should return a value' ( #637330 )
    - Migrate sed patches to git-am patches where possible
    
    Closes: https://bugs.gentoo.org/637330
    Bug: https://bugs.gentoo.org/637102
    Package-Manager: Portage-2.3.24, Repoman-2.3.6

 dev-perl/Ace/Ace-1.920.0-r3.ebuild            | 12 ++++++-----
 dev-perl/Ace/files/Ace-1.92-gcc-nonvoid.patch | 31 +++++++++++++++++++++++++++
 dev-perl/Ace/files/Ace-1.92-glibc26.patch     | 29 +++++++++++++++++++++++++
 dev-perl/Ace/files/Ace-1.92-rpcxs.patch       | 25 +++++++++++++++++++++
 4 files changed, 92 insertions(+), 5 deletions(-)}