Last Comment Bug 767329 - virtualenv fails with an assertion error if python is installed into /
: virtualenv fails with an assertion error if python is installed into /
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Build Config (show other bugs)
: Trunk
: x86_64 Linux
: -- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
: Gregory Szorc [:gps]
Mentors:
Depends on: 758925
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-22 05:25 PDT by Andrew Benton
Modified: 2012-06-28 18:38 PDT (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
virtualenv.py.diff (725 bytes, patch)
2012-06-22 05:25 PDT, Andrew Benton
k0scist: review-
Details | Diff | Splinter Review

Description Andrew Benton 2012-06-22 05:25:08 PDT
Created attachment 635702 [details] [diff] [review]
virtualenv.py.diff

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1
Build ID: 20120621183908

Steps to reproduce:

I installed python 2.7.3 with --prefix=/ then I tried to compile Firefox


Actual results:

Firefox-13 compiled fine but current mozilla-central failed like so:

#endif /* _MOZILLA_CONFIG_H_ */

Creating Python virtualenv
Traceback (most recent call last):
  File "/home/andy/save/src/firefox/other-licenses/virtualenv/virtualenv.py", line 2270, in <module>
    main()
  File "/home/andy/save/src/firefox/other-licenses/virtualenv/virtualenv.py", line 928, in main
    never_download=options.never_download)
  File "/home/andy/save/src/firefox/other-licenses/virtualenv/virtualenv.py", line 1029, in create_environment
    site_packages=site_packages, clear=clear))
  File "/home/andy/save/src/firefox/other-licenses/virtualenv/virtualenv.py", line 1176, in install_python
    copy_required_modules(home_dir)
  File "/home/andy/save/src/firefox/other-licenses/virtualenv/virtualenv.py", line 1128, in copy_required_modules
    dst_filename = change_prefix(filename, dst_prefix)
  File "/home/andy/save/src/firefox/other-licenses/virtualenv/virtualenv.py", line 1099, in change_prefix
    assert relpath[0] == os.sep
AssertionError
creating Makefile
 .....
Populating Python virtualenv
make[3]: Entering directory `/home/andy/save/src/firefox/firefox-build-dir/build/virtualenv'
cd /home/andy/save/src/firefox/other-licenses/simplejson-2.1.1/; CFLAGS=" -pedantic -Wall -Wpointer-arith -Wdeclaration-after-statement -Werror=return-type -Wtype-limits -Wempty-body -Wno-unused -Wno-overlength-strings -Wcast-align -Wno-long-long -fno-strict-aliasing -ffunction-sections -fdata-sections -pthread -pipe  -DNDEBUG -DTRIMMED -g -Os -freorder-blocks  -fomit-frame-pointer -DXP_UNIX -Os -freorder-blocks  " LDFLAGS="-lpthread  -Wl,-z,noexecstack   -Wl,-rpath-link,/home/andy/save/src/firefox/firefox-build-dir/dist/bin -Wl,-rpath-link,/usr/local/lib " CXXFLAGS=" -pedantic -Wall -Wpointer-arith -Woverloaded-virtual -Werror=return-type -Wtype-limits -Wempty-body -Wno-ctor-dtor-privacy -Wno-overlength-strings -Wno-invalid-offsetof -Wno-variadic-macros -Wcast-align -Wno-long-long -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -std=gnu++0x -pthread -pipe  -DNDEBUG -DTRIMMED -g -Os -freorder-blocks  -fomit-frame-pointer" /home/andy/save/src/firefox/firefox-build-dir/_virtualenv/bin/python setup.py develop
/bin/sh: /home/andy/save/src/firefox/firefox-build-dir/_virtualenv/bin/python: No such file or directory
make[3]: *** [default] Error 127
make[3]: Leaving directory `/home/andy/save/src/firefox/firefox-build-dir/build/virtualenv'
*** Fix above errors and then restart with               "make -f client.mk build"
make[2]: *** [configure] Error 1
make[2]: Leaving directory `/home/andy/save/src/firefox'
make[1]: *** [/home/andy/save/src/firefox/firefox-build-dir/Makefile] Error 2
make[1]: Leaving directory `/home/andy/save/src/firefox'
make: *** [build] Error 2



Expected results:

It should have compiled. The attached patch allows firefox to compile
Comment 1 Jeff Hammel 2012-06-22 09:26:43 PDT
virtualenv is upstream software so bugs should be filed against the master: https://github.com/pypa/virtualenv  .  Luckily, we have members of Mozilla that have commit access to this repo so I would *hope* that such a fix could be quickly implemented.

I am hesitant to change upstream software that we use without a big explanatory note of what we did, why, and an upstream tracking bug so we know when we can undo it (otherwise, things would break when next we upgraded virtualenv if the fix wasn't there).  That said, I'm not an expert on our policies on such things. Maybe Carl or Ian can comment as to if this is okay and an ETA to fix in virtualenv's master.  If not, not being able to compile and test is pretty fatal so we should fix in m-c following an upstream ticket (and a comment in the patch pointing there).
Comment 2 Carl Meyer (:carljm) 2012-06-22 10:43:23 PDT
Fixed in upstream "develop" branch in https://github.com/pypa/virtualenv/commit/8ef9cffb9d63f7b9e40d29af661b09e6cd13ea30. The patch I applied is slightly different; should be equivalent but if you can confirm the fix that would be great.
Comment 3 Andrew Benton 2012-06-22 14:40:28 PDT
Many thanks for committing the change. I can confirm that using os.sep works. Thanks again!
Comment 4 Jeff Hammel 2012-06-25 09:01:04 PDT
So it sounds like the thing to do is to morph this bug into updating virtualenv in-tree to the version at tip.  Are there any objections to me r-ing the existing patch and putting up a new one that attempts this?
Comment 5 Carl Meyer (:carljm) 2012-06-25 19:54:20 PDT
Updating virtualenv to tip will also fix bug 758925
Comment 6 Jeff Hammel 2012-06-27 15:22:33 PDT
Comment on attachment 635702 [details] [diff] [review]
virtualenv.py.diff

Minusing this in leiu of bug 758925
Comment 7 Jeff Hammel 2012-06-28 18:38:41 PDT
This should be fixed with https://bugzilla.mozilla.org/show_bug.cgi?id=758925#c23

Note You need to log in before you can comment on or make changes to this bug.