Skip to content

Fix macOS Photoshop architecture selection - #95

Open
namtony wants to merge 4 commits into
ynput:developfrom
namtony:fix/91-macos-architecture
Open

Fix macOS Photoshop architecture selection#95
namtony wants to merge 4 commits into
ynput:developfrom
namtony:fix/91-macos-architecture

Conversation

@namtony

@namtony namtony commented Jun 12, 2026

Copy link
Copy Markdown

Fix macOS Photoshop architecture selection

Changelog Description

Launch Photoshop with a compatible architecture on macOS instead of always
forcing x86_64.

Additional review information

The current launcher prefixes every macOS invocation with
arch -x86_64. This prevents a universal Photoshop binary from launching
natively as arm64.

The updated launcher reads the architectures supported by Photoshop and the
running Python executable with lipo -archs:

  • If the binaries share an architecture, Photoshop launches normally and
    macOS selects the native architecture.
  • If they do not share an architecture, the launcher prefixes the command
    with the architecture supported by Photoshop. This preserves Rosetta
    support for an x86-only Photoshop installation.
  • If architecture detection fails, the launcher falls back to the original
    command instead of guessing an architecture.

Resolves #91

Testing notes

Run:

python -m unittest discover -s tests -v
python -m compileall -q client/ayon_photoshop/api tests

Covered cases:

  1. Universal Photoshop plus arm64 Python launches natively.
  2. x86-only Photoshop plus arm64 Python launches through Rosetta.
  3. Failed Photoshop architecture detection preserves the original command.
  4. Failed Python architecture detection preserves the original command.

Hardware verification on an Apple Silicon Mac is still recommended before
merge.

@kalisp
kalisp requested a review from jakubjezek001 June 12, 2026 10:43
@m-u-r-p-h-y
m-u-r-p-h-y requested a review from kalisp June 29, 2026 09:30
@kalisp

kalisp commented Jul 3, 2026

Copy link
Copy Markdown
Member

Code looks ok, no idea if it is doing what is supposed to be doing.

@namtony

namtony commented Jul 3, 2026

Copy link
Copy Markdown
Author

Thanks for checking.

I tested the macOS architecture selection behavior against these cases:

  1. Universal Photoshop + Python arm64 -> native execution is preserved.
  2. Photoshop x86_64 + Python arm64 -> Python is launched through Rosetta.
  3. Photoshop architecture detection fails -> falls back to the original command.
  4. Python architecture detection fails -> falls back to the original command.

The change is intentionally conservative: if detection is uncertain, it keeps the existing behavior instead of forcing an architecture.

If there is a specific environment you are worried about, I can add a targeted test case for it.

@kalisp

kalisp commented Jul 7, 2026

Copy link
Copy Markdown
Member

(My comment was meant as a punt to @jakubjezek001 as he has Mac to actually test this;) I tested it on windows, if it doesn't break anything. It didn't. )

@kalisp kalisp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Still works on Windows, must be tested on Mac.

@BigRoy BigRoy added type: enhancement Improvement of existing functionality or minor addition community Issues and PRs coming from the community members labels Jul 7, 2026
@jakubjezek001

Copy link
Copy Markdown
Member

So the Photoshop is launching as expected. I am on arm64 and not able to test the CEP builded plugin. I was actually testing recently this PR #88 and Photoshop was also launching for me.

Questions:

  • are you using CEP or UXP @namtony
  • is Photoshop launched with rosseta even with UXP so this is solving the issue of staying at arm64

@namtony

namtony commented Aug 5, 2026

Copy link
Copy Markdown
Author

So the Photoshop is launching as expected. I am on arm64 and not able to test the CEP builded plugin. I was actually testing recently this PR #88 and Photoshop was also launching for me.

Questions:

  • are you using CEP or UXP @namtony
  • is Photoshop launched with rosseta even with UXP so this is solving the issue of staying at arm64

Thanks for testing this on Apple Silicon.

AYON Photoshop currently uses a CEP/ZXP extension, not UXP. This PR is architecture-based rather than plugin-type-based:

  • Universal Photoshop with an arm64 launcher stays native arm64.
  • An x86_64-only Photoshop binary launched from an arm64 Python process runs through Rosetta using arch -x86_64.
  • Universal binaries are not forced through Rosetta.
  • If architecture detection fails, the original launch command is preserved.

So this change does not launch UXP under Rosetta. For CEP, the x86_64-only Photoshop path is the one expected to use Rosetta. A CEP build test on Apple Silicon would be useful for final end-to-end confirmation.

@kalisp

kalisp commented Aug 5, 2026

Copy link
Copy Markdown
Member

A CEP build test on Apple Silicon would be useful for final end-to-end confirmation.

I don't think CEP is available on native Apple Silicon, or do you use it somehow in production? Ie. you ran PS natively on arm64 WITH existing extension?

@namtony

namtony commented Aug 5, 2026

Copy link
Copy Markdown
Author

A CEP build test on Apple Silicon would be useful for final end-to-end confirmation.

I don't think CEP is available on native Apple Silicon, or do you use it somehow in production? Ie. you ran PS natively on arm64 WITH existing extension?

I do not have an Apple Silicon Mac to run the final verification, but the following checks should confirm the intended behavior:

  1. Check the host architecture:
    uname -m

  2. Check Photoshop architectures:
    lipo -archs "/Applications/Adobe Photoshop [version]/Adobe Photoshop [version].app/Contents/MacOS/Adobe Photoshop"

  3. Launch AYON Photoshop with the CEP/ZXP extension installed.

  4. In Activity Monitor, enable the “Kind” column and verify:

    • Universal Photoshop launched from arm64 Python: Apple
    • x86_64-only Photoshop: Intel/Rosetta
  5. Confirm that the CEP extension loads and communicates with AYON in both supported configurations.

The PR does not claim to make CEP natively arm64-compatible. It only avoids forcing universal Photoshop through Rosetta and preserves the x86_64/Rosetta path when required.

@kalisp

kalisp commented Aug 5, 2026

Copy link
Copy Markdown
Member

I am not sure I follow, your PR is now running PS on arm64 natively, which will result in breaking integration as CEP is not supported on arm64 (mode).

My question was if you are using this in production, but this seems that this PR wasn't tested on mentioned environments. If I misunderstood, I apologize.

If it is stripping CEP integration, it is not useful at this moment, at least until move to UXP is finalized and tested.

@namtony

namtony commented Aug 6, 2026

Copy link
Copy Markdown
Author

I am not sure I follow, your PR is now running PS on arm64 natively, which will result in breaking integration as CEP is not supported on arm64 (mode).

My question was if you are using this in production, but this seems that this PR wasn't tested on mentioned environments. If I misunderstood, I apologize.

If it is stripping CEP integration, it is not useful at this moment, at least until move to UXP is finalized and tested.

Thanks for the clarification. This is helpful.

You are right that the PR has not been validated on the environments you described, and I do not have an Apple Silicon Mac to perform that end-to-end test myself.

The intended scope of this change is only architecture selection: preserve the x86_64/Rosetta path required by CEP, while avoiding an unnecessary Rosetta launch for universal Photoshop where appropriate. It does not claim that CEP works natively on arm64.

If the current behavior breaks CEP integration on native arm64, then the PR should not be merged as-is. I am happy for the maintainers to close it until the UXP migration is finalized and tested. I hope the architecture-selection notes and fallback behavior are still useful for that future work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Issues and PRs coming from the community members type: enhancement Improvement of existing functionality or minor addition

Projects

None yet

Development

Successfully merging this pull request may close these issues.

YN-0716: Photoshop macOs plugin

5 participants