Could not resolve reference for target 'Toffee-iOS' (Simulator)

Hi,
Im having a problem building a project for the simulator.

build-simulator.log.zip (127.8 KB)

My simple projects build fine if I reference individual remote references and local references. Does that build log provide any info ?

I looked at one of the obj folders its complaining about

Screen Shot 2022-07-11 at 9.40.53 PM

and it does seem to be missing a simulator folder

If you look at this one

Screen Shot 2022-07-11 at 9.43.28 PM

It has a simulator folder.

Cheers,
John

If I create another ios project with the references it builds. I can then build the original project

this seems a bit vague to to be actionable, TBH.

                     Reference 'libMoshine.Services.Location' was resolved to '/Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/Obj/Moshine.Services.Location-42BAF2B1FD160DFD99F9F596F7A87FC4589C797F/Debug/Toffee.iOS/Device/libMoshine.Services.Location.fx' for target 'Toffee-iOS' (Device).
E:                   Could not resolve reference 'libMoshine.Services.Location' for target 'Toffee-iOS' (Simulator).

sounds like .../Toffee.iOS/Simulator/libMoshine.Services.Location.fx' does not exist. If that’s not it, try building with --debug-reference-resolving to see morfe details for all the places it looks for references (i’m not sure that switch covers the “resolve other build destinations too” logic, but it might; i’ll check & fix that if it doesnt)

It did not; fixed.

Yeah the simulator fx files aren’t being produced. My trick with a second ios with the remote references doesnt seem to work now.

Should they, though? I need to know more context.

I cant seem to reproduce from the commandline.

I deleted /Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/Obj/

and then did a

ebuild --debug-reference-resolving --configuration:Debug --setting:Simulator=True

and it builds ok.

I delete the obj folder again. Making sure I have the simulator selected and build. 2 of the remote references dont have simulator folders. The other 2 do.


Its a toffee ios app with 4 remote multi target project references. Shouldnt that create simulator folders in obj ?

Weird, so you have three remote references. a complete cleaned Obj folder, and when you build your project for sim, only two of the remote refs get built for Sim? does the third one get built at all? For Device?

Can you post the rebuild command-line from inside Fire, so I can compare it to the one you used manually (though that one looks good)?

Any chance I can the project (or a project with the same three references, that shows the same problem — I don’t need your code) as a test case?

Oh, and can I see those two build logs? (ideally clean Obj before the command line run, too. And you can drop --debug-reference-resolving. If the Sim ref isn’t there, its not a mystery why it doesn’t find it ;).The mystery is why one of the three refs doesn’t get built for Sim…

EverythingApp.zip (4.9 MB)
This is just a project with the references.
It looks like half the references have just device and the others have device and simulator

Okay, cool. Not to find out whats the difference between those two :wink:

deleted Obj and Packages\EBuild. Build from IDE, command line is

/Users/mh/Code/Fire/Bin/Build/macOS/Fire.app/Contents/Resources/Mono/bin/mono-sgen
/Users/mh/Code/EBuild/Bin/EBuild.exe
/Users/mh/Downloads/EverythingApp/EverythingApp.sln
--logger:fire
--configuration:Debug
--no-goal
--setting:BD2228EB-2DEB-47DA-BEA6-710D5F4487C3,Simulator=True
--setting:BD2228EB-2DEB-47DA-BEA6-710D5F4487C3,Device=False
--debug
--statistics
--verbosity:diagnostic
--xml:/var/folders/9f/k6_0xsw91hdbgjgkby0zs6xc0000gn/T/EverythingApp.fire.xml
--build
--setting:TreatFixableErrorsAsWarnings=True
--setting:EBuild:ElementsCompilerDll=/Users/mh/Code/Elements/Bin/RemObjects.Elements.dll

Oddly, on first build I get a compiler crash (no actionable stack trace, so I’ll have to investigate later). if I build again, it builds clean (some 365 warnings.hints that look valid/expected, except for one set I’ll log). All four remote references have ./Debug/Toffee.iOS/Simulator folders with the binaries present.

What could I be missing?

Which two projects are not getting build for the sim, for you (so I can have a dry look and see if I notice something).

Also

Logged as bugs://E26005. for odd/invalid “NW3 Format string should be a literal” warnings (which I cannot reproduce outside of your project, oddly).

I get

Could not resolve reference 'libMoshine.UI.MapKit' for target 'Toffee-iOS' (Simulator).
Could not resolve reference 'libMoshine.Api.Weather' for target 'Toffee-iOS' (Simulator).

This is the log from Fire
fire-build-log.zip (77.7 KB)

log-console.log.zip (10.7 KB)

and this is from the console

It appears the reverse happens when I build from the console. I get 2 with simulator and 2 with simulator and device.

Curious:

               <- Task RemObjects.EBuild.Elements.ElementsPrepareIslandPlatform finished for Moshine.UI.MapKit, Island.Darwin.iOS, took 0.4443s (0.444s).
