Bug 132860 - [Mac] run-safari doesn’t run Safari in 32-bit mode even if WebKit configuration is set to 32-bit
Summary: [Mac] run-safari doesn’t run Safari in 32-bit mode even if WebKit configurati...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2014-05-13 03:32 PDT by Csaba Osztrogonác
Modified: 2017-04-02 17:16 PDT (History)
5 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Csaba Osztrogonác 2014-05-13 03:32:32 PDT
$ Tools/Scripts/set-webkit-configuration --32-bit
$ Tools/Scripts/build-webkit
$ Tools/Scripts/run-safari

Starting SafariForWebKitDevelopment with DYLD_FRAMEWORK_PATH set to point to built WebKit in /Users/oszi/WebKit/WebKitBuild/Release.
arch: posix_spawnp: /Applications/Safari.app/Contents/MacOS/SafariForWebKitDevelopment: Bad CPU type in executable

I'm not sure if it is a bug. Is it possible to run 32 bit WebKit on 64 bit OS X?
32 JSC works fine, so I thought Safari should work too. Was it a bad assumption?

( My goal was to try to debug this bug - https://bugs.webkit.org/show_bug.cgi?id=132821 ,
but I don't have 32 bit OS installed now, neither Linux, nor OS X  )
Comment 1 Darin Adler 2014-05-13 09:35:13 PDT
I don’t know if Safari has a 32-bit binary as well as a 64-bit binary installed on the copy of OS X you have; it probably does. It won’t be included just to help us out in WebKit development, but it might well be present.

The problem you are having here is that you expected run-safari to run Safari in 32-bit mode since WebKit was configured to build 32-bit WebKit. That’s something someone might add to run-safari some day, but I don’t think anyone even suggested it before.

A way to get Safari to open in 32-bit mode is to check the "Open in 32-bit mode" check box in the Finder Info dialog for Safari. You could do that. There’s no need for you to block your work on this improvement to run-safari.
Comment 2 Alexey Proskuryakov 2014-05-13 10:10:25 PDT
One way to test what architectures are supported by Safari is with file command:

file /Applications/Safari.app/Contents/MacOS/SafariForWebKitDevelopment

> Is it possible to run 32 bit WebKit on 64 bit OS X?

I expect that it's possible with MiniBrowser, although I haven't tried that. There is no special 32-bit version of OS X.
Comment 3 Brian Burg 2017-04-02 15:40:13 PDT
This should work fine nowadays, as we usually route through arch(1) and stick in the current architecture:

sub runMacWebKitApp($;$)
    my ($appPath, $useOpenCommand) = @_;
    my $productDir = productDir();
    print "Starting @{[basename($appPath)]} with DYLD_FRAMEWORK_PATH set to point to built WebKit in $productDir.\n";

    local %ENV = %ENV;

    if (defined($useOpenCommand) && $useOpenCommand == USE_OPEN_COMMAND) {
        return system("open", "-W", "-a", $appPath, "--args", argumentsForRunAndDebugMacWebKitApp());
    if (architecture()) {
        return system "arch", "-" . architecture(), archCommandLineArgumentsForRestrictedEnvironmentVariables(), $appPath, argumentsForRunAndDebugMacWebKitApp();
    return system { $appPath } $appPath, argumentsForRunAndDebugMacWebKitApp();
Comment 4 Alexey Proskuryakov 2017-04-02 17:16:03 PDT
And to clarify, Safari has long been 64-bit only now.