Try to use .dmg installers on macOS before .tar.gz#1320
Conversation
|
Might be worth sticking a link to this comment as a code comment somewhere here, otherwise people (like me) might forget why the |
|
|
||
| #[cfg(target_os = "macos")] | ||
| fn try_download_dmg_with_fallback(url: &url::Url, target_path: &Path) -> Result<(String, bool)> { | ||
| let dmg_url = if url.as_str().ends_with(".tar.gz") { |
There was a problem hiding this comment.
We should really handle that in the construction of the version db, right? I.e. where there is a dmg file available, the UrlPath path in the version DB should just point to that.
There was a problem hiding this comment.
I thought about that but would that be backwards compatible? The db needs to serve before and after we add dmg support
There was a problem hiding this comment.
The version db file itself is versioned, so when we update the schema (which this would essentially be a case of) we would publish it as version db 2 file, so any old client would just stay on the old version file. Would actually be good to test such a version db schema change with a relatively simply case like this one.
There was a problem hiding this comment.
I spent some time trying to figure out the database update approach and don't think I understand how to add the v2 database and keep updating the v1 database.
I think implementing that is a bit outside of my wheelhouse...
Do you think we could proceed with this approach for now, with a TODO to update the database version format appropriately?
There was a problem hiding this comment.
I think my original thinking for DB versions was that we stop updating v1 database once we start to publish v2 databases. The general idea for Juliaup is that the binaries need to be kept up-to-date.
I would prefer that we try to do this with a DB update, I'm happy to help with that.
One thing I don't fully understand yet: do we need this stuff for only the PR type channels, or for everything?
There was a problem hiding this comment.
Oh, and I can help with the DB update!
There was a problem hiding this comment.
Thanks.
It's needed for all official releases. I'm not sure which of the nightlies or PRs have dmgs
There was a problem hiding this comment.
@davidanthoff to try and help this move along I've given the database format changes a go. What do you think?
There was a problem hiding this comment.
I think we need to keep moving forward here, so I'm going to implement the dmg switch via the workaround for now, and we can do the db format switch when you have time @davidanthoff
0eab19a to
9a3cd9d
Compare
This implements DMG support for macOS installations using runtime URL conversion from .tar.gz to .dmg, with fallback to tarball if DMG is not available. Changes: - Add resolve_julia_binary_path() to handle .app bundle installations - Add download_extract_dmg() and try_download_dmg_with_fallback() for DMG handling - Convert .tar.gz URLs to .dmg on macOS at runtime (string replacement) - Only do notarization check for stdlib when using tarballs on macOS - Add TODOs for future database schema v2 that would include multiple ranked download sources (DMG, tarball) to eliminate runtime string manipulation See discussion at: #1320
9a3cd9d to
f9ed23f
Compare
This implements DMG support for macOS installations using runtime URL conversion from .tar.gz to .dmg, with fallback to tarball if DMG is not available. Changes: - Add resolve_julia_binary_path() to handle .app bundle installations - Add download_extract_dmg() and try_download_dmg_with_fallback() for DMG handling - Convert .tar.gz URLs to .dmg on macOS at runtime (string replacement) - Only do notarization check for stdlib when using tarballs on macOS - Add TODOs for future database schema v2 that would include multiple ranked download sources (DMG, tarball) to eliminate runtime string manipulation See discussion at: #1320
f9ed23f to
dfb6941
Compare
This implements DMG support for macOS installations using runtime URL conversion from .tar.gz to .dmg, with fallback to tarball if DMG is not available. Changes: - Add resolve_julia_binary_path() to handle .app bundle installations - Add download_extract_dmg() and try_download_dmg_with_fallback() for DMG handling - Convert .tar.gz URLs to .dmg on macOS at runtime (string replacement) - Only do notarization check for stdlib when using tarballs on macOS - Add TODOs for future database schema v2 that would include multiple ranked download sources (DMG, tarball) to eliminate runtime string manipulation See discussion at: #1320
dfb6941 to
da8b93b
Compare
|
Note that this speeds up macOS CI to be in line with other platforms. aarch - 19m -> 8m |
c1f3150 to
8338920
Compare
On macOS, attempt to download .dmg files first when installing Julia, falling back to .tar.gz if unavailable. DMG-distributed .app bundles come with notarization tickets intact, avoiding the need for the stdlib notarization check and local codesigning of PR builds. Key changes: - Add download_extract_dmg and try_download_dmg_with_fallback for DMG-first installation with automatic tarball fallback - Add resolve_julia_binary_path to handle .app bundle directory structure (Contents/Resources/julia/bin/julia) vs flat layout - Store pre-computed binary_path in config for efficient launch, with runtime fallback for backward compatibility - Skip codesigning for PR builds installed via DMG (already signed) - Use resolve_julia_binary_path in codesign_pr_build_if_needed so paths are correct for both .app bundles and tarball layouts - Add HTTP sta On macOS, attempt to download .dmg files first when installing Julia, falling back to .tar.gz if unavailable. DMG-distributed .app bundles come with notarization tauthored-by: Claude <noreply@anthropic.com>
8338920 to
9fe2e4b
Compare
Necessary after JuliaLang/juliaup#1320
* CI: Fix macOS tests after JuliaLang/juliaup#1320 Necessary after JuliaLang/juliaup#1320 * Add some more debugging output
Summary
Use DMG installers instead of tarballs on macOS when available. This avoids the need for notarizing the standard library since DMG-distributed
.appbundles come with notarization tickets intact.Also strips the
com.apple.quarantineextended attribute after extraction (both DMG and tarball) to prevent Gatekeeper/XProtect scanning delays during installation.Changes
.dmgfiles first, falling back to.tar.gzif unavailable.appbundle directory structure (Contents/Resources/julia/bin/julia) when resolving Julia binary paths viaresolve_julia_binary_pathcom.apple.quarantinexattr after extraction to avoid Gatekeeper scanning delays that were causing macOS CI to take 20-45 minutesDmgMountGuardensures DMG volumes are always detached, even on error pathsBinaryPathfield,skip_serializing_if = "Option::is_none"for backward compatibility), with runtime fallback for existing installationsis_pr && !used_dmgininstall_from_urldownload_juliaup_versionanddownload_versiondbfailuressymlink_uses_app_bundle_for_system_channel,symlink_uses_app_bundle_for_direct_download_channel,dmg_failure_falls_back_to_tarballCI performance
macOS CI time reduced significantly due to using dmgs and quarantine stripping:
Example
Technical notes
.tar.gz→.dmg) as a workaround. TODO comments document the preferred approach: a v2 database schema with multiple ranked download sources per platforminstall_from_urlandinstall_non_db_versionnow returnResult<(JuliaupConfigChannel, bool)>where the bool indicates whether a DMG was used, enabling callers to skip codesigning/notarization for DMG installssetup-juliaCI action — that downloads tarballs directly and handles notarization separately (context)Related