D:             Target-specific Settings, after prepare
D:               - <Debice = True [Target: Island.Darwin.iOS]>
D:               - <FinalBinaryName = libMoshine.UI.MapKit.a [Target: Island.Darwin.iOS]>
D:               - <FinalOutputFolderOverride-Simulator = ../iOS Simulator [Target: Island.Darwin.iOS]>
D:               - <Simulator = True [Target: Island.Darwin.iOS]>
...

               <- Task PrepareToffeePlatform finished for Moshine.UI.MapKit, Toffee.iOS, took 0.3825s (0.382s).
D:             Target-specific Settings, after prepare
D:               - <FinalBinaryName = libMoshine.UI.MapKit.a [Target: Toffee.iOS]>
D:               - <FinalOutputFolderOverride-Simulator = ../iOS Simulator [Target: Toffee.iOS]>

Darwin.iOS gets Device and Simulator set, Toffee.iOS does not…

this happens in this method:

    method CloneRelevantSettingsFromProjectForRemoteProjectReference(aOtherProject: InstanceType); override;
    begin

      for each t in EnabledTargets do begin
        for each ot in aOtherProject.EnabledTargets do begin
          if TargetsMatch(t, ot) then begin

            t.Setting["Device"] := "True";
            t.Setting["Simulator"] := "True";
            if ot.SettingIsTrue["SupportMacCatalyst"] then
              t.Setting["Mac"] := "True";

            MergeAllArchtectures(t, ot);

          end;
        end;
      end;
    end;

wheree TargetsMatch is

    method TargetsMatch(t, ot: EBuildTarget): Boolean; private;
    begin
      result := (t.Mode = ot.Mode) and ((t.SubMode = ot.SubMode) or (t.SDK = ot.SDK));
      if (t.Mode = "Island") and (t.SubMode = "Darwin") and (ot.Mode = "Toffee") and (t.Setting["SDK"]:Value = ot.SubMode) and ot.SettingIsTrue["UseLegacyToffeeMode"] then
        result := true;
      if (ot.Mode = "Island") and (ot.SubMode = "Darwin") and (t.Mode = "Toffee") and (ot.Setting["SDK"]:Value = t.SubMode) and t.SettingIsTrue["UseLegacyToffeeMode"] then
        result := true;
    end;

I presume for some reason this fails for you for these two projects, but not the other two, but somehow not for me here, which of course makes this hard to debug…


lets compare what these look like before this happens

            -> Task RemObjects.EBuild.Elements.ElementsPreparePlatforms started for Moshine.Foundation, Toffee.iOS.
               Preparing target 'Toffee.iOS' (platform 'Toffee').
D:             Target-specific Settings, before prepare
D:               - <Architecture = all [Target: Toffee.iOS]>
D:               - <DefaultUses = Foundation;RemObjects.Elements.Linq [Target: Toffee.iOS]>
D:               - <Device = True [Target: Toffee.iOS]>
D:               - <GenerateBitcode = True [Target: Toffee.iOS]>
D:               - <ImpliedConditionalDefines = TOFFEEV1 [Target: Toffee.iOS]>
D:               - <Mode = Toffee [Target: Toffee.iOS]>
D:               - <ModeNameResolveOverride = ToffeeV1 [Target: Toffee.iOS]>
D:               - <SDK = iOS [Target: Toffee.iOS]>
D:               - <Simulator = True [Target: Toffee.iOS]>
D:               - <SimulatorArchitecture = all [Target: Toffee.iOS]>
D:               - <SupportMacCatalyst = False [Target: Toffee.iOS]>

vs

               Preparing target 'Toffee.iOS' (platform 'Toffee').
D:             Target-specific Settings, before prepare
D:               - <DefaultUses = Foundation;RemObjects.Elements.Linq [Target: Toffee.iOS]>
D:               - <ImpliedConditionalDefines = TOFFEEV1 [Target: Toffee.iOS]>
D:               - <Mode = Toffee [Target: Toffee.iOS]>
D:               - <ModeNameResolveOverride = ToffeeV1 [Target: Toffee.iOS]>
D:               - <SDK = iOS [Target: Toffee.iOS]>
D:               - <SupportMacCatalyst = False [Target: Toffee.iOS]>

vs

            -> Task RemObjects.EBuild.Elements.ElementsPreparePlatforms started for EverythingApp, Toffee-iOS.
               Preparing target 'Toffee-iOS' (platform 'Toffee').
D:             Target-specific Settings, before prepare
D:               - <BinaryName = EverythingApp [Target: Toffee-iOS]>
D:               - <ImpliedConditionalDefines = TOFFEEV1 [Target: Toffee-iOS]>
D:               - <Mode = Toffee [Target: Toffee-iOS]>
D:               - <ModeNameResolveOverride = ToffeeV1 [Target: Toffee-iOS]>
D:               - <SubMode = iOS [Target: Toffee-iOS]>

