virtualenv fails with an assertion error if python is installed into /




Build Config
5 years ago
5 years ago


(Reporter: Andrew Benton, Unassigned)



Firefox Tracking Flags

(Not tracked)



(1 attachment)



5 years ago
Created attachment 635702 [details] [diff] [review]

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/", line 2270, in <module>
  File "/home/andy/save/src/firefox/other-licenses/virtualenv/", line 928, in main
  File "/home/andy/save/src/firefox/other-licenses/virtualenv/", line 1029, in create_environment
    site_packages=site_packages, clear=clear))
  File "/home/andy/save/src/firefox/other-licenses/virtualenv/", line 1176, in install_python
  File "/home/andy/save/src/firefox/other-licenses/virtualenv/", line 1128, in copy_required_modules
    dst_filename = change_prefix(filename, dst_prefix)
  File "/home/andy/save/src/firefox/other-licenses/virtualenv/", line 1099, in change_prefix
    assert relpath[0] == os.sep
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 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 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


5 years ago
Attachment #635702 - Flags: review?(jhammel)


5 years ago
Attachment #635702 - Attachment is patch: true


5 years ago
Component: Untriaged → General
Product: Firefox → Core
QA Contact: untriaged → general


5 years ago
Component: General → Build Config
Version: 13 Branch → Trunk

Comment 1

5 years ago
virtualenv is upstream software so bugs should be filed against the master:  .  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

5 years ago
Fixed in upstream "develop" branch in The patch I applied is slightly different; should be equivalent but if you can confirm the fix that would be great.

Comment 3

5 years ago
Many thanks for committing the change. I can confirm that using os.sep works. Thanks again!

Comment 4

5 years ago
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

5 years ago
Updating virtualenv to tip will also fix bug 758925
Depends on: 758925

Comment 6

5 years ago
Comment on attachment 635702 [details] [diff] [review]

Minusing this in leiu of bug 758925
Attachment #635702 - Flags: review?(jhammel) → review-

Comment 7

5 years ago
This should be fixed with
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.