Closed Bug 427931 Opened 17 years ago Closed 17 years ago

Build writes in source dir, in ./config/Expression.pyc

Categories

(Firefox Build System :: General, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 384962

People

(Reporter: BenB, Unassigned)

Details

Reproduction: 1. Put Mozilla source in mozilla/ 2. Create build dir in debug/ 3. |configure| and |make| in debug/ 4. Check changes in mozilla/ Actual result: config/Expression.pyc is modified (apparently every time I do |make|) Expected result: Source dir is left alone.
AFAICT python doesn't have any way to control where generated .pyc files go, so we're kinda stuck, aren't we?
You could copy the file before executing it. Not nice, but a trick used in NSPR/NSS, IIRC.
I'd rather WONTFIX the bug.
Well, it's a pretty hard rule that you're never allowed to touch the source dir. There are many reasons for that: - Confidence in the source dir - I keep a vendor branch and my version control system notices the change and wants to check in the change. I may be able to work around with an ignore, but it's still a bug in the build system and will get hard to work around, if this proliferates. - In some cases (perforce or NFS mounts or whatever, neither of which I use luckily), the source may be readonly per OS. There are probably tons of situations and setups where this is important. Of course, if you don't have such a setup, you may not see the point, but it's a pretty strong rule, and for good reasons, to separate build and source dir and to never ever modify source dir during build. Lots of effort has been made already (as said, NSS or NSPR worked around it by copying parts of the source), so copying one file during configure is not much to keep this quality.
1) We're going to have lots of python modules... this just happens to be the first. Copying them all to an objdir directory is a lot of work for IMO little gain. We know we won't ever check in a .pyc file to the tree, so just add it to your .cvsignore, .svnignore, .hgignore, etc file 2) This does work with a readonly srcdir: if you can't write the .pyc file python just continues
Can we make an EXECPYTHON script/command which does the copy and execute?
Asking on #python confirmed that there's neither a switch to not write pyc files nor (better yet) a way to let it write them somewhere else. But "patch welcome". That may be an option. In Mozilla, we'd need to pass a commandline switch with builddir to python.
Dup of bug 384962?
Apparently, thanks!
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → DUPLICATE
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.