Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tart #103

Merged
merged 2 commits into from
Oct 12, 2024
Merged

Tart #103

merged 2 commits into from
Oct 12, 2024

Conversation

kevinmcox
Copy link
Member

This PR has two commits:

  1. Fixes MunkiImporter to grab the package and not the downloaded archive to prevent this error:
The following recipes failed:
    com.github.apizz.munki.Tart
        Error in com.github.apizz.munki.Tart: Processor: MunkiImporter: Error: creating pkginfo for
~/Library/AutoPkg/Cache/com.github.apizz.munki.Tart/downloads/tart-arm64.tar.gz failed:
~/Library/AutoPkg/Cache/com.github.apizz.munki.Tart/downloads/tart-arm64.tar.gz is not a valid installer item!
  1. This commit adds architecture support to match the parent recipe: Tart architecture support wegotoeleven-recipes#4

Fixes MunkiImporter to grab the package and not the downloaded archive to prevent this error:

The following recipes failed:
    com.github.apizz.munki.Tart
        Error in com.github.apizz.munki.Tart: Processor: MunkiImporter: Error: creating pkginfo for ~/Library/AutoPkg/Cache/com.github.apizz.munki.Tart/downloads/tart-arm64.tar.gz failed: ~/Library/AutoPkg/Cache/com.github.apizz.munki.Tart/downloads/tart-arm64.tar.gz is not a valid installer item!
This commit adds architecture support to match the parent recipe: autopkg/wegotoeleven-recipes#4
@apizz
Copy link
Member

apizz commented Oct 1, 2024

Hey @kevinmcox . Give me a verbose output run and I'll get you a :rubber_stamp: 😃

Comment on lines +57 to +58
<key>Processor</key>
<string>com.github.homebysix.FindAndReplace/FindAndReplace</string>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm so at face value I don't agree with this change. This adds a seemingly unnecessary dependency. Can you explain why this custom processor is necessary?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is because the Intel download is available as amd64 but for Munki's supported architectures you need to specify x86_64.

This Find and Replace processor allows you to configure only a single ARCH variable and have it cover both use cases.

The alternative is to have both DOWNLOAD_ARCH and SUPPORTED_ARCH variables that need to be configured as distinct values.

@apizz
Copy link
Member

apizz commented Oct 12, 2024

okee dokee

arun ~/Documents/git/apizz-recipes/Tart/Tart.munki.recipe                                                  6s 10:25:01
Processing /Users/autopkg/Documents/git/apizz-recipes/Tart/Tart.munki.recipe...
WARNING: /Users/autopkg/Documents/git/apizz-recipes/Tart/Tart.munki.recipe is missing trust info and FAIL_RECIPES_WITHOUT_TRUST_INFO is not set. Proceeding...
GitHubReleasesInfoProvider
{'Input': {'asset_regex': '^tart-arm64.*?tar.gz$',
           'github_repo': 'cirruslabs/tart',
           'include_prereleases': 'false'}}
GitHubReleasesInfoProvider: No value supplied for CURL_PATH, setting default value of: /usr/bin/curl
GitHubReleasesInfoProvider: No value supplied for GITHUB_URL, setting default value of: https://api.github.com
GitHubReleasesInfoProvider: No value supplied for GITHUB_TOKEN_PATH, setting default value of: ~/.autopkg_gh_token
GitHubReleasesInfoProvider: Matched regex '^tart-arm64.*?tar.gz$' among asset(s): tart-amd64.tar.gz, tart-arm64.tar.gz, tart_2.18.5_checksums.txt
GitHubReleasesInfoProvider: Selected asset 'tart-arm64.tar.gz' from release '2.18.5'
{'Output': {'asset_created_at': '2024-10-02T14:54:35Z',
            'asset_url': 'https://api.github.com/repos/cirruslabs/tart/releases/assets/196413518',
            'release_notes': "## What's Changed\r\n"
                             '* Info.plist: set CFBundleName and '
                             'CFBundleDisplayName to Tart by @edigaryev in '
                             'https://github.com/cirruslabs/tart/pull/909\r\n'
                             '* tart delete: return human-friendly error when '
                             "local VM doesn't exist by @edigaryev in "
                             'https://github.com/cirruslabs/tart/pull/910\r\n'
                             '* Document automatic pruning in FAQ by '
                             '@edigaryev in '
                             'https://github.com/cirruslabs/tart/pull/913\r\n'
                             '* Prevent pipe deadlock when spawning a '
                             'Process() by @edigaryev in '
                             'https://github.com/cirruslabs/tart/pull/916\r\n'
                             '\r\n'
                             '\r\n'
                             '**Full Changelog**: '
                             'https://github.com/cirruslabs/tart/compare/2.18.4...2.18.5',
            'url': 'https://github.com/cirruslabs/tart/releases/download/2.18.5/tart-arm64.tar.gz',
            'version': '2.18.5'}}
