Closed Bug 927143 Opened 11 years ago Closed 11 years ago

"./mach clobber" may clobber entire working tree

Categories

(Firefox Build System :: General, defect, P1)

x86_64
Windows 8
defect

Tracking

(Not tracked)

RESOLVED FIXED
mozilla27

People

(Reporter: markh, Assigned: gps)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

STR: * cat .mozconfig mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-release * export MOZCONFIG=.mozconfig * ./mach build ... builds fine - obj dir is obj-release as expected. * ./configure # probably misguided - I was trying to solve something unrelated - but seemed to work OK. * ./mach clobber Expected: * obj-release directory removed. Actual: * Entire work tree removed, including .git tree. Ends with: 0:35.67 Could not clobber because a file was in use. If the application is running, try closing it. [Error 32] The process cannot access the file because it is being used by another process: u'c:\\src\\mozilla-git\\central2' (where 'central2' is the work tree - ie, it also tried to remove the directory itself, but that only failed as it was the CWD in the shell!) So I lost not only the work tree, but all commits made in git that I hadn't pushed elsewhere.
That really sucks. I thought we had a check for this :/ Please get |mach environment| to report the wrong object directory and paste its output. (FWIW, you are the first person to ever complain about clobber nuking the srcdir.)
Flags: needinfo?(mhammond)
Blocks: 912114
Priority: -- → P1
Component: mach → Build Config
After the initial build: platform: Windows-8-6.2.9200 python version: 2.7.4 (default, Apr 6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)] python prefix: c:\mozilla-build\python mach cwd: c:\src\mozilla-git\central2 os cwd: c:\src\mozilla-git\central2 mach directory: c:\src\mozilla-git\central2 state directory: c:/home/.mozbuild mozconfig path: c:\src\mozilla-git\central2\.mozconfig-release object directory: c:\src\mozilla-git\central2\obj-release mozconfig configure args: --enable-application=browser --enable-tests --enable-jemalloc --enable-signmar --enable-profiling --enable-js-diagnostics mozconfig extra make args: mozconfig make flags: - j 1 2 config topsrcdir: c:/src/mozilla-git/central2 config topobjdir: c:\src\mozilla-git\central2\obj-release After the ./configure which causes the problem: platform: Windows-8-6.2.9200 python version: 2.7.4 (default, Apr 6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)] python prefix: c:\mozilla-build\python mach cwd: c:\src\mozilla-git\central2 os cwd: c:\src\mozilla-git\central2 mach directory: c:/src/mozilla-git/central2 state directory: c:/home/.mozbuild mozconfig path: c:\src\mozilla-git\central2\.mozconfig-release object directory: c:\src\mozilla-git\central2 mozconfig configure args: --enable-application=browser --enable-tests --enable-jemalloc --enable-signmar --enable-profiling --enable-js-diagnostics mozconfig extra make args: mozconfig make flags: - j 1 2 config topsrcdir: c:/src/mozilla-git/central2 config topobjdir: c:\src\mozilla-git\central2 Differences: mach directory: fwd slashes instead of backslashes object directory: and config topobjdir: no longer refer to the obj-release subdir.
Flags: needinfo?(mhammond)
Yeah, we should reject topobjdir=topsrcdir cases. Not only in mach clobber, in configure.
(In reply to Mike Hommey [:glandium] from comment #3) > Yeah, we should reject topobjdir=topsrcdir cases. Not only in mach clobber, > in configure. That's bug 241047. Blocked on bug 842760. But, mach isn't used in automation (yet). So, I think we can at least have mach reject topsrcdir == topobjdir.
Bug 241047 landed. Worked around bug 842760. We should code the same logic in mach so |mach clobber| complains loudly.
Assignee: nobody → gps
Status: NEW → ASSIGNED
Attachment #818688 - Flags: review?(mh+mozilla)
Comment on attachment 818688 [details] [diff] [review] Reject srcdir == objdir build configurations Review of attachment 818688 [details] [diff] [review]: ----------------------------------------------------------------- ::: python/mozbuild/mozbuild/base.py @@ +185,5 @@ > topobjdir = os.path.normpath(topobjdir) > > + if topsrcdir == topobjdir: > + raise BadEnvironmentException('The object directory appears ' > + 'be the same as your source directory (%s). This build ' to be ::: python/mozbuild/mozbuild/test/test_base.py @@ +212,5 @@ > > finally: > shutil.rmtree(d) > > + @unittest.skip('Failing on buildbot.') why?
Attachment #818688 - Flags: review?(mh+mozilla) → review+
(In reply to Mike Hommey [:glandium] from comment #7) > ::: python/mozbuild/mozbuild/test/test_base.py > @@ +212,5 @@ > > > > finally: > > shutil.rmtree(d) > > > > + @unittest.skip('Failing on buildbot.') > > why? This is some buildbot BS. I actually have no clue what's going on. I've tried to fix it a few times. I probably just need to get a slave loaned out. Bug 853954.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: