Herringway/earthbound

imgui tries to build for Windows

Closed this issue · 12 comments

When I try to build:

     Warning Selected package nspcplay 0.8.2 does not match the dependency specification ~>0.9 in package earthbound:sdl. Need to "dub upgrade"?
     Warning Selected package nspcplay 0.8.2 does not match the dependency specification ~>0.9.0 in package earthbound. Need to "dub upgrade"?
     Warning Selected package bindbc-sdl 1.0.1 does not match the dependency specification ~>1.1.1 in package earthbound:sdl. Need to "dub upgrade"?
...
/home/admin/.dub/packages/d_imgui-1.89.2/d_imgui/backends_d/imgui_windows.d(11,31): Error: undefined identifier `HANDLE`
/home/admin/.dub/packages/d_imgui-1.89.2/d_imgui/backends_d/imgui_windows.d(21,6): Error: undefined identifier `BOOL`
/home/admin/.dub/packages/d_imgui-1.89.2/d_imgui/backends_d/imgui_windows.d(26,27): Error: undefined identifier `PVOID`
/home/admin/.dub/packages/d_imgui-1.89.2/d_imgui/backends_d/imgui_windows.d(26,27): Error: undefined identifier `SIZE_T`
/home/admin/.dub/packages/d_imgui-1.89.2/d_imgui/backends_d/imgui_windows.d(26,27): Error: undefined identifier `BYTE`
/home/admin/.dub/packages/d_imgui-1.89.2/d_imgui/backends_d/imgui_windows.d(27,27): Error: undefined identifier `PVOID`
/home/admin/.dub/packages/d_imgui-1.89.2/d_imgui/backends_d/imgui_windows.d(27,27): Error: undefined identifier `SIZE_T`
/home/admin/.dub/packages/d_imgui-1.89.2/d_imgui/backends_d/imgui_windows.d(34,26): Error: undefined identifier `LPARAM`
/home/admin/.dub/packages/d_imgui-1.89.2/d_imgui/backends_d/imgui_windows.d(35,26): Error: undefined identifier `LPARAM`
/home/admin/.dub/packages/d_imgui-1.89.2/d_imgui/backends_d/imgui_windows.d(36,26): Error: undefined identifier `WPARAM`

Should be fixed once KytoDragon/imgui#3 is merged

After manually applying those changes, I'm now getting errors in this repository itself:

     Warning Selected package nspcplay 0.8.2 does not match the dependency specification ~>0.9 in package earthbound:sdl. Need to "dub upgrade"?
     Warning Selected package nspcplay 0.8.2 does not match the dependency specification ~>0.9.0 in package earthbound. Need to "dub upgrade"?
     Warning Selected package bindbc-sdl 1.0.1 does not match the dependency specification ~>1.1.1 in package earthbound:sdl. Need to "dub upgrade"?
...
sdl/source/audio.d(46,15): Error: no property `restoreVolume` for `nspcplayer` of type `nspcplay.player.NSPCPlayer`
sdl/source/audio.d(51,16): Error: no property `restoreChannelVolume` for `nspcplayer` of type `nspcplay.player.NSPCPlayer`
sdl/source/audio.d(56,15): Error: no property `restoreTempo` for `nspcplayer` of type `nspcplay.player.NSPCPlayer`
sdl/source/audio.d(59,14): Error: no property `transpose` for `nspcplayer` of type `nspcplay.player.NSPCPlayer`
sdl/source/audio.d(62,14): Error: no property `fade` for `nspcplayer` of type `nspcplay.player.NSPCPlayer`
sdl/source/audio.d(66,14): Error: no property `fade` for `nspcplayer` of type `nspcplay.player.NSPCPlayer`
sdl/source/audio.d(77,14): Error: no property `transpose` for `nspcplayer` of type `nspcplay.player.NSPCPlayer`
sdl/source/audio.d(78,33): Error: no property `tempo` for `nspcplayer` of type `nspcplay.player.NSPCPlayer`
sdl/source/audio.d(79,14): Error: no property `tempo` for `nspcplayer` of type `nspcplay.player.NSPCPlayer`
sdl/source/audio.d(80,14): Error: no property `addTimer` for `nspcplayer` of type `nspcplay.player.NSPCPlayer`
sdl/source/audio.d(86,14): Error: no property `addTimer` for `nspcplayer` of type `nspcplay.player.NSPCPlayer`
sdl/source/audio.d(92,14): Error: no property `addTimer` for `nspcplayer` of type `nspcplay.player.NSPCPlayer`
sdl/source/audio.d(121,14): Error: no property `setChannelVolume` for `nspcplayer` of type `nspcplay.player.NSPCPlayer`
sdl/source/audio.d(122,14): Error: no property `setChannelVolume` for `nspcplayer` of type `nspcplay.player.NSPCPlayer`
sdl/source/audio.d(123,14): Error: no property `setChannelVolume` for `nspcplayer` of type `nspcplay.player.NSPCPlayer`
sdl/source/audio.d(124,14): Error: no property `setChannelVolume` for `nspcplayer` of type `nspcplay.player.NSPCPlayer`
sdl/source/audio.d(125,14): Error: no property `setChannelVolume` for `nspcplayer` of type `nspcplay.player.NSPCPlayer`
sdl/source/audio.d(128,14): Error: no property `transpose` for `nspcplayer` of type `nspcplay.player.NSPCPlayer`
sdl/source/audio.d(131,14): Error: no property `transpose` for `nspcplayer` of type `nspcplay.player.NSPCPlayer`
sdl/source/audio.d(135,14): Error: no property `volume` for `nspcplayer` of type `nspcplay.player.NSPCPlayer`

Try running dub upgrade like the warnings say

That's what I tried already, but it just tries to upgrade earthbound:

(base) admin@server:~/Documents/Programming/ebpc/earthbound$ dub upgrade
   Upgrading project in /home/admin/Documents/Programming/ebpc/earthbound/
             Not upgrading sub package in actionscriptgen
             Not upgrading sub package in sdl
             Not upgrading sub package in snes
             
Note: specify -s to also upgrade sub packages.
(base) admin@server:~/Documents/Programming/ebpc/earthbound$ dub upgrade -s
   Upgrading project in /home/admin/Documents/Programming/ebpc/earthbound/
   Upgrading sub package in /home/admin/Documents/Programming/ebpc/earthbound/actionscriptgen
   Upgrading sub package in /home/admin/Documents/Programming/ebpc/earthbound/sdl
       Error Failed to update sub package at sdl: Failed to find any versions for package earthbound, referenced by sdl ~master
   Upgrading sub package in /home/admin/Documents/Programming/ebpc/earthbound/snes
       Error Failed to update sub package at snes: Failed to find any versions for package earthbound, referenced by snes ~master

Looks like a dub bug, but I think you can work around it by deleting sdl/dub.selections.json

It still happened, but I've ran git reset -rd and it now works

Spoke too soon, it built but couldn't run:

siryul.dyaml.YAMLDException@/home/admin/.dub/packages/siryul-0.8.7/siryul/source/siryul/dyaml.d(375): settings.yml (line 28, column 18): Cannot convert value 'printRegisters' to type Controller
----------------
/home/admin/.dub/packages/siryul-0.8.7/siryul/source/siryul/dyaml.d:56 pure @safe gamepad.Controller siryul.dyaml.tryConvert!(gamepad.Controller, immutable(char)[]).tryConvert(immutable(char)[], dyaml.exception.Mark) [0x5635798782bb]
/home/admin/.dub/packages/siryul-0.8.7/siryul/source/siryul/dyaml.d:87 @safe void siryul.dyaml.deserialize!(siryul.dyaml.YAML, std.typecons.BitFlags!(siryul.common.DeSiryulize, 0).BitFlags(1)).deserialize!(gamepad.Controller).deserialize(dyaml.node.Node, immutable(char)[], out gamepad.Controller) [0x563579878194]
/home/admin/.dub/packages/siryul-0.8.7/siryul/source/siryul/dyaml.d:128 @safe int siryul.dyaml.deserialize!(siryul.dyaml.YAML, std.typecons.BitFlags!(siryul.common.DeSiryulize, 0).BitFlags(1)).deserialize!(gamepad.Controller, bindbc.sdl.bind.sdlscancode.SDL_Scancode).deserialize(dyaml.node.Node, immutable(char)[], out gamepad.Controller[bindbc.sdl.bind.sdlscancode.SDL_Scancode]).__foreachbody4(ref dyaml.node.Node, ref dyaml.node.Node) [0x563579878b2f]
/home/admin/.dub/packages/dyaml-0.9.2/dyaml/source/dyaml/node.d:1601 @safe int dyaml.node.Node.opApply!(int delegate(ref dyaml.node.Node, ref dyaml.node.Node) @safe).opApply(int delegate(ref dyaml.node.Node, ref dyaml.node.Node) @safe) [0x56357986f1d0]
/home/admin/.dub/packages/siryul-0.8.7/siryul/source/siryul/dyaml.d:124 @safe void siryul.dyaml.deserialize!(siryul.dyaml.YAML, std.typecons.BitFlags!(siryul.common.DeSiryulize, 0).BitFlags(1)).deserialize!(gamepad.Controller, bindbc.sdl.bind.sdlscancode.SDL_Scancode).deserialize(dyaml.node.Node, immutable(char)[], out gamepad.Controller[bindbc.sdl.bind.sdlscancode.SDL_Scancode]) [0x563579878a80]
/home/admin/.dub/packages/siryul-0.8.7/siryul/source/siryul/dyaml.d:194 @safe void siryul.dyaml.deserialize!(siryul.dyaml.YAML, std.typecons.BitFlags!(siryul.common.DeSiryulize, 0).BitFlags(1)).deserialize!(main.Settings).deserialize(dyaml.node.Node, immutable(char)[], out main.Settings) [0x563579873fe6]
/home/admin/.dub/packages/siryul-0.8.7/siryul/source/siryul/dyaml.d:23 @safe main.Settings siryul.dyaml.YAML.parseInput!(main.Settings, 1, immutable(char)[]).parseInput(immutable(char)[], immutable(char)[]) [0x5635798738ed]
/home/admin/.dub/packages/siryul-0.8.7/siryul/source/siryul/siryul.d:48 @safe main.Settings siryul.siryul.fromFile!(main.Settings, siryul.dyaml.YAML, 1).fromFile(immutable(char)[]) [0x563579873817]
sdl/source/main.d:65 _Dmain [0x563579857677]

You'll need to clean up the debugging keybinds left in the settings.

Where are they?

In the settings.yml file mentioned in the error. Remove the printRegisters binding.

Okay, now it's working, thanks. Hopefully the PR will be approved soon so others won't have this issue

Looks like a dub bug, but I think you can work around it by deleting sdl/dub.selections.json

Just so it's documented somewhere other than the discord, one way to resolve this is with the following step:

"ohh actually I Googled and found something that fixed it. Running dub add-local . in the root folder"

I've done this myself and it worked. Once that command is run, then you can do dub upgrade -s without issue.