URLDownloader
{'Input': {'url': 'https://github.com/cirruslabs/tart/releases/download/2.18.5/tart-arm64.tar.gz'}}
URLDownloader: No value supplied for prefetch_filename, setting default value of: False
URLDownloader: No value supplied for CHECK_FILESIZE_ONLY, setting default value of: False
URLDownloader: Storing new Last-Modified header: Wed, 02 Oct 2024 14:54:36 GMT
URLDownloader: Storing new ETag header: "0x8DCE2F22223C242"
URLDownloader: Downloaded /Users/autopkg/Library/AutoPkg/Cache/com.github.apizz.munki.Tart/downloads/tart-arm64.tar.gz
{'Output': {'download_changed': True,
            'etag': '"0x8DCE2F22223C242"',
            'last_modified': 'Wed, 02 Oct 2024 14:54:36 GMT',
            'pathname': '/Users/autopkg/Library/AutoPkg/Cache/com.github.apizz.munki.Tart/downloads/tart-arm64.tar.gz',
            'url_downloader_summary_result': {'data': {'download_path': '/Users/autopkg/Library/AutoPkg/Cache/com.github.apizz.munki.Tart/downloads/tart-arm64.tar.gz'},
                                              'summary_text': 'The following '
                                                              'new items were '
                                                              'downloaded:'}}}
EndOfCheckPhase
{'Input': {}}
{'Output': {}}
Unarchiver
{'Input': {'archive_path': '/Users/autopkg/Library/AutoPkg/Cache/com.github.apizz.munki.Tart/downloads/tart-arm64.tar.gz',
           'destination_path': '/Users/autopkg/Library/AutoPkg/Cache/com.github.apizz.munki.Tart/unpack/'}}
Unarchiver: No value supplied for USE_PYTHON_NATIVE_EXTRACTOR, setting default value of: False
Unarchiver: Guessed archive format 'tar_gzip' from filename tart-arm64.tar.gz
Unarchiver: Unarchived /Users/autopkg/Library/AutoPkg/Cache/com.github.apizz.munki.Tart/downloads/tart-arm64.tar.gz to /Users/autopkg/Library/AutoPkg/Cache/com.github.apizz.munki.Tart/unpack/
{'Output': {}}
PkgRootCreator
{'Input': {'pkgdirs': {},
           'pkgroot': '/Users/autopkg/Library/AutoPkg/Cache/com.github.apizz.munki.Tart/scripts'}}
PkgRootCreator: Created /Users/autopkg/Library/AutoPkg/Cache/com.github.apizz.munki.Tart/scripts
{'Output': {}}
PkgRootCreator
{'Input': {'pkgdirs': {'Library': '0755',
                       'Library/Application Support': '0755',
                       'Library/Application Support/Tart': '0755'},
           'pkgroot': '/Users/autopkg/Library/AutoPkg/Cache/com.github.apizz.munki.Tart/pkgroot'}}
PkgRootCreator: Created /Users/autopkg/Library/AutoPkg/Cache/com.github.apizz.munki.Tart/pkgroot
PkgRootCreator: Creating Library
PkgRootCreator: Created /Users/autopkg/Library/AutoPkg/Cache/com.github.apizz.munki.Tart/pkgroot/Library
PkgRootCreator: Creating Library/Application Support
PkgRootCreator: Created /Users/autopkg/Library/AutoPkg/Cache/com.github.apizz.munki.Tart/pkgroot/Library/Application Support
PkgRootCreator: Creating Library/Application Support/Tart
PkgRootCreator: Created /Users/autopkg/Library/AutoPkg/Cache/com.github.apizz.munki.Tart/pkgroot/Library/Application Support/Tart
{'Output': {}}
Copier
{'Input': {'destination_path': '/Users/autopkg/Library/AutoPkg/Cache/com.github.apizz.munki.Tart/pkgroot/Library/Application '
                               'Support/Tart/',
           'overwrite': True,
           'source_path': '/Users/autopkg/Library/AutoPkg/Cache/com.github.apizz.munki.Tart/unpack/'}}
