AcademySoftwareFoundation / OpenTimelineIO

Open Source API and interchange format for editorial timeline information.
http://opentimeline.io
Apache License 2.0
1.4k stars 276 forks source link

BUG: M1 builds failing on M3 and with Imath 3.19? #1750

Open ggarra13 opened 1 month ago

ggarra13 commented 1 month ago

Required:


[x ] I believe this isn't a duplicate topic
[ x] This report is not related to an adapter

Select One:

[ ] Build problem
[x ] Incorrect Functionality or bug
[ ] New feature or functionality

Description

I don't own any Apple Silicon machines. I build my program on GitHub Actions which builds with:

Building with Apple clang version 15.0.0 (clang-1500.0.40.1), 3 cores Building on MacOS Brand Apple M1 (Virtual)

The code:

        const otio::Timeline* createTimelineFromString(const std::string& s)
        {
            auto timeline = dynamic_cast<otio::Timeline*>(
                otio::Timeline::from_json_string(s));
            if (!timeline)
            {
                LOG_ERROR("Could not crete timeline object from this "
                          ".json string:");
                LOG_ERROR(s);
                return nullptr;
            }
            return timeline;
        }

Returns a nullptr when passed a valid json string (which was retrieved from another otio::Timeline->to_json_string()).
It seems it is a compiler issue (or a very subtle bug on OTIO). The code works perfectly on macOS Intel, macOS M3 with Intel build under Rosseta2, Windows and Linux.

Optional


Environment

Operating System: macOS Sonoma - M3 chip (Built on GitHub Actions M1 build). OTIO version: v0.16.0 Imath version: v3.19 Python version if appropriate: N/A

Reproduction Steps

Binary reproduction (for the lazy one):

  1. For a quick check on M1 binaries (run it on an M3 box), you can check: https://sourceforge.net/projects/mrv2/files/beta/mrv2-beta-Darwin-arm64.dmg/download
  2. Load a Movie File (Open->Movie or Sequence)
  3. Open the Panel->Files Panel (F4 key).
  4. Open the Panel->Playlist (Ctrl + P)
  5. Drag the clip from the Files Panel to the Playlist. You should get an error when the timeline function fails and the .otio string that it failed with in the Logs (Panel->Logs).

Source code reproduction (cannot verify):

I've created a small stand-alone test which I am unable to test as I don't own an M1/M3 combo. You should try to compile it on an M1 box and run it on an M3 one to see if it fails. If it fails, but it should allow you to hopefully reproduce the issue (and fix the OTIO issue or report the clang bug to Apple):

m1_to_m3_otio_bug.zip

Log output if appropriate

See the output of my program when the user tried to run it on an M3 machine: https://github.com/ggarra13/mrv2/issues/238

ggarra13 commented 1 month ago

Improved source test, printing out the OTIO failure.

m1_to_m3_otio_bug.zip