You are not logged in.

#1 2013-12-28 15:58:55

Daethorian
Member
From: Stockholm, Sweden
Registered: 2010-10-21
Posts: 17

[SOLVED] makepkg gives "grep: invalid max count"

[thiderman@justitia dunst-git]$ makepkg
==> Making package: dunst-git 1.0.0.554.92cda43-1 (Sat Dec 28 16:52:48 CET 2013)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Updating dunst git repo...
Fetching origin
==> Validating source files with md5sums...
    dunst ... Skipped
==> Validating source files with sha256sums...
    dunst ... Skipped
==> Extracting sources...
  -> Creating working copy of dunst git repo...
Cloning into 'dunst'...
done.
==> Starting pkgver()...
==> Starting prepare()...
==> Removing existing pkg/ directory...
==> Starting build()...
dunst build options:
CFLAGS   = -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -g --std=c99 -pedantic -Wall -Wno-overlength-strings -Os  -D_FORTIFY_SOURCE=2 -D_BSD_SOURCE -DVERSION="v1.0.0-30-g92cda43" -DXINERAMA   -pthread -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/libpng16 
LDFLAGS  = -Wl,-O1,--sort-common,--as-needed,-z,relro -lm -L/usr/lib/X11 -lXss -lXinerama -ldbus-1 -lX11 -lfreetype -lXext -lXft -lXss -lgio-2.0 -lpangocairo-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lcairo -lxdg-basedir 
CC       = cc
creating config.h from config.def.h
CC -c x.c
grep: invalid max count
Makefile:31: recipe for target 'x.o' failed
make: *** [x.o] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
[thiderman@justitia dunst-git]$ 

This has happened to me for a while. I've tried building st-git and dunst-git from the AUR, and they both die with similar stacktraces. The output shown above is run in a bash with stock configuration, so no aliases or other shell trickery is going on. I've searched both source trees, but can't even find any mention of "grep" in any of them.

Googling suggested that a file with a name starting with "-m" has been found, but I can't find any of these either.

wat do?

Last edited by Daethorian (2013-12-28 17:16:25)

Offline

#2 2013-12-28 16:30:58

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,822
Website

Re: [SOLVED] makepkg gives "grep: invalid max count"

can you run make manually?

cd src/dunst-git
make

(edit: as a diagnostic step, not a long-term solution)

Also if you add a line in the makefile - say at line 31 - that just does "@echo ${CC} ${CFLAGS}" that might provide some insight.

Last edited by Trilby (2013-12-28 16:33:17)


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#3 2013-12-28 16:33:56

Daethorian
Member
From: Stockholm, Sweden
Registered: 2010-10-21
Posts: 17

Re: [SOLVED] makepkg gives "grep: invalid max count"

Nope, the very same.

dunst build options:
CFLAGS   = -g --std=c99 -pedantic -Wall -Wno-overlength-strings -Os  -D_BSD_SOURCE -DVERSION="v1.0.0-30-g92cda43" -DXINERAMA   -pthread -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/libpng16 
LDFLAGS  = -lm -L -lXss -lXinerama -ldbus-1 -lX11 -lfreetype -lXext -lXft -lXss -lgio-2.0 -lpangocairo-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lcairo -lxdg-basedir 
CC       = cc
CC -c x.c
grep: invalid option -- 'g'
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.
Makefile:31: recipe for target 'x.o' failed
make: *** [x.o] Error 2

(edit: Line 31 in the Makefile, as reported in the stacktrace, doesn't really make that much sense either. Forgot to note that.)

Last edited by Daethorian (2013-12-28 16:35:16)

Offline

#4 2013-12-28 16:37:49

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,822
Website

Re: [SOLVED] makepkg gives "grep: invalid max count"

See my edit above - but also I'd suggest removing all the "@" signs from the makefile to see what the actual command is that is failing.


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#5 2013-12-28 16:55:19

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 4,984

Re: [SOLVED] makepkg gives "grep: invalid max count"

So it's the cflags that are causing the problem. Note that the first error was about -m and the second one -g, both of which are the way your CFLAGS start in those cases.

Offline

#6 2013-12-28 17:01:46

Daethorian
Member
From: Stockholm, Sweden
Registered: 2010-10-21
Posts: 17

Re: [SOLVED] makepkg gives "grep: invalid max count"

Interesting. So, what could be causing the makefile to think that it should run grep on the CFLAGS line?

Offline

#7 2013-12-28 17:02:27

Daethorian
Member
From: Stockholm, Sweden
Registered: 2010-10-21
Posts: 17

Re: [SOLVED] makepkg gives "grep: invalid max count"

Trilby wrote:

See my edit above - but also I'd suggest removing all the "@" signs from the makefile to see what the actual command is that is failing.

It looks pretty much exactly the same:

dunst build options:
CFLAGS   = -g --std=c99 -pedantic -Wall -Wno-overlength-strings -Os  -D_BSD_SOURCE -DVERSION="v1.0.0-30-g92cda43" -DXINERAMA   -pthread -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/libpng16 
LDFLAGS  = -lm -L -lXss -lXinerama -ldbus-1 -lX11 -lfreetype -lXext -lXft -lXss -lgio-2.0 -lpangocairo-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lcairo -lxdg-basedir 
CC       = cc
cc -g --std=c99 -pedantic -Wall -Wno-overlength-strings -Os -D_BSD_SOURCE -DVERSION="v1.0.0-30-g92cda43" -DXINERAMA -pthread -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/libpng16
CC -c x.c
grep: invalid option -- 'g'
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.
Makefile:31: recipe for target 'x.o' failed
make: *** [x.o] Error 2

Offline

#8 2013-12-28 17:05:28

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 4,984

Re: [SOLVED] makepkg gives "grep: invalid max count"

how about giving us the output of 'file $(which cc)'?

Last edited by Scimmia (2013-12-28 17:06:04)

Offline

#9 2013-12-28 17:14:05

Daethorian
Member
From: Stockholm, Sweden
Registered: 2010-10-21
Posts: 17

Re: [SOLVED] makepkg gives "grep: invalid max count"

Okay, this is looking more and more like pebkac. If I create a completely new user on the system and then clone dunst-git and build it with makepkg, it works. So, something is wrong with my user, even though I am in a clean bash.

I'm usually using the cope perl tools to colorize output, but I've made sure to remove the cope dir from my $PATH while debugging this. Could it be that it's still running for whatever reason? hmm

Offline

#10 2013-12-28 17:15:52

Daethorian
Member
From: Stockholm, Sweden
Registered: 2010-10-21
Posts: 17

Re: [SOLVED] makepkg gives "grep: invalid max count"

And there we have it, cc is a command from a program I've written myself that is in /usr/local/bin. If I remove it, it works.

I now feel stupid as hell, haha. Thanks for helping me out guys.

Offline

#11 2013-12-28 19:05:36

karol
Archivist
Registered: 2009-05-06
Posts: 25,428

Re: [SOLVED] makepkg gives "grep: invalid max count"

Scimmia wrote:

how about giving us the output of 'file $(which cc)'?

'type cc' is useful too.

Offline

Board footer

Powered by FluxBB