Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 'gap' to remove usage of '$RM' and replace wth 'rm' #7873

Closed
sagetrac-drkirkby mannequin opened this issue Jan 8, 2010 · 9 comments
Closed

Fix 'gap' to remove usage of '$RM' and replace wth 'rm' #7873

sagetrac-drkirkby mannequin opened this issue Jan 8, 2010 · 9 comments

Comments

@sagetrac-drkirkby
Copy link
Mannequin

sagetrac-drkirkby mannequin commented Jan 8, 2010

As agreed here:

http://groups.google.com/group/sage-devel/browse_thread/thread/bd7ae07a1157bead/970aa0dc8fa56ab7?lnk=raot

there is no need to have variables for very basic commands such as 'rm'. Gap relies on the use of $RM, $LN and $MKDIR, which seems a bit pointless. All are standard Unix commands, defined by POSIX. We should not make make use of any special options some versions might use.

I'm no fan of GNU, but even their coding standards acknowledge one can assume some commands exist, and include all of these.

http://www.gnu.org/prep/standards/standards.html#Utilities-in-Makefiles

Hence I would replace the use of $LN, $RM and $MKDIR on the spkg-install and anywhere else it may be found in gap.

Component: build

Author: David Kirkby

Reviewer: John Palmieri

Merged: sage-4.3.1.rc0

Issue created by migration from https://trac.sagemath.org/ticket/7873

@sagetrac-drkirkby sagetrac-drkirkby mannequin added this to the sage-4.3.1 milestone Jan 8, 2010
@sagetrac-drkirkby
Copy link
Mannequin Author

sagetrac-drkirkby mannequin commented Jan 8, 2010

patch file to replace $RM with 'rm' and similar

@sagetrac-drkirkby
Copy link
Mannequin Author

sagetrac-drkirkby mannequin commented Jan 8, 2010

comment:1

Attachment: gap-#7873.patch.gz

At a new spkg, which fixes these can found at

http://boxen.math.washington.edu/home/kirkby/portability/gap-4.4.10.p13/gap-4.4.10.p13.spkg

Dave

@sagetrac-drkirkby
Copy link
Mannequin Author

sagetrac-drkirkby mannequin commented Jan 8, 2010

Author: David Kirkby

@jhpalmieri
Copy link
Member

comment:3

Two comments: you've changed "$CP" to "cp" even though $CP is still defined in sage-env. Does this matter?

Also (and this is not new -- it happens with the old spkg, too): when I install the spkg, I get this at the end:

cp: ../../bin is a directory (not copied).
cp: cp: No such file or directory

Any ideas why? Anyway, since gap works, maybe we shouldn't worry about this right now.

@sagetrac-drkirkby
Copy link
Mannequin Author

sagetrac-drkirkby mannequin commented Jan 8, 2010

comment:4

Replying to @jhpalmieri:

Two comments: you've changed "$CP" to "cp" even though $CP is still defined in sage-env. Does this matter?

No. I looked at that before deciding to replace them, but could see no reason not to in this case. One was a simple copy

cp patches/gap_cygwin "$SAGE_LOCAL"/bin/gap

the other was recursive, but simply used the POSIX compatible '-r' option. There seemed to be no reason to use any other version of cp in such cases.

The GNU verison of 'cp' has some non-POSIX options (-a being one of them). Had that be iused in gap, then I would have left the $CP, but in this case, with only a very standard option used, there is no reason not to use whatever version of 'cp' is in the path first. Any 'cp' will work.

Also (and this is not new -- it happens with the old spkg, too): when I install the spkg, I get this at the end:

cp: ../../bin is a directory (not copied).
cp: cp: No such file or directory

Any ideas why? Anyway, since gap works, maybe we shouldn't worry about this right now.

Looking at the 'cp' (or $CP) command I could not work out what spkg-install was trying to do (I just posted something on sage-devel about it). The code simply makes no sense to me.

Since

  • The package functions, despite the errors.
  • I wanted to do it asap, in case it caused an issue with the sage-env ticket (Update sage-env #7818)
  • I could not work out what was the intended behavior. 'cp' is used in a way I'd never use it.
  • There is talk on sage-devel of updating gap

it seemed like it was best left to another day. Like the fact CC and CXX get unset. I think it would be wise to find a way around the issues this creates, but again I did not attempt to fix it. That will certainly present a problem if one tried to use a Sun compiler to build gap.

I'm not even convinced this will work in 64-bit mode on OS X, as it does not have the SAGE64 stuff which every other spkg-install file has.

So, overall, the changes I made were only necessary ones, and no others.

Dave

@jhpalmieri
Copy link
Member

Reviewer: John Palmieri

@jhpalmieri
Copy link
Member

comment:5

It works for me on OS X 10.6, and the changes are obviously the right ones to make. Positive review.

@sagetrac-drkirkby
Copy link
Mannequin Author

sagetrac-drkirkby mannequin commented Jan 8, 2010

comment:6

Thank you very much for the positive review.

@rlmill
Copy link
Mannequin

rlmill mannequin commented Jan 14, 2010

Merged: sage-4.3.1.rc0

@rlmill rlmill mannequin removed the s: positive review label Jan 14, 2010
@rlmill rlmill mannequin closed this as completed Jan 14, 2010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant