Skip to content

[macOS] Build fails trying to package MumbleOverlay, even if -D overlay=OFF #6816

@dwt

Description

@dwt

Description

While updating the nixpkgs package for mumble I stumbled upon a build failure, where even with disabled overlay build on darwin, cmake still tries to build the package overlay into the application bundle.

Install the project...
-- Install configuration: "Release"
-- Installing: /nix/store/cf8mxh4wydznmm7nnspbxzy94n0bjfns-mumble-1.5.735/lib/mumble/plugins/liblink.dylib
-- Installing: /nix/store/cf8mxh4wydznmm7nnspbxzy94n0bjfns-mumble-1.5.735/./Mumble.app
-- Installing: /nix/store/cf8mxh4wydznmm7nnspbxzy94n0bjfns-mumble-1.5.735/./Mumble.app/Contents
-- Installing: /nix/store/cf8mxh4wydznmm7nnspbxzy94n0bjfns-mumble-1.5.735/./Mumble.app/Contents/MacOS
-- Installing: /nix/store/cf8mxh4wydznmm7nnspbxzy94n0bjfns-mumble-1.5.735/./Mumble.app/Contents/MacOS/Mumble
-- Installing: /nix/store/cf8mxh4wydznmm7nnspbxzy94n0bjfns-mumble-1.5.735/./Mumble.app/Contents/Info.plist
* Creating overlay installer

This then fails spectacularly, with multiple errors, that never the less do not exit the script (maybe it is missing something like set -e?)

The errors I see are:

* Creating overlay installer
cp: cannot stat 'libmumbleoverlay.dylib': No such file or directory
/private/tmp/nix-build-mumble-1.5.735.drv-0/source/macx/scripts/build-overlay-installer: line 11: productbuild: command not found
mktemp: too few X's in template ‘mumble-overlay-installer’
xar: option requires an argument -- C
DEPRECATION WARNING:
        xar is no longer under active development by Apple.
        Clients of xar should pursue alternative archive formats.

Usage: /usr/bin/xar -[ctx][v] -f <archive> ...
        -c               Creates an archive
        -x               Extracts an archive
        -t               Lists an archive
        -f <filename>    Specifies an archive to operate on [REQUIRED!]
        -v               Print filenames as they are archived
        -C <path>        On extract, chdir to this location
        -n name          Provides a name for a subdocument
        -s <filename>    On extract, specifies the file to extract
                              subdocuments to.
                         On archival, specifies an xml file to add
                              as a subdocument.
        -l               On archival, stay on the local device.
        -p               On extract, set ownership based on symbolic
                              names, if possible.
        -P               On extract, set ownership based on uid/gid.
        --toc-cksum      Specifies the hashing algorithm to use for
                              xml header verification.
                              Valid values: sha1, sha256, and sha512
                              Default: sha1
        --file-cksum     Specifies the hashing algorithm to use for
                              file content verification.
                              Valid values: sha1, sha256, and sha512
                              Default: sha1
        --dump-toc-cksum      Prints out the ToC chksum in hex.
                              The output is a hash of the ToC generated.
                              Also prints out the algorithm used.
                              by the checksum algorithm used during xar creation.
        --dump-toc=<filename> Has xar dump the xml header into the
                              specified file.
        --dump-header    Prints out the xar binary header information
        --compression    Specifies the compression type to use.
                              Valid values: none, gzip, bzip2, lzma
                              Default: gzip
        -a               Synonym for "--compression=lzma"
        -j               Synonym for "--compression=bzip2"
        -z               Synonym for "--compression=gzip"
        --compression-args=arg Specifies arguments to be passed
                               to the compression engine.
        --compress-heap  Compress entire heap instead of individual files.
                              Currently limited to gzip compression.
        --list-subdocs   List the subdocuments in the xml header
        --extract-subdoc=name Extracts the specified subdocument
                              to a document in cwd named <name>.xml
        --exclude        POSIX regular expression of files to
                              ignore while archiving.
        --rsize          Specifies the size of the buffer used
                              for read IO operations in bytes.
        --coalesce-heap  When archived files are identical, only store one copy
                              This option creates an archive which
                              is not streamable
        --link-same      Hardlink identical files
        --no-compress    POSIX regular expression of files
                              to archive, but not compress.
        --prop-include   File properties to include in archive
        --prop-exclude   File properties to exclude in archive
        --distribution   Only includes a subset of file properties
                              appropriate for archive distribution
        --keep-existing  Do not overwrite existing files while extracting
        -k               Synonym for --keep-existing
        --keep-setuid    Preserve the suid/sgid bits when extracting
        --version        Print xar's version number
mkdir: cannot create directory ‘/Resources’: Read-only file system
mv: cannot move 'bg.png' to '/Resources/': No such file or directory
Print: Entry, "MumbleOverlayVersion", Does Not Exist
Print: Entry, "MumbleOverlayMinMumbleVersion", Does Not Exist
/private/tmp/nix-build-mumble-1.5.735.drv-0/source/macx/scripts/build-overlay-installer: line 20: /upgrade.xml: Read-only file system
sed: can't read : No such file or directory
sed: can't read /Distribution: No such file or directory
/private/tmp/nix-build-mumble-1.5.735.drv-0/source/macx/scripts/build-overlay-installer: line 24: pushd: no other directory
/private/tmp/nix-build-mumble-1.5.735.drv-0/source/macx/scripts/build-overlay-installer: line 26: popd: directory stack empty
cp: cannot stat '/MumbleOverlay.pkg': No such file or directory
Traceback (most recent call last):
  File "/private/tmp/nix-build-mumble-1.5.735.drv-0/source/macx/scripts/osxdist.py", line 397, in <module>
    package_client()
  File "/private/tmp/nix-build-mumble-1.5.735.drv-0/source/macx/scripts/osxdist.py", line 279, in package_client
    create_overlay_package()
  File "/private/tmp/nix-build-mumble-1.5.735.drv-0/source/macx/scripts/osxdist.py", line 97, in create_overlay_package
    raise Exception('build-overlay-installer failed')
Exception: build-overlay-installer failed

I have worked around this by adding this patch to nixpkgs:

diff --git a/macx/scripts/osxdist.py b/macx/scripts/osxdist.py
index bdc7fcbd2..2114caf37 100755
--- a/macx/scripts/osxdist.py
+++ b/macx/scripts/osxdist.py
@@ -128,7 +128,7 @@ class AppBundle(object):
 				shutil.copy(rsrc, os.path.join(rsrcpath, b))

 		# Extras
-		shutil.copy(os.path.join(options.binary_dir, 'MumbleOverlay.pkg'), os.path.join(rsrcpath, 'MumbleOverlay.pkg'))
+		# shutil.copy(os.path.join(options.binary_dir, 'MumbleOverlay.pkg'), os.path.join(rsrcpath, 'MumbleOverlay.pkg'))

 	def copy_codecs(self):
 		'''
@@ -275,7 +276,7 @@ def package_client():
 		title = 'Mumble %s' % ver

 	# Fix overlay installer package
-	create_overlay_package()
+	# create_overlay_package()
 	if options.only_overlay:
 		sys.exit(0)

but I guess that this should not be necessary? I do not know enough about cmake however to have an idea how to adapt the shell scripts to changes in cmake variables.

Steps to reproduce

  1. Build with option -D overlay=OFF -D overlay-xcompile=OFF on darwin aarch64
  2. Watch it fail

Mumble version

1.5.735

Mumble component

Client

OS

macOS

Reproducible?

Yes

Additional information

No response

Relevant log output

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions