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

How to run the samples on M1 macOS on 'arm64' architecture? Issues with resources? #509

Open
Dima-369 opened this issue Aug 3, 2024 · 5 comments

Comments

@Dima-369
Copy link

Dima-369 commented Aug 3, 2024

Hi, I want to test out Ultralight on my M1 macOS. I tried both 1.4.x and v1.4.0b, and it successfully compiles, but launching any .app instantly crashes with this error:

Termination Reason:    Namespace DYLD, Code 1 Library missing
Library not loaded: @rpath/libUltralightCore.dylib

I was able to fix it by manually modifying the Info.plist for the apps like in ultralight-sdk-latest-mac-arm64/build/samples/Sample 8 - Web Browser/Sample8.app/Contents/Info.plist by adding:

<key>DYLD_LIBRARY_PATH</key>
<string>/Users/dima/Downloads/ultralight-sdk-latest-mac-arm64/bin/</string>

Now, it does not crash instantly, but reports this error:

Failed to load ICU data (icudt67l.dat) from the FileSystem interface. Make sure that you've defined a FileSystem and the file can be found in the correct path. Aborting.

and this:

Could not load resource: resources/icudt67l.dat, FileSystem::FileExists() returned false.

Does anyone know how to fix this? Thanks!

@robotogre
Copy link

I'm having the same issue.

@OndrejKarlik
Copy link

The issue happens on all OS, there is probably a bug in cmake/build scripts that causes the resources not be copied where they need to be, if you copy them manually it works

@robotogre
Copy link

robotogre commented Aug 26, 2024

@OndrejKarlik

resources not be copied where they need to be, if you copy them manually it works

Where should they be copied to exactly? I've copied the 'resources' folder from ultralight-sdk-latest-mac-arm64/build to ultralight-sdk-latest-mac-arm64/build/samples/Sample 1 - Render to PNG

Screenshot 2024-08-25 at 9 40 08 PM
robotogre@MBP:~/Downloads/ultralight-sdk-latest-mac-arm64/build/samples/Sample 1 - Render to PNG $ ./Sample1
Initializing Ultralight v1.4.0 (WebKit 615.1.18.100.1) with the following configuration
    cache_path:
    resource_path_prefix: resources/
    face_winding: CounterClockwise
    font_hinting: Normal
    font_gamma: 1.8
    force_repaint: disabled
    animation_timer_delay: 16.7 ms
    scroll_timer_delay: 16.7 ms
    recycle_delay: 4.0 s
    memory_cache_size: 64.00 MB
    page_cache_size: 0 pages
    override_ram_size: disabled
    min_large_heap_size: 32.00 MB
    min_small_heap_size: 1.00 MB
    num_renderer_threads: 0
    max_update_time: 5.0 ms
    bitmap_alignment: 16


Could not load resource: resources/icudt67l.dat, FileSystem::FileExists() returned false.

Failed to load ICU data (icudt67l.dat) from the FileSystem interface. Make sure that you've defined a FileSystem and the file can be found in the correct path. Aborting.

@OndrejKarlik
Copy link

Ultralight filesystem works from ./assets/ by default, so that would be ./assets/resources/icudt67l.dat (relative to CWD of the process). This works on my machine. But looking at the code it might be different on macOS based on its app conventions. See ultralight::Settings::file_system_path and ultralight::Config::resource_path_prefix

@robotogre
Copy link

robotogre commented Aug 26, 2024

@OndrejKarlik

Ultralight filesystem works from ./assets/ by default

It works!!!!!

Thank you so much for taking the time to help.

ultralight-sdk-latest-mac-arm64/build/samples/Sample 1 - Render to PNG/assets/resources

ultralight-sdk-latest-mac-arm64/build/samples/Sample 7 - OpenGL Integration/Sample7.app/Contents/MacOS/assets/resources

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

No branches or pull requests

3 participants