Opened 3 years ago

Last modified 2 years ago

#63561 assigned defect

dav1d +universal: meson: error: unrecognized arguments: --host=aarch64-apple-darwin20.6.0

Reported by: johanmattssonm (Johan Mattsson) Owned by: ctreleaven (Craig Treleaven)
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: Cc: mascguy (Christopher Nielsen)
Port: dav1d

Description (last modified by johanmattssonm (Johan Mattsson))

Hi developers.

I ran this:

sudo port install libgee +universal -x11

and the dependency dav1d failed to install because:

:info:configure meson: error: unrecognized arguments: --host=aarch64-apple-darwin20.6.0

I got no idea why libgee needs this package.

I am running Big Sur on an M1 MacBook.

Attachments (3)

main.log.dav1d (10.7 KB) - added by johanmattssonm (Johan Mattsson) 3 years ago.
build log
Portfile (3.3 KB) - added by johnrosshunt 2 years ago.
Portfile
Portfile.diff (1.1 KB) - added by johnrosshunt 2 years ago.
Just the diff

Download all attachments as: .zip

Change History (16)

Changed 3 years ago by johanmattssonm (Johan Mattsson)

Attachment: main.log.dav1d added

build log

comment:1 Changed 3 years ago by johanmattssonm (Johan Mattsson)

Description: modified (diff)

comment:2 in reply to:  description Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: libgee vala removed
Owner: set to ctreleaven
Status: newassigned
Summary: dav1d fails when installing universal variant of libgeedav1d +universal: meson: error: unrecognized arguments: --host=aarch64-apple-darwin20.6.0

Replying to johanmattssonm:

I got no idea why libgee needs this package.

libgee depends on vala which depends on graphviz which depends on gd2 which depends on libheif which depends on dav1d.

comment:3 Changed 3 years ago by johanmattssonm (Johan Mattsson)

Thank you for the clarification. I guess this has to do with generating docs rather than compiling vala code. It would be nice if there was an easy way to skip documentation when downloading the compiler but I am very glad that I got an answer.

comment:4 Changed 3 years ago by kencu (Ken)

most meson ports have a block something like this in them to fix this:

if {![info exists universal_possible]} {
    set universal_possible [expr {${os.universal_supported} && [llength ${configure.universal_archs}] >= 2}]
}
if {${universal_possible} && [variant_isset universal]} {
    foreach my_arch {ppc ppc64 i386 x86_64 arm64} {
        # strip the automatic setting of host, meson does not accept
        set merger_host(${my_arch}) ""
    }
}

the automatic adding of the host information by the muniversal portgroup is not accepted by meson.

comment:5 in reply to:  4 ; Changed 3 years ago by ctreleaven (Craig Treleaven)

Replying to kencu:

most meson ports have a block something like this in them to fix this:

if {![info exists universal_possible]} {
    set universal_possible [expr {${os.universal_supported} && [llength ${configure.universal_archs}] >= 2}]
}
if {${universal_possible} && [variant_isset universal]} {
    foreach my_arch {ppc ppc64 i386 x86_64 arm64} {
        # strip the automatic setting of host, meson does not accept
        set merger_host(${my_arch}) ""
    }
}

the automatic adding of the host information by the muniversal portgroup is not accepted by meson.

The only ports I can see with this code block are glib2 and glib2-devel.

If this is a shortcoming of meson, should we not add this block to the meson portgroup rather than patching port by port?

BTW, I have no ability to build universal so I'd be shooting in the dark trying to fix dav1d.

comment:6 in reply to:  5 Changed 3 years ago by kencu (Ken)

The only ports I can see with this code block are glib2 and glib2-devel.

Yeah, this block was mine so I cribbed it from there, but some others have a variation of it I believe, and somewhere recently I saw a much more elegant version, but I don't recall where ATM. Any port that uses meson, muniversal, and then someone tries to build universal cross-arch does this (afaik).

If this is a shortcoming of meson, should we not add this block to the meson portgroup rather than patching port by port?

Or maybe a shortcoming of muniversal. Sounds like a great PR, sure, once someone gets it nailed down.

comment:7 Changed 2 years ago by potterpg

So was this ever overcome?

I also have this issue with dav1d trying to compile with +universal.

specifically

meson: error: unrecognized arguments: --host=aarch64-apple-darwin20.6.0

Changed 2 years ago by johnrosshunt

Attachment: Portfile added

Portfile

Changed 2 years ago by johnrosshunt

Attachment: Portfile.diff added

Just the diff

comment:8 Changed 2 years ago by johnrosshunt

I have a proposed patch (see attachments above). It build successfully for me on Monterey (arm64/x86_64) & Snow Leopard (x86_64/i386).

comment:9 Changed 2 years ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:10 Changed 2 years ago by potterpg

The proposed change seems to work and create libdav1d.6.dylib. Is there a way to compile as a static lib?

comment:11 in reply to:  10 ; Changed 2 years ago by kencu (Ken)

Replying to potterpg:

Is there a way to compile as a static lib?

not automatically. Upstream would have to add that as an option to their meson.build infrastructure.

comment:12 in reply to:  8 Changed 2 years ago by kencu (Ken)

Replying to johnrosshunt:

I have a proposed patch (see attachments above). It build successfully for me on Monterey (arm64/x86_64) & Snow Leopard (x86_64/i386).

That is the patch I have been using, but Craig rightly points out that someone should fix this in a general way rather than port-by-port-by-port like we are doing now, so this patch has been held up here.

So either we fix it generally (great plan) or use this patch if we aren't going to fix it generally any time soon.

comment:13 in reply to:  11 Changed 2 years ago by tomio-arisaka (Tomio Arisaka)

Replying to kencu:

Replying to potterpg:

Is there a way to compile as a static lib?

not automatically. Upstream would have to add that as an option to their meson.build infrastructure.

I think that meson supports both dynamic and static libraries.

See https://mesonbuild.com/Configuring-a-build-directory.html#configuring-a-build-directory

So you can try to build both libraries.

For example:

$ diff -u Portfile.orig Portfile
--- Portfile.orig	2022-06-03 19:55:44.000000000 +0900
+++ Portfile	2022-08-12 04:44:12.000000000 +0900
@@ -50,6 +50,7 @@
 compiler.blacklist-append { clang < 700 } macports-clang-3.3 macports-clang-3.4
 
 configure.args-append \
+                    --default-library=both \
                     -Denable_tests=false
 
 variant test description {enable tests} {
Note: See TracTickets for help on using tickets.