bugLiberty Eiffel - Bugs: bug #44601, install.sh does not run on MacOS...

 
 

bug #44601: install.sh does not run on MacOS X(because of -a option of cp)

Submitted by:  KOIZUMI Satoru <koizumistr>
Submitted on:  Sun 22 Mar 2015 02:14:06 PM UTC  
 
Category: NoneSeverity: 4 - Important
Priority: 5 - NormalStatus: Fixed
Assigned to: Mehul Sanghvi <mnsanghvi>Open/Closed: Closed
Release: NoneFixed Release: curtiss
Planned Release: curtiss

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Sun 26 Jun 2016 11:20:15 PM UTC, comment #11:

Fix by commit: 720e7a6

OSX support is now available. This makes use of native gcc that comes with OSX. It does not make use clang or clang specific options. clang support has not been added
as part of this bug fix. Maybe for future enhancement ? :)

Mehul Sanghvi <mnsanghvi>
Project MemberIn charge of this item.
Thu 16 Jun 2016 12:52:47 PM UTC, comment #10:

I have been able to get install.sh to work on OSX El Capitan using the native gcc that comes with it. I have attached the patches, which are created against hash 64cad75.

Can someone try them out and conform that it works on their OSX system ?

(file #37498, file #37499)

Mehul Sanghvi <mnsanghvi>
Project MemberIn charge of this item.
Thu 09 Jun 2016 08:15:27 PM UTC, comment #9:

> What about "sysctl -n hw.ncpu"?
> "sysctl -n machdep.cpu.core_count" does not work on my old Mac


We could use:

as that gives the same response as

(hopefully this comment comes through this time.)

Mehul Sanghvi <mnsanghvi>
Project MemberIn charge of this item.
Thu 09 Jun 2016 08:12:29 PM UTC, comment #8:

> What about "sysctl -n hw.ncpu"?
> "sysctl -n machdep.cpu.core_count" does not work on my old Mac


Mehul Sanghvi <mnsanghvi>
Project MemberIn charge of this item.
Fri 25 Mar 2016 01:02:51 AM UTC, comment #7:

> For OSX the equivalent is to use sysctl -n machdep.cpu.core_count to figure out how many cores we have.


What about "sysctl -n hw.ncpu"?
"sysctl -n machdep.cpu.core_count" does not work on my old Mac.

KOIZUMI Satoru <koizumistr>
Thu 24 Mar 2016 02:38:37 AM UTC, comment #6:

The latest problem seems to be here in install.sh:

compile_to_c.new is not created and the return code is 0 so it does not exit.

This is using the native OS X compiler in /usr/bin/gcc. The OSX provided gcc does not support the -fno-gcse option. The OSX linker does not support -no-as-needed option. Based on my understanding of the option and its use, it does not seem like it is needed on OSX. Maybe someone can confirm this ?

I have also used gcc5, 5.3.0 from MacPorts, and got the same results.

Mehul Sanghvi <mnsanghvi>
Project MemberIn charge of this item.
Thu 24 Mar 2016 02:29:03 AM UTC, comment #5:
  • /proc/cpuinfo was being used to set the ${jobs} variable in work/tools.sh. For OSX the equivalent is to use sysctl -n machdep.cpu.core_count to figure out how many cores we have.
  • /proc/version was being used to set the ${flavor} variable. This is not portable, and so has been replaced with the use of uname -s as a condition for a case statement.
  • awk related errors: this was because of awk -vmax=$max vs awk -v max=$max. Notice the space after the -v which is the more portable method.
Mehul Sanghvi <mnsanghvi>
Project MemberIn charge of this item.
Sat 20 Feb 2016 10:20:38 PM UTC, comment #4:

your extract of the man page on MacOSX looks as it would support -a exactly similar as Linux.

I quickly checked about my comment from Dec - "-p" is not even necessary to keep the executable flag... I do not see why we need "-a" at all...

Raphael Mack <ramack>
Project Administrator
Fri 19 Feb 2016 04:06:01 AM UTC, comment #3:

I am documenting what I plan to do, in this bug so there is a trail of steps taken:

  • manually run cp -a on Linux and Mac OS X and compare results to see what it does
  • replace cp -l in install.sh with ln -s ?
  • see if environment variables can be set that will alter behaviour on Linux to make it POSIX compliant. Can use POSIX-compliant cp command across the platforms.
  • figure out the issue with awk -v not working on Mac OS X
  • replace use of /proc/cpuinfo and /proc/version with something more appropriate and portable
  • check for any other Linux vs Mac OS X (and probably by extension *BSD) issues.

Relevant section of Mac OS X man page for cp(1):

Mehul Sanghvi <mnsanghvi>
Project MemberIn charge of this item.
Wed 17 Feb 2016 01:22:50 AM UTC, comment #2:

I see the following "Linuxisms" as well:

grep: /proc/version: No such file or directory
grep: /proc/cpuinfo: No such file or directory
awk: invalid -v option

when I do "install.sh -bootstrap". The awk error shows up a lot.

I will look into the errors I get and take it from there in applying a fix.

Mehul Sanghvi <mnsanghvi>
Project MemberIn charge of this item.
Thu 17 Dec 2015 06:51:15 PM UTC, comment #1:

Thanks for reporting.
What about options "-dpR"? - I think only th "-p" is really relevant to keep the executable mode flag. On the other side on my linux system this is also preserved if no arguemtn is given, so the question stays whether we could completely remove the "-a" even on non MacosX/BSD systems...

Cyril, what was the reason for "-a"?

Raphael Mack <ramack>
Project Administrator
Sun 22 Mar 2015 02:14:06 PM UTC, original submission:

cp of MaxOS X does not accept -a option.
Maybe this is true on BSD variants.

install.sh on old MacOS X has one more problem, but it might be useful for other BSD variants to solve this cp's option problem.
I attach a patch.

KOIZUMI Satoru <koizumistr>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #37498:  bug-44601-osx-support-in-installer.diff added by mnsanghvi (9KiB - application/octet-stream)
file #37499:  bug-44601-germ-c2c-make.diff added by mnsanghvi (5KiB - application/octet-stream)
file #33419:  cp.patch added by koizumistr (4KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by mnsanghvi (Posted a comment)
  • -unavailable- added by ramack (Posted a comment)
  • -unavailable- added by koizumistr (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 12 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 26 Jun 2016 11:20:15 PM UTCmnsanghviStatusIn Progress=>Fixed
      Open/ClosedOpen=>Closed
      Fixed ReleaseNone=>curtiss
    Thu 16 Jun 2016 12:52:47 PM UTCmnsanghviAttached File-=>Added bug-44601-osx-support-in-installer.diff, #37498
      Attached File-=>Added bug-44601-germ-c2c-make.diff, #37499
    Thu 05 May 2016 05:59:03 PM UTCramackPlanned Releasebell=>curtiss
    Fri 08 Apr 2016 06:22:05 PM UTCramackSeverity3 - Normal=>4 - Important
    Thu 24 Mar 2016 02:29:03 AM UTCmnsanghviStatusNone=>In Progress
    Sat 20 Feb 2016 10:23:09 PM UTCramackAssigned tocadrian=>mnsanghvi
    Thu 18 Feb 2016 07:15:32 PM UTCramackPlanned ReleaseNone=>bell
    Thu 17 Dec 2015 06:51:15 PM UTCramackAssigned toNone=>cadrian
    Sun 22 Mar 2015 02:14:06 PM UTCkoizumistrAttached File-=>Added cp.patch, #33419

    Back to the top


    Powered by Savane 3.1-cleanup1