this could be it. EverythingApp has a SubMode set bu no SDK, and the references have SDK set, but no submode (which is fine, per se, the two settings are interchangeable, for ToffeeV1). But if thats the case, why don’t both fail? to pirate the Simulator setting? And why doesn’t it fail here for me too?

I checked and Foundation doesn’t have Simulator=true pre-set in the project, either…

adding sue logging to TargetsMatch, here i get

CloneRelevantSettingsFromProject EverythingApp to Moshine.UI.MapKit
TargetsMatch? Moshine.UI.MapKit/Island.Darwin.iOS vs EverythingApp/Toffee-iOS : True
CloneRelevantSettingsFrom Target Toffee-iOS to Island.Darwin.iOS
TargetsMatch? Moshine.UI.MapKit/Toffee.iOS vs EverythingApp/Toffee-iOS : True
CloneRelevantSettingsFrom Target Toffee-iOS to Toffee.iOS

and indeed locally I get

            -> Task RemObjects.EBuild.Elements.ElementsPreparePlatforms started for Moshine.UI.MapKit, Toffee.iOS.
               Preparing target 'Toffee.iOS' (platform 'Toffee').
D:             Target-specific Settings, before prepare
D:               - <DefaultUses = Foundation;RemObjects.Elements.Linq [Target: Toffee.iOS]>
D:               - <Device = True [Target: Toffee.iOS]>
D:               - <ImpliedConditionalDefines = TOFFEEV1 [Target: Toffee.iOS]>
D:               - <Mode = Toffee [Target: Toffee.iOS]>
D:               - <ModeNameResolveOverride = ToffeeV1 [Target: Toffee.iOS]>
D:               - <SDK = iOS [Target: Toffee.iOS]>
D:               - <Simulator = True [Target: Toffee.iOS]>
D:               - <SupportMacCatalyst = False [Target: Toffee.iOS]>

best I can think right now is to send you a build with this and some more logging in TaregstMatch and see what it says for you?

1 Like

Build “20220713-170324-elements-develop started on talax” started now should have the logging. you should see something like

CloneRelevantSettingsFromProject EverythingApp to Moshine.Api.Location
  TargetsMatch? Moshine.Api.Location/Echoes.Full vs EverythingApp/Toffee-iOS : False
    why not?
    t.Mode Echoes
    ot.Mode Toffee
  TargetsMatch? Moshine.Api.Location/Echoes.Core vs EverythingApp/Toffee-iOS : False
    why not?
    t.Mode Echoes
    ot.Mode Toffee
  TargetsMatch? Moshine.Api.Location/Echoes.Standard vs EverythingApp/Toffee-iOS : False
    why not?
    t.Mode Echoes
    ot.Mode Toffee
  TargetsMatch? Moshine.Api.Location/Island.Linux vs EverythingApp/Toffee-iOS : False
    why not?
    t.Mode Island
    ot.Mode Toffee
  TargetsMatch? Moshine.Api.Location/Island.Darwin.macOS vs EverythingApp/Toffee-iOS : False
    why not?
    t.Mode Island
    ot.Mode Toffee
  TargetsMatch? Moshine.Api.Location/Island.Darwin.iOS vs EverythingApp/Toffee-iOS : True
    CloneRelevantSettingsFrom Target Toffee-iOS to Island.Darwin.iOS
  TargetsMatch? Moshine.Api.Location/Island.Darwin.tvOS vs EverythingApp/Toffee-iOS : False
    why not?
    t.Mode Island
    ot.Mode Toffee
  TargetsMatch? Moshine.Api.Location/Island.Darwin.watchOS vs EverythingApp/Toffee-iOS : False
    why not?
    t.Mode Island
    ot.Mode Toffee
  TargetsMatch? Moshine.Api.Location/Island.WebAssembly vs EverythingApp/Toffee-iOS : False
    why not?
    t.Mode Island
    ot.Mode Toffee
  TargetsMatch? Moshine.Api.Location/Toffee.iOS vs EverythingApp/Toffee-iOS : True
    CloneRelevantSettingsFrom Target Toffee-iOS to Toffee.iOS
  TargetsMatch? Moshine.Api.Location/Toffee.macOS vs EverythingApp/Toffee-iOS : False
    why not?
    t.SubMode 
    ot.SubMode iOS
    t.SDK macOS
    ot.SDK iOS
  TargetsMatch? Moshine.Api.Location/Toffee.tvOS vs EverythingApp/Toffee-iOS : False
    why not?
    t.SubMode 
    ot.SubMode iOS
    t.SDK tvOS
    ot.SDK iOS
  TargetsMatch? Moshine.Api.Location/Toffee.watchOS vs EverythingApp/Toffee-iOS : False
    why not?
    t.SubMode 
    ot.SubMode iOS
    t.SDK watchOS
    ot.SDK iOS

oddly (but this isn’t here or there), watchOS and tvOS don’t seem to have SubModes set, while iOS does… SDK is set for them, though. either way, thats not related to this issue.

bugs://E26005 was closed as fixed.

extra-log.log.zip (73.0 KB)
I got that