[MacPorts] #62867: ncarg: sh: -Wno-error=implicit-function-declaration: command not found

MacPorts noreply at macports.org
Mon Feb 21 22:26:13 UTC 2022


#62867: ncarg: sh: -Wno-error=implicit-function-declaration: command not found
-------------------------+----------------------
  Reporter:  ryandesign  |      Owner:  tenomoto
      Type:  defect      |     Status:  assigned
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:  2.6.4
Resolution:              |   Keywords:
      Port:  ncarg       |
-------------------------+----------------------

Comment (by ryandesign):

 I originally filed this ticket thinking `sh: -Wno-error=implicit-function-
 declaration: command not found` was the cause of the build failure I was
 seeing, but I see now that it's not. I filed a new ticket about the actual
 cause of the build failure (#64710).

 On my Intel system, although I get:
 {{{
 DEBUG: system -W
 /opt/local/var/macports/build/.../ncarg/work/ncl-6.6.2/config:
 CC=/opt/local/bin/h5cc  CFLAGS=-Os -Wno-error=implicit-function-
 declaration -isysroot
 /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk  make -f
 Makefile.ini;  ./ymake -config `pwd`
 sh: -Wno-error=implicit-function-declaration: command not found
 /opt/local/var/macports/build/.../ncarg/work/ncl-6.6.2/config/ymake-
 filter: Command not found.
 }}}
 the build then continues and finishes.

 I wondered whether `make -f Makefile.ini` and {{{./ymake -config `pwd`}}}
 not having run properly means that ncarg was built improperly or in any
 way differently. But I think that's not the case. It looks to me like
 `make -f Makefile.ini` compiles config/ymake-filter, and config/ymake uses
 config/ymake-filter to create config/makefile. So currently, with the
 Portfile quoting problem, config/makefile doesn't get created properly
 when the portfile tries to run ymake, but I see in the log that it does
 get run automatically by the build system later.

 I ran two builds, one with the current portfile code and one with my
 revised code, and the relevant diff between the logs is:

 {{{
 #!diff
 --- bad.log     2022-02-21 16:15:33.000000000 -0600
 +++ good.log    2022-02-21 15:55:35.000000000 -0600
 @@ -751,9 +751,9 @@
  :debug:configure euid/egid changed to: 0/0
  :debug:configure setting attributes on
 /opt/local/var/macports/build/.../ncarg/work/ncl-6.6.2/config/Darwin_Intel
  :debug:configure euid/egid changed to: 501/528
 -:debug:configure system -W
 /opt/local/var/macports/build/.../ncarg/work/ncl-6.6.2/config:
 CC=/opt/local/bin/h5cc  CFLAGS=-Os -Wno-error=implicit-function-
 declaration -isysroot
 /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk  make -f
 Makefile.ini;  ./ymake -config `pwd`
 -:info:configure sh: -Wno-error=implicit-function-declaration: command not
 found
 -:info:configure
 /opt/local/var/macports/build/.../ncarg/work/ncl-6.6.2/config/ymake-
 filter: Command not found.
 +:debug:configure system -W
 /opt/local/var/macports/build/.../ncarg/work/ncl-6.6.2/config:
 CC=/opt/local/bin/h5cc  CFLAGS=-Os\ -Wno-error=implicit-function-
 declaration\ -isysroot\
 /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk  make -f
 Makefile.ini;  ./ymake -config `pwd`
 +:info:configure /opt/local/bin/h5cc -O   -c -o ymake-filter.o ymake-
 filter.c
 +:info:configure /opt/local/bin/h5cc -O -o ymake-filter ymake-filter.o
  :debug:configure Executing org.macports.configure (ncarg)
  :debug:configure system -W
 /opt/local/var/macports/build/.../ncarg/work/ncl-6.6.2: ./Configure -v <<
 EOF
  :debug:configure
 @@ -782,10 +782,6 @@
  :debug:configure
  :debug:configure EOF
  :info:configure Building top-level Makefile to determine System defaults
 -:info:configure Making ymake from Makefile.ini in ./config first
 -:info:configure cc -O   -c -o ymake-filter.o ymake-filter.c
 -:info:configure cc -O -o ymake-filter ymake-filter.o
 -:info:configure Continuing in:
 /opt/local/var/macports/build/.../ncarg/work/ncl-6.6.2
  :info:configure Makefile built, checking defaults...
  :info:configure
 .....................................................................
  :info:configure *** Configuration Procedure for NCL and NCAR Graphics
 V6.6.2 ***
 }}}

 So here is the patch I propose:

 (The `;` between `make -f Makefile.ini` and {{{./ymake -config `pwd`}}}
 should be changed to `&&` so that failure of the first command will cause
 an error rather than allowing the second command to run.)

 {{{
 #!diff
 --- a/science/ncarg/Portfile
 +++ b/science/ncarg/Portfile
 @@ -169,8 +169,8 @@ pre-configure {
      # run ymake
      system -W ${worksrcpath}/config \
          "CC=${configure.cc} \
 -        CFLAGS=${configure.cflags} \
 -        make -f Makefile.ini; \
 +        CFLAGS=[shellescape ${configure.cflags}] \
 +        make -f Makefile.ini && \
          ./ymake -config `pwd`"

      # copy triangle.[ch]
 }}}

 According to http://ngwww.ucar.edu "NCAR Graphics is no longer supported"
 so I guess we won't be getting any help from them to resolve the implicit
 declaration of functions. Since the port already cannot build on arm64 for
 other reasons (#64710), continuing to suppress the implicit declaration of
 function errors is acceptable.

-- 
Ticket URL: <https://trac.macports.org/ticket/62867#comment:2>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list