Bug 1446934

Summary: Failure to import Box2D in Sugar Physics
Product: [Fedora] Fedora Reporter: Frederick Grose <fgrose>
Component: sugar-physicsAssignee: Peter Robinson <pbrobinson>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 26CC: awilliam, callkalpa, cstratak, martin, pbrobinson, sebastian
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: AcceptedFreezeException
Fixed In Version: sugar-physics-32.1-3.fc27 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-11-08 22:09:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1396705    

Description Frederick Grose 2017-04-30 17:32:07 UTC
Description of problem:
Physics-26 & 31 fail to start

Version-Release number of selected component (if applicable):
Physics-31

How reproducible:
Always

Steps to Reproduce:
1.Boot Sugar on a Stick 26 alpha
2.Try to launch Physics-26
3.

Actual results:Failed to start


Expected results:Start


Additional info:

See https://bugs.sugarlabs.org/ticket/4976 (includes logs).

Comment 1 Peter Robinson 2017-08-01 22:50:56 UTC
Charalampos updated pybox2d so I suspect something has happened on the move to 2.3.2

Comment 2 Frederick Grose 2017-08-02 10:00:04 UTC
Here is the traceback from Fedora Spin SoaS 26 packaged with Physics 32.1:

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 62, in <module>
    import tools
  File "/usr/share/sugar/activities/Physics.activity/tools.py", line 35, in <module>
    import lib.Box2D as box2d
ImportError: No module named lib.Box2D
Exited with status 1, pid 1951 data (<open file '<fdopen>', mode 'w' at 0x7f3c9451cdb0>, 'aee31508626e498542ffca08474e032c0d530bf0')

Comment 3 Charalampos Stratakis 2017-10-05 14:29:49 UTC
Apologies for not getting to it sooner, there is way too much stuff on my backlog. I might be able to get to it, in hopefully two weeks time.

Comment 4 Charalampos Stratakis 2017-10-17 14:29:26 UTC
The issue here is not related to pybox2d rebase but to the way that sugar-physics handles the box2d import.

More specifically, sugar-physics bundles Box2D [0], adds the directory to the path and then imports it from that directory.

This started happening since v30 of physics  for elements.py and physics.py [1] and v32 for tools.py where the failure was noticed [2].

The fedora package of sugar-physics though, removes that directory so that import is not valid anymore. In order to use the system package the import has to be changed back:

-import lib.Box2D as box2d
+import Box2D as box2d

However I am unclear on how this might affect Physics as a bundle, if at all. A small discussion about it at [3].

Also I tried to get the traceback on Fedora SoaS spin but I wasn't able to capture it, however when I changed the code inside a running spin, I was able to start physics normally.

[0] https://github.com/sugarlabs/physics/tree/master/lib
[1] https://github.com/sugarlabs/physics/commit/fdee879283f7ad6a43b7795275b121a002d8465c
[2] https://github.com/sugarlabs/physics/commit/820479f327875e0f06becaa791a7e1ce59e93d11
[3] https://bugs.sugarlabs.org/ticket/4976

Comment 5 Charalampos Stratakis 2017-10-17 14:49:14 UTC
Also it seems that even by doing that, the version of Box2D that is bundled with pybox2d will be used by sugar physics, as pybox2d places it in usr/lib64/python2.7/site-packages.

That should be resolved with the resolution of bug 844091.

Comment 6 Charalampos Stratakis 2017-10-17 15:41:55 UTC
Sent a PR at https://src.fedoraproject.org/rpms/sugar-physics/pull-request/1

Comment 7 Fedora Update System 2017-10-17 17:00:32 UTC
sugar-physics-32.1-3.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2017-8642981c6b

Comment 8 Fedora Update System 2017-10-18 17:21:37 UTC
sugar-physics-32.1-3.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-8642981c6b

Comment 9 Fedora Blocker Bugs Application 2017-11-03 11:12:01 UTC
Proposed as a Freeze Exception for 27-final by Fedora user pbrobinson using the blocker tracking app because:

 Fixes the Physics app which currently crashes.

Comment 10 Adam Williamson 2017-11-03 20:47:49 UTC
Discussed at 2017-11-01 to 2017-11-02 Fedora 27 Go/No-Go meeting, acting as a freeze exception review meeting: https://meetbot-raw.fedoraproject.org/fedora-meeting-1/2017-11-02/f27-final-and-server-beta-go-no-go-meeting.2017-11-02-17.00.html . Accepted as a freeze exception: this would be a blocking issue on a release-blocking desktop spin (included app does not work), which creates a strong presumption in favour of FE status. The fix is clearly limited - it cannot affect anything outside of Sugar. Thus it seems clearly desirable to pull it in and fix the app for the Sugar live image.

Comment 11 Fedora Update System 2017-11-08 22:09:57 UTC
sugar-physics-32.1-3.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.