Closed Bug 903962 Opened 11 years ago Closed 11 years ago

xpcshell make target missing include for mozprofile directory

Categories

(Testing :: XPCShell Harness, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: jduell.mcbugs, Unassigned)

References

Details

Attachments

(1 file)

I'm trying to run xpcshell tests on my linux box in /netwerk/tests and both 

   make check-one SOLO_FILE=test_simple.js

and

   make xpcshell-tests

fail with

/home/jj/hg/c/proj/browser/_virtualenv/bin/python -u /home/jj/hg/c/t/config/pythonpath.py \
  -I../../build \
  -I/home/jj/hg/c/t/build \
  -I../../_tests/mozbase/mozinfo \
  /home/jj/hg/c/t/testing/xpcshell/runxpcshelltests.py \
  --symbols-path=../../dist/crashreporter-symbols \
  --build-info-json=../../mozinfo.json \
  --test-path=test_simple_wrap.js \
  --testing-modules-dir=../../_tests/modules \
  --profile-name=firefox \
  --test-plugin-path=../../dist/plugins \
  --verbose \
  /home/jj/hg/c/proj/browser/dist/bin/xpcshell \
  ../../_tests/xpcshell/netwerk/test/unit ../../_tests/xpcshell/netwerk/test/unit_ipc
Traceback (most recent call last):
  File "/home/jj/hg/c/t/config/pythonpath.py", line 56, in <module>
    main(sys.argv[1:])
  File "/home/jj/hg/c/t/config/pythonpath.py", line 48, in main
    execfile(script, frozenglobals)
  File "/home/jj/hg/c/t/testing/xpcshell/runxpcshelltests.py", line 19, in <module>
    from automation import Automation, getGlobalLog, resetGlobalLog
  File "/home/jj/hg/c/proj/browser/build/automation.py", line 34, in <module>
    from mozprofile import Profile, Preferences
ImportError: cannot import name Preferences

Looking at the command line, I guessed that the issue is that we're missing -I to the mozprofile directory.  This patch changes that, and I can now run xpcshell just fine. 

Looks like bustage is from bug 688667.
Attachment #788809 - Flags: review?(jmaher)
Can you try just removing the pythonpath/-I bits entirely? I think all the necessary modules ought to be in the virtualenv nowadays anyway. (This is why "mach xpcshell-test" works.)
I don't build with mach (yet: have we officially deprecated/broken running xpcshell with make?)

Removing all the -I's results in the same error with 'make xpcshell-tests'
We have not officially deprecated the makefile targets, but that is our eventual goal. (Sponsored message: try mach, it's great!)

Looking at the error you encountered, it actually looks like you migh have an old version of mozprofile installed on your system. If you just run "python" and type "import mozprofile", do you get an error or does that work?
:jduell, could you answer apropos comment 4? (also make sure you use the python in _virtualenv)
Flags: needinfo?(jduell.mcbugs)
$which python
/usr/bin/python
$python
Python 2.7.3 (default, Apr 10 2013, 06:20:15) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mozprofile
>>> 

I.e. looks like it works.  (How would I know which python is in _virtualenv? I have some vague memory of installing virtualenv a while ago)
Flags: needinfo?(jduell.mcbugs)
Okay, so my guess in comment 4 is correct: you have an old version of mozprofile installed system-wide, which is breaking things. That's unfortunate (but you can fix it by just uninstalling that module).

jhammel meant "$objdir/_virtualenv/bin/python", which is the Python that's actually used within our build system.
Comment on attachment 788809 [details] [diff] [review]
Adds needed -I path for runxpcshelltests.py

Review of attachment 788809 [details] [diff] [review]:
-----------------------------------------------------------------

I assume this isn't needed as the python in the objdir already has reference to mozprofile, but this change looks pretty safe.
Attachment #788809 - Flags: review?(jmaher) → review+
Per my comments above this shouldn't be necessary. The problem is that the way we create our virtualenv allows system modules in. :-/
I removed my outdated /usr/local/python/.../mozprofile and everything works fine now w/o my patch, so I'm assuming we can just close this as WFM
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WORKSFORME
See Also: → 907902
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: