Last Comment Bug 699203 - mozilla-dos2unix.py looks for a non-existent directory "CVS" in order to run.
: mozilla-dos2unix.py looks for a non-existent directory "CVS" in order to run.
Status: RESOLVED FIXED
fixed-in-bs
:
Product: Core
Classification: Components
Component: Build Config (show other bugs)
: 7 Branch
: All Windows 7
: -- normal (vote)
: mozilla11
Assigned To: Siddharth Agarwal [:sid0] (inactive)
:
Mentors:
Depends on:
Blocks: 704316
  Show dependency treegraph
 
Reported: 2011-11-02 13:03 PDT by Raymond Hung
Modified: 2011-11-21 15:12 PST (History)
8 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Remove mozilla-dos2unix.py (1.90 KB, patch)
2011-11-04 23:58 PDT, Siddharth Agarwal [:sid0] (inactive)
ted: review+
Details | Diff | Splinter Review

Description Raymond Hung 2011-11-02 13:03:11 PDT
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Build ID: 20110928134238

Steps to reproduce:

When trying to build Firefox on the Windows platform, client.mk raises an error regarding the line endings being Windows-style rather than Unix-style. The suggestion is to run python mozilla/build/win32/mozilla-dos2unix.py. I executed the script and typed 'y' to proceed.


Actual results:

Nothing happened. I still could not build Firefox because the line endings were still in Windows-style.


Expected results:

The python script should've continued and changed the line endings, except on line 33 of the script, it looks for a CVS directory that does not exist.
Comment 1 Siddharth Agarwal [:sid0] (inactive) 2011-11-03 00:14:54 PDT
Heh, I don't think that script has been used in ages. You shouldn't be getting that error normally. Did you try to edit client.mk or configure.in?
Comment 2 Raymond Hung 2011-11-03 04:27:05 PDT
I haven't tried editing those files because this was the first time I've tried to build Firefox. I wanted to get one successful build before I started making any changes.
Comment 3 Siddharth Agarwal [:sid0] (inactive) 2011-11-03 04:59:30 PDT
That's really strange and shouldn't be happening. Do you have a Mercurial extension to convert Unix line endings to DOS (look for "eol") in .hgrc or Mercurial.ini?
Comment 4 Siddharth Agarwal [:sid0] (inactive) 2011-11-03 06:59:29 PDT
OK, so I understand you're using git, not hg. In that case what is the output of

$ git config core.autocrlf

Try setting it to false:

$ git config --global core.autocrlf false

... and cloning from scratch again.
Comment 5 Siddharth Agarwal [:sid0] (inactive) 2011-11-03 07:13:02 PDT
So apparently core.autocrlf is set to true by default per <http://code.google.com/p/msysgit/issues/detail?id=21>.

Raymond: try what I mentioned in comment 4 -- it should work. If it does, I'll repurpose this bug into one to remove that script.

humph: if you really insist on using git :) please advise students on Windows to set core.autocrlf to false globally before starting.

Apparently git now has a core.eol, but that doesn't seem to have an option to just leave the files alone, so I guess it complicates things even more. This seems poorly thought-out.
Comment 6 Raymond Hung 2011-11-03 12:46:32 PDT
(In reply to Siddharth Agarwal [:sid0] from comment #5)
> So apparently core.autocrlf is set to true by default per
> <http://code.google.com/p/msysgit/issues/detail?id=21>.
> 
> Raymond: try what I mentioned in comment 4 -- it should work. If it does,
> I'll repurpose this bug into one to remove that script.
> 
> humph: if you really insist on using git :) please advise students on
> Windows to set core.autocrlf to false globally before starting.
> 
> Apparently git now has a core.eol, but that doesn't seem to have an option
> to just leave the files alone, so I guess it complicates things even more.
> This seems poorly thought-out.

Thanks for the fix. It works perfectly now.
Comment 7 Siddharth Agarwal [:sid0] (inactive) 2011-11-04 23:58:56 PDT
Created attachment 572179 [details] [diff] [review]
Remove mozilla-dos2unix.py
Comment 8 Ted Mielczarek [:ted.mielczarek] 2011-11-08 10:15:38 PST
Comment on attachment 572179 [details] [diff] [review]
Remove mozilla-dos2unix.py

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

This is fine. I wonder if we shouldn't add a check somewhere for the exact situation that was encountered here: the user cloned from a git repo on Windows, and the line endings setting is wrong.
Comment 9 Siddharth Agarwal [:sid0] (inactive) 2011-11-10 21:15:25 PST
https://hg.mozilla.org/projects/build-system/rev/7800832fa4fa
Comment 10 Gregory Szorc [:gps] 2011-11-10 23:45:27 PST
Can we remove the reference to this file in client.mk: https://mxr.mozilla.org/mozilla-central/source/client.mk#119

If we could sneak Git instructions in there, the proper commands to set line endings on Windows are:

$ git config core.autocrlf false
$ git config core.eof lf
$ git ls-files -z | xargs -0 rm
$ git checkout .
Comment 11 Gregory Szorc [:gps] 2011-11-18 11:35:44 PST
https://hg.mozilla.org/mozilla-central/rev/7800832fa4fa
Comment 12 Siddharth Agarwal [:sid0] (inactive) 2011-11-19 22:47:51 PST
(In reply to Gregory Szorc [:gps] from comment #10)
> Can we remove the reference to this file in client.mk:
> https://mxr.mozilla.org/mozilla-central/source/client.mk#119
> 
> If we could sneak Git instructions in there, the proper commands to set line
> endings on Windows are:
> 
> $ git config core.autocrlf false
> $ git config core.eof lf
> $ git ls-files -z | xargs -0 rm
> $ git checkout .

I think this should live on MDN somewhere and a link provided in the error message.
Comment 13 Ted Mielczarek [:ted.mielczarek] 2011-11-21 04:59:14 PST
I agree. Can we get a followup to print a link to MDN when we hit this condition?
Comment 14 David Humphrey (:humph) 2011-11-21 07:57:44 PST
Raymond, can you take care of comments 12/13 please?
Comment 15 Raymond Hung 2011-11-21 15:00:01 PST
I've made an edit on the Mozilla build FAQ on the MDN, please check if it is alright.
https://developer.mozilla.org/en/Developer_Guide/Mozilla_build_FAQ#Win32-specific_questions

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