Copier: Parsed dmg results: dmg_path: /Users/autopkg/Library/AutoPkg/Cache/com.github.apizz.munki.Tart/unpack/, dmg: , dmg_source_path: 
Copier: Copied /Users/autopkg/Library/AutoPkg/Cache/com.github.apizz.munki.Tart/unpack/ to /Users/autopkg/Library/AutoPkg/Cache/com.github.apizz.munki.Tart/pkgroot/Library/Application Support/Tart/
{'Output': {}}
FileCreator
{'Input': {'file_content': '#!/bin/bash\n'
                           '\n'
                           'set -e\n'
                           '\n'
                           '# Remove existing symlink/executable\n'
                           'rm -rf /usr/local/bin/tart\n'
                           '\n'
                           '# Create new executable\n'
                           'echo "#!/bin/sh" > /usr/local/bin/tart\n'
                           'echo "exec \'/Library/Application '
                           "Support/Tart/tart.app/Contents/MacOS/tart' "
                           '\\"\\$@\\"" >> /usr/local/bin/tart\n'
                           '\n'
                           '# Set permissions\n'
                           'chmod +x /usr/local/bin/tart\n',
           'file_mode': '0755',
           'file_path': '/Users/autopkg/Library/AutoPkg/Cache/com.github.apizz.munki.Tart/scripts/postinstall'}}
FileCreator: Created file at /Users/autopkg/Library/AutoPkg/Cache/com.github.apizz.munki.Tart/scripts/postinstall
{'Output': {}}
PkgCreator
{'Input': {'pkg_request': {'chown': [{'group': 'wheel',
                                      'path': 'Library',
                                      'user': 'root'}],
                           'id': 'com.github.cirruslabs.tart-app',
                           'options': 'purge_ds_store',
                           'pkgdir': '/Users/autopkg/Library/AutoPkg/Cache/com.github.apizz.munki.Tart',
                           'pkgname': 'Tart-arm64-2.18.5',
                           'scripts': 'scripts',
                           'version': '2.18.5'}}}
PkgCreator: Connecting
PkgCreator: Sending packaging request
PkgCreator: Disconnecting
PkgCreator: Failed to close socket: [Errno 9] Bad file descriptor
{'Output': {'new_package_request': True,
            'pkg_creator_summary_result': {'data': {'identifier': 'com.github.cirruslabs.tart-app',
                                                    'pkg_path': '/Users/autopkg/Library/AutoPkg/Cache/com.github.apizz.munki.Tart/Tart-arm64-2.18.5.pkg',
                                                    'version': '2.18.5'},
                                           'report_fields': ['identifier',
                                                             'version',
                                                             'pkg_path'],
                                           'summary_text': 'The following '
                                                           'packages were '
                                                           'built:'},
            'pkg_path': '/Users/autopkg/Library/AutoPkg/Cache/com.github.apizz.munki.Tart/Tart-arm64-2.18.5.pkg'}}
com.github.homebysix.FindAndReplace/FindAndReplace
{'Input': {'find': 'amd64', 'input_string': 'arm64', 'replace': 'x86_64'}}
FindAndReplace: Replacing "amd64" with "x86_64" in "arm64".
{'Output': {'output_string': 'arm64'}}
MunkiPkginfoMerger
{'Input': {'additional_pkginfo': {'supported_architectures': ['arm64']},
           'pkginfo': {'catalogs': ['testing'],
                       'category': 'Virtualization',
                       'description': 'macOS VMs on Apple Silicon to use in CI '
                                      'and other automations.',
                       'developer': 'Cirrus Labs',
                       'display_name': 'Tart',
                       'minimum_os_version': '12.0',
                       'name': 'Tart',
                       'unattended_install': True}}}
MunkiPkginfoMerger: Merged {'supported_architectures': ['arm64']} into pkginfo
{'Output': {'pkginfo': {'catalogs': ['testing'],
                        'category': 'Virtualization',
                        'description': 'macOS VMs on Apple Silicon to use in '
                                       'CI and other automations.',
                        'developer': 'Cirrus Labs',
                        'display_name': 'Tart',
                        'minimum_os_version': '12.0',
                        'name': 'Tart',
                        'supported_architectures': ['arm64'],
                        'unattended_install': True}}}
MunkiImporter
{'Input': {'MUNKI_REPO': '/Users/Shared/munki_repo',
           'pkg_path': '/Users/autopkg/Library/AutoPkg/Cache/com.github.apizz.munki.Tart/Tart-arm64-2.18.5.pkg',
           'pkginfo': {'catalogs': ['testing'],
                       'category': 'Virtualization',
                       'description': 'macOS VMs on Apple Silicon to use in CI '
                                      'and other automations.',
                       'developer': 'Cirrus Labs',
                       'display_name': 'Tart',
                       'minimum_os_version': '12.0',
                       'name': 'Tart',
                       'supported_architectures': ['arm64'],
                       'unattended_install': True},
           'repo_subdirectory': 'cli-tools/tart/arm64'}}
MunkiImporter: No value supplied for MUNKI_REPO_PLUGIN, setting default value of: FileRepo
MunkiImporter: No value supplied for MUNKILIB_DIR, setting default value of: /usr/local/munki
MunkiImporter: No value supplied for force_munki_repo_lib, setting default value of: False
MunkiImporter: Using repo lib: AutoPkgLib
MunkiImporter:         plugin: FileRepo
MunkiImporter:           repo: /Users/Shared/munki_repo
MunkiImporter: Copied pkginfo to: /Users/Shared/munki_repo/pkgsinfo/cli-tools/tart/arm64/Tart-2.18.5.plist
MunkiImporter:            pkg to: /Users/Shared/munki_repo/pkgs/cli-tools/tart/arm64/Tart-arm64-2.18.5.pkg
{'Output': {'munki_importer_summary_result': {'data': {'catalogs': 'testing',
                                                       'icon_repo_path': '',
                                                       'name': 'Tart',
                                                       'pkg_repo_path': 'cli-tools/tart/arm64/Tart-arm64-2.18.5.pkg',
                                                       'pkginfo_path': 'cli-tools/tart/arm64/Tart-2.18.5.plist',
                                                       'version': '2.18.5'},
                                              'report_fields': ['name',
                                                                'version',
                                                                'catalogs',
                                                                'pkginfo_path',
                                                                'pkg_repo_path',
                                                                'icon_repo_path'],
                                              'summary_text': 'The following '
                                                              'new items were '
                                                              'imported into '
                                                              'Munki:'},
            'munki_info': {'_metadata': {'created_by': 'autopkg',
                                         'creation_date': datetime.datetime(2024, 10, 12, 14, 30, 58),
                                         'munki_version': '6.5.0.4659',
                                         'os_version': '14.7'},
                           'autoremove': False,
                           'catalogs': ['testing'],
                           'category': 'Virtualization',
                           'description': 'macOS VMs on Apple Silicon to use '
                                          'in CI and other automations.',
                           'developer': 'Cirrus Labs',
                           'display_name': 'Tart',
                           'installed_size': 12512,
                           'installer_item_hash': '48792b27963b453cff824fd418d32d28d96ce04e8556cd02227d802d1e1b949e',
                           'installer_item_location': 'cli-tools/tart/arm64/Tart-arm64-2.18.5.pkg',
                           'installer_item_size': 3696,
                           'minimum_os_version': '12.0',
                           'name': 'Tart',
                           'receipts': [{'installed_size': 12512,
                                         'packageid': 'com.github.cirruslabs.tart-app',
                                         'version': '2.18.5'}],
                           'supported_architectures': ['arm64'],
                           'unattended_install': True,
                           'uninstall_method': 'removepackages',
                           'uninstallable': True,
                           'version': '2.18.5'},
            'munki_repo_changed': True,
            'pkg_repo_path': '/Users/Shared/munki_repo/pkgs/cli-tools/tart/arm64/Tart-arm64-2.18.5.pkg',
            'pkginfo_repo_path': '/Users/Shared/munki_repo/pkgsinfo/cli-tools/tart/arm64/Tart-2.18.5.plist'}}
Receipt written to /Users/autopkg/Library/AutoPkg/Cache/com.github.apizz.munki.Tart/receipts/Tart.munki-receipt-20241012-103058.plist

The following new items were downloaded:
    Download Path                                                                             
    -------------                                                                             
    /Users/autopkg/Library/AutoPkg/Cache/com.github.apizz.munki.Tart/downloads/tart-arm64.tar.gz  

The following packages were built:
    Identifier                      Version  Pkg Path                                                                            
    ----------                      -------  --------                                                                            
    com.github.cirruslabs.tart-app  2.18.5   /Users/autopkg/Library/AutoPkg/Cache/com.github.apizz.munki.Tart/Tart-arm64-2.18.5.pkg  

The following new items were imported into Munki:
    Name  Version  Catalogs  Pkginfo Path                            Pkg Repo Path                               Icon Repo Path  
    ----  -------  --------  ------------                            -------------                               --------------  
    Tart  2.18.5   testing   cli-tools/tart/arm64/Tart-2.18.5.plist  cli-tools/tart/arm64/Tart-arm64-2.18.5.pkg

@apizz apizz merged commit d88da32 into autopkg:master Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants