Opened 2 years ago

Closed 2 years ago

#4976 closed defect (fixed)

Physics 26 & 31 fail to start in SoaS 26 alpha

Reported by: FGrose Owned by:
Priority: Unspecified by Maintainer Milestone: Unspecified
Component: Physics Version: Unspecified
Severity: Unspecified Keywords:
Cc: Distribution/OS: Fedora
Bug Status: New

Description (last modified by FGrose)

Observed on SoaS on Fedora26 alpha (Fedora-SoaS-Live-x86_64-26-20170423.n.0.iso) which includes Physics-26.

Downloaded Physics-31.xo and installed with sugar-install-bundle.

Also failed to start. Log capture added.

Attachments (2)

log-1493050047.zip (19.4 KB) - added by FGrose 2 years ago.
log capture
log-1493084075.zip (32.3 KB) - added by FGrose 2 years ago.
log capture with Physics-31

Download all attachments as: .zip

Change History (11)

Changed 2 years ago by FGrose

log capture

comment:1 Changed 2 years ago by quozl

Traceback (most recent call last):
  File "/usr/bin/sugar-activity", line 220, in <module>
    main()
  File "/usr/bin/sugar-activity", line 164, in main
    module = __import__(module_name)
  File "/usr/share/sugar/activities/Physics.activity/activity.py", line 63,
    in <module> import tools
  File "/usr/share/sugar/activities/Physics.activity/tools.py", line 39, in <module>
    import Box2D as box2d
  File "/usr/lib64/python2.7/site-packages/Box2D/__init__.py", line 19, in <module>
    from .Box2D import *
  File "/usr/lib64/python2.7/site-packages/Box2D/Box2D.py", line 435, in <module>
    _Box2D.RAND_LIMIT_swigconstant(_Box2D)
AttributeError: 'module' object has no attribute 'RAND_LIMIT_swigconstant'

Looks familiar. But not very interesting, given that Physics-31 is latest version. Please upgrade to Physics-31?

Meanwhile, looks like http://download.sugarlabs.org/sources/honey/Physics/ has Physics-26 which may be why Fedora has Physics-26. Raised https://github.com/sugarlabs/physics/issues/29

Last edited 2 years ago by quozl (previous) (diff)

Changed 2 years ago by FGrose

log capture with Physics-31

comment:2 Changed 2 years ago by FGrose

  • Bug Status changed from Unconfirmed to New
  • Description modified (diff)
  • Summary changed from Physics 26 fails to start to Physics 26 & 31 fail to start in SoaS 26 alpha

comment:3 Changed 2 years ago by quozl

Thanks. Your logs showed

Traceback (most recent call last):
  File "/usr/bin/sugar-activity", line 220, in <module>
    main()
  File "/usr/bin/sugar-activity", line 164, in main
    module = __import__(module_name)
  File "/home/liveuser/Activities/Physics.activity/activity.py", line 61,
    in <module> import tools
  File "/home/liveuser/Activities/Physics.activity/tools.py", line 39, in <module>
    import Box2D as box2d
  File "/usr/lib64/python2.7/site-packages/Box2D/__init__.py", line 19, in <module>
    from .Box2D import *
  File "/usr/lib64/python2.7/site-packages/Box2D/Box2D.py", line 435, in <module>
    _Box2D.RAND_LIMIT_swigconstant(_Box2D)
AttributeError: 'module' object has no attribute 'RAND_LIMIT_swigconstant'

Also occurs in Fedora without Physics, using a Python shell;

$ python
>>> import Box2D
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.7/site-packages/Box2D/__init__.py", line 19, in <module>
    from .Box2D import *
  File "/usr/lib64/python2.7/site-packages/Box2D/Box2D.py", line 435, in <module>
    _Box2D.RAND_LIMIT_swigconstant(_Box2D)
AttributeError: 'module' object has no attribute 'RAND_LIMIT_swigconstant'
>>> 

If you can reproduce that, then it isn't a problem with Physics, but a problem with pybox2d on Fedora. Please redirect the report to Fedora pybox2d, thanks.

Fedora package of Physics does remove bundled libraries https://src.fedoraproject.org/cgit/rpms/sugar-physics.git/tree/sugar-physics.spec#n28 and testing Physics 31 should have bypassed that, but didn't. This is because of a problem in python module search path of activity; the bundled libraries were hidden again when you tested Physics 31. Search path fix is in https://github.com/sugarlabs/sugar-toolkit-gtk3/commit/495eed8737afa53e13878929e386c3e604a65818

comment:4 Changed 2 years ago by quozl

Might be related to https://bugzilla.redhat.com/show_bug.cgi?id=844091 (pybox2d bundles Box2D).

comment:5 Changed 2 years ago by FGrose

Filed https://bugzilla.redhat.com/show_bug.cgi?id=1446934 on pybox2d.

I tried the search path fix suggested in comment:4 on this install of Sugar and Physics-31 with no change in behavior.

Last edited 2 years ago by FGrose (previous) (diff)

comment:6 Changed 2 years ago by quozl

Thanks for testing the search path fix. I agree, it doesn't fix this problem. I tested in Fedora 25.

In Physics activity file tools.py, please try changing

sys.path.append('lib/')

to

sys.path.insert(0, 'lib')

and incidentally remove

# If your architecture is different, comment these lines and install
# the modules in your system.
sys.path.append('lib/Box2D-2.0.2b2-py2.7-linux-i686.egg')

After installing Physics-31 as a bundle, and applying this change, it works for me on Fedora 25. Let me know your test result.

This change isn't necessarily a fix for Fedora downstream however, since it preferences the Box2D sources inside the Physics bundle, which the Fedora packaging strips.

The cause of the Physics-31 bundle not running on Fedora is likely to be developers testing using sugar-build only, instead of native sugar. In the sugar-build emulator, the paths are changed to preference the chroot, so this problem would have been hidden.

comment:8 Changed 2 years ago by FGrose

Applying the GitHub pull request #30 changes does allow Physics-31 to run in SoaS 26 alpha. Thanks for attending to this.

comment:9 Changed 2 years ago by quozl

  • Resolution set to fixed
  • Status changed from new to closed

Thanks for testing. I've merged it.

This has fixed start fail for Physics installed as a bundle, but not for Physics installed as a package in Fedora. Both https://bugzilla.redhat.com/show_bug.cgi?id=844091 and https://bugzilla.redhat.com/show_bug.cgi?id=1446934 should solve the latter scenario.

As there's nothing further to do upstream in Sugar and Physics on this problem, I'll close the ticket. Please re-open if needed.

Note: See TracTickets for help on using tickets.