Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#8898 closed defect (fixed)

some files in sage-4.4.{0,1} have dos line ending instead of a unix line ending

Reported by: fbissey Owned by: jason
Priority: trivial Milestone: sage-4.6.1
Component: misc Keywords:
Cc: fredrik.johansson Merged in:
Authors: Minh Van Nguyen, Jeroen Demeyer Reviewers: François Bissey
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by jdemeyer)

Various files in the sage spkg have dos line ending rather than unix ones.

I found about this while trying to build sage with python-2.6.5 which absolutely refused to parse these files as is. Not sure how to submit a patch for line endings.

Execute from SAGE_ROOT/devel/sage:

  1. 8898.sh

Attachments (3)

trac_8898-unix-endlines.2.patch (105.2 KB) - added by fbissey 9 years ago.
update of the patch based on sage-4.6
trac-8898_unix-endlines.patch (107.0 KB) - added by mvngu 9 years ago.
8898.sh (460 bytes) - added by jdemeyer 9 years ago.
Script to do the changes (to be executed in SAGE_ROOT/devel/sage)

Download all attachments as: .zip

Change History (21)

comment:1 Changed 10 years ago by mvngu

Some files under sage/logic/ also have DOS line ending.

comment:2 Changed 10 years ago by fbissey

just checked sage/logic/booleval.py is actually in "mac format" in sage-4.4 I will check sage-4.4.1 later. But those are pure python files, they may be ok but cython with python-2.6.5 refused to deal with the other 4.

comment:3 Changed 9 years ago by AlexGhitza

  • Component changed from algebra to misc
  • Owner changed from AlexGhitza to jason

comment:4 Changed 9 years ago by mvngu

  • Authors set to Minh Van Nguyen
  • Cc fredrik.johansson added
  • Description modified (diff)
  • Priority changed from minor to trivial
  • Status changed from new to needs_review

The attached patch converts the following files to use Unix line endings:

  • sage/libs/mpmath/ext_impl.pxd
  • sage/libs/mpmath/ext_main.pyx
  • sage/libs/mpmath/ext_main.pxd
  • sage/libs/mpmath/ext_libmp.pyx
  • sage/logic/booleval.py

I used the Perl script at

http://www.obviously.com/tech_tips/dos2unix.html

to convert to Unix end lines. Fredrik Johansson is a main developer of mpmath. I have CC'd him so he is aware of this Unix line endings issue.

comment:5 Changed 9 years ago by fbissey

  • Status changed from needs_review to needs_work

sage/libs/mpmath/ext_impl.pxd at least as been changed since this patch has been posted. It may need rebasing for all 4 files.

Changed 9 years ago by fbissey

update of the patch based on sage-4.6

comment:6 Changed 9 years ago by fbissey

  • Status changed from needs_work to needs_review

OK - so I updated the patch (but could not delete the old one, I don't have the right to do it).

This fairly trivial patch now needs a review.

comment:7 Changed 9 years ago by cschwan

I have tested the patch with python-2.6.6 and sage-on-gentoo - everything fine here.

Changed 9 years ago by mvngu

comment:8 Changed 9 years ago by mvngu

  • Description modified (diff)

Here are some problems with trac_8898-unix-endlines.2.patch:

  • It fails to apply on Sage 4.6.1.alpha0; I got the following failure:
    [mvngu@sage sage-main]$ pwd
    /dev/shm/mvngu/sage-4.6.1.alpha0/devel/sage-main
    [mvngu@sage sage-main]$ hg qimport http://trac.sagemath.org/sage_trac/raw-attachment/ticket/8898/trac_8898-unix-endlines.2.patch && hg qpush 
    adding trac_8898-unix-endlines.2.patch to series file
    applying trac_8898-unix-endlines.2.patch
    patching file sage/libs/mpmath/ext_main.pyx
    Hunk #1 FAILED at 0
    1 out of 1 hunks FAILED -- saving rejects to file sage/libs/mpmath/ext_main.pyx.rej
    patch failed, unable to continue (try -v)
    patch failed, rejects left in working dir
    errors during apply, please fix and refresh trac_8898-unix-endlines.2.patch
    

My rebased patch should take care of the above issues for Sage 4.6.1.alpha0. See the ticket description for which patch to apply.

comment:9 Changed 9 years ago by fbissey

Sorry I missed sage/logic/booleval.py somehow. In any case this one is no bother and is only included for consistency. It doesn't prevent building the way the other do and it is usable. I also didn't see there was a change affecting this in 4.6.1.alpha0. I will test it shortly and report.

comment:10 Changed 9 years ago by fbissey

  • Status changed from needs_review to positive_review

4.6.1.alpha0 took me for a little ride. Anyway, Minh's new patch applies cleanly to 4.6.1.alpha0 and it compiles cleanly with a python-2.6.5 install as expected. sage starts without problems. For safety I also did a run of sage -t --long in the sage/libs/mpmath/ and sage/logic/ and everything ran ok.

I am putting this back to positive review, hopefully no one messed up with those files in alpha1 so it will apply cleanly there as well.

Changed 9 years ago by jdemeyer

Script to do the changes (to be executed in SAGE_ROOT/devel/sage)

comment:11 Changed 9 years ago by jdemeyer

  • Status changed from positive_review to needs_work

comment:12 follow-up: Changed 9 years ago by jdemeyer

  • Description modified (diff)
  • Status changed from needs_work to needs_review

Any complaints if I execute the script 8898.sh instead of applying the patch? The script also fixes some more files.

comment:13 in reply to: ↑ 12 Changed 9 years ago by fbissey

Replying to jdemeyer:

Any complaints if I execute the script 8898.sh instead of applying the patch? The script also fixes some more files.

No complaints here. As I initially said my main concern are the cython files. I'll be happy if a fix goes in script or patch.

comment:14 Changed 9 years ago by fbissey

I am building 4.6.1.alpha2 which includes the fix. cython parsed everything without trouble using python-2.6.5 and compilation is now underway. So it looks good to me.

comment:15 follow-up: Changed 9 years ago by jdemeyer

  • Authors changed from Minh Van Nguyen to Minh Van Nguyen, Jeroen Demeyer
  • Reviewers set to François Bissey
  • Status changed from needs_review to positive_review

François, I am interpreting your post as a positive review, okay?

comment:16 in reply to: ↑ 15 Changed 9 years ago by fbissey

Replying to jdemeyer:

François, I am interpreting your post as a positive review, okay?

OK, the build finished successfully, so yes positive review.

comment:17 Changed 9 years ago by jdemeyer

  • Merged in set to sage-4.6.1.alpha2
  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:18 Changed 9 years ago by jdemeyer

  • Merged in sage-4.6.1.alpha2 deleted
Note: See TracTickets for help on using tickets.