Skip to content

Build error; AttributeError: 'ConfigurationContext' object has no attribute 'supports_bitmap_resource' #20

@clach04

Description

@clach04

full context (note includes #18 )

vscode@codespaces-3c0349:/workspaces/pebblejs/$
pebble build && timeout 30m pebble install --emulator aplite --logs --vnc
vscode@codespaces-3c0349:/workspaces/pebblejs/$ pebble build && timeout 30m pebble install --emulator aplite --logs --vnc
/workspaces/pebblejs/wscript:121: SyntaxWarning: invalid escape sequence '\.'
  relpath = re.sub('(\.js)?\.coffee$', '.js', relpath)
Setting top to                           : /workspaces/pebblejs
Setting out to                           : /workspaces/pebblejs/build
Checking for program 'webpack'           : /home/vscode/.pebble-sdk/SDKs/current/node_modules/.bin/webpack
WARNING: enableMultiJS is not enabled for this project. message_keys.json will not be included in your project unless you add it to your pebble-js-app.js file.
Found Pebble SDK for emery in:           : /home/vscode/.pebble-sdk/SDKs/current/sdk-core/pebble/emery
Checking for program 'gcc, cc'           : arm-none-eabi-gcc
Checking for program 'ar'                : arm-none-eabi-ar
Checking if the -o link must be split from arguments : yes
Found Pebble SDK for diorite in:                     : /home/vscode/.pebble-sdk/SDKs/current/sdk-core/pebble/diorite
Checking for program 'gcc, cc'                       : arm-none-eabi-gcc
Checking for program 'ar'                            : arm-none-eabi-ar
Checking if the -o link must be split from arguments : yes
Found Pebble SDK for chalk in:                       : /home/vscode/.pebble-sdk/SDKs/current/sdk-core/pebble/chalk
Checking for program 'gcc, cc'                       : arm-none-eabi-gcc
Checking for program 'ar'                            : arm-none-eabi-ar
Checking if the -o link must be split from arguments : yes
Found Pebble SDK for basalt in:                      : /home/vscode/.pebble-sdk/SDKs/current/sdk-core/pebble/basalt
Checking for program 'gcc, cc'                       : arm-none-eabi-gcc
Checking for program 'ar'                            : arm-none-eabi-ar
Checking if the -o link must be split from arguments : yes
Found Pebble SDK for aplite in:                      : /home/vscode/.pebble-sdk/SDKs/current/sdk-core/pebble/aplite
Checking for program 'gcc, cc'                       : arm-none-eabi-gcc
Checking for program 'ar'                            : arm-none-eabi-ar
Checking if the -o link must be split from arguments : yes
Traceback (most recent call last):
  File "/home/vscode/.pebble-sdk/SDKs/current/sdk-core/pebble/.waf3-2.1.4-e7919c666152db2545b931e52107c4b8/waflib/Scripting.py", line 122, in waf_entry_point
    run_commands()
  File "/home/vscode/.pebble-sdk/SDKs/current/sdk-core/pebble/.waf3-2.1.4-e7919c666152db2545b931e52107c4b8/waflib/Scripting.py", line 185, in run_commands
    ctx=run_command(cmd_name)
        ^^^^^^^^^^^^^^^^^^^^^
  File "/home/vscode/.pebble-sdk/SDKs/current/sdk-core/pebble/.waf3-2.1.4-e7919c666152db2545b931e52107c4b8/waflib/Scripting.py", line 176, in run_command
    ctx.execute()
  File "/home/vscode/.pebble-sdk/SDKs/current/sdk-core/pebble/.waf3-2.1.4-e7919c666152db2545b931e52107c4b8/waflib/Configure.py", line 86, in execute
    super(ConfigurationContext,self).execute()
  File "/home/vscode/.pebble-sdk/SDKs/current/sdk-core/pebble/.waf3-2.1.4-e7919c666152db2545b931e52107c4b8/waflib/Context.py", line 92, in execute
    self.recurse([os.path.dirname(g_module.root_path)])
  File "/home/vscode/.pebble-sdk/SDKs/current/sdk-core/pebble/.waf3-2.1.4-e7919c666152db2545b931e52107c4b8/waflib/Context.py", line 133, in recurse
    user_function(self)
  File "/workspaces/pebblejs/wscript", line 22, in configure
    ctx.configure_appinfo([ctx.appinfo_bitmap_to_png])
  File "/home/vscode/.pebble-sdk/SDKs/current/sdk-core/pebble/.waf3-2.1.4-e7919c666152db2545b931e52107c4b8/waflib/Configure.py", line 177, in fun
    return f(*k,**kw)
           ^^^^^^^^^^
  File "/workspaces/pebblejs/waftools/configure_appinfo.py", line 12, in configure_appinfo
    transform(appinfo_json)
  File "/home/vscode/.pebble-sdk/SDKs/current/sdk-core/pebble/.waf3-2.1.4-e7919c666152db2545b931e52107c4b8/waflib/Configure.py", line 177, in fun
    return f(*k,**kw)
           ^^^^^^^^^^
  File "/workspaces/pebblejs/waftools/aplite_legacy.py", line 6, in appinfo_bitmap_to_png
    if not ctx.supports_bitmap_resource():
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'ConfigurationContext' object has no attribute 'supports_bitmap_resource'
Build failed.

Possible workaround

This works, in that I get binaries that run and seem to have bitmaps. I'm just not sure it's correct

diff --git a/waftools/aplite_legacy.py b/waftools/aplite_legacy.py
index 624f19f..b3094b5 100755
--- a/waftools/aplite_legacy.py
+++ b/waftools/aplite_legacy.py
@@ -3,7 +3,7 @@ from waflib.Configure import conf

 @conf
 def appinfo_bitmap_to_png(ctx, appinfo_json):
-    if not ctx.supports_bitmap_resource():
+    if hasattr(ctx, 'supports_bitmap_resource') and not ctx.supports_bitmap_resource():
         for res in appinfo_json['resources']['media']:
             if res['type'] == 'bitmap':
                 res['type'] = 'png'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions