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

quit remake fail when debug Makefile of remake, is it a bug? #28

Closed
liugang opened this issue Jul 25, 2015 · 3 comments
Closed

quit remake fail when debug Makefile of remake, is it a bug? #28

liugang opened this issue Jul 25, 2015 · 3 comments

Comments

@liugang
Copy link

liugang commented Jul 25, 2015


~/remake$ remake -X
Reading makefiles...
Updating makefiles....
-> (/home/galen_liu/remake/Makefile:620)
Makefile: Makefile.in config.status
================================================================================
remake<0> n
Updating goal targets....
 File `all' does not exist.
-- (/home/galen_liu/remake/Makefile:599)
all: config.h
================================================================================
remake<1> n
   Prerequisite 'stamp-h1' is newer than target 'config.h'.
  Must remake target 'config.h'.
Makefile:640: update target 'config.h' due to: stamp-h1
##>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
test -f config.h || rm -f stamp-h1
##<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
##>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
test -f config.h || remake  stamp-h1
##<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  Successfully remade target file 'config.h'.
Must remake target 'all'.
Makefile:600: update target 'all' due to: config.h
##>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
remake  all-recursive
##<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Reading makefiles...
Updating makefiles....
-> (/home/galen_liu/remake/Makefile:620)
Makefile: Makefile.in config.status
================================================================================
remake<<0>> n
Updating goal targets....
 File `all-recursive' does not exist.
-- (/home/galen_liu/remake/Makefile:879)
all-recursive: 
================================================================================
remake<<1>> n
Must remake target 'all-recursive'.
remake[1]: Entering directory '/home/galen_liu/remake'
Makefile:880: target 'all-recursive' does not exist
##>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
fail=; \
if (target_option=k; case ${target_option-} in ?) ;; *) echo "am__make_running_with_option: internal error: invalid" "target option '${target_option-}' specified" >&2; exit 1;; esac; has_opt=no; sane_makeflags=$MAKEFLAGS; if test -n ' Makefile .deps/alloca.Po .deps/getloadavg.Po .deps/alloc.Po .deps/ar.Po .deps/arscan.Po .deps/buildargv.Po .deps/commands.Po .deps/debug.Po .deps/default.Po .deps/dir.Po .deps/expand.Po .deps/file.Po .deps/file_basic.Po .deps/function.Po .deps/getopt.Po .deps/getopt1.Po .deps/globals.Po .deps/guile.Po .deps/hash.Po .deps/implicit.Po .deps/job.Po .deps/load.Po .deps/loadapi.Po .deps/loadavg-getloadavg.Po .deps/main.Po .deps/misc.Po .deps/mock.Po .deps/output.Po .deps/print.Po .deps/profile.Po .deps/read.Po .deps/remake.Po .deps/remote-cstms.Po .deps/remote-stub.Po .deps/rule.Po .deps/signame.Po .deps/strcache.Po .deps/trace.Po .deps/variable.Po .deps/version.Po .deps/vmsjobs.Po .deps/vpath.Po debugger/.deps/break.Po debugger/.deps/cmd.Po debugger/.deps/file2line.Po debugger/.deps/fns.Po debugger/.deps/msg.Po debugger/.deps/stack.Po' && test -n '1'; then sane_makeflags=$MFLAGS; else case $MAKEFLAGS in *\\[\ \ ]*) bs=\\; sane_makeflags=`printf '%s\n' "$MAKEFLAGS" | sed "s/$bs$bs[$bs $bs   ]*//g"`;; esac; fi; skip_next=no; strip_trailopt () { flg=`printf '%s\n' "$flg" | sed "s/$1.*$//"`; }; for flg in $sane_makeflags; do test $skip_next = yes && { skip_next=no; continue; }; case $flg in *=*|--*) continue;; -*I) strip_trailopt 'I'; skip_next=yes;; -*I?*) strip_trailopt 'I';; -*O) strip_trailopt 'O'; skip_next=yes;; -*O?*) strip_trailopt 'O';; -*l) strip_trailopt 'l'; skip_next=yes;; -*l?*) strip_trailopt 'l';; -[dEDm]) skip_next=yes;; -[JT]) skip_next=yes;; esac; case $flg in *$target_option*) has_opt=yes; break;; esac; done; test $has_opt = yes); then \
  failcom='fail=yes'; \
else \
  failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo all-recursive | sed s/-recursive//`; \
case "all-recursive" in \
  distclean-* | maintainer-clean-*) list='glob config po doc w32 unittest' ;; \
  *) list='glob config po doc  unittest' ;; \
esac; \
for subdir in $list; do \
  echo "Making $target in $subdir"; \
  if test "$subdir" = "."; then \
    dot_seen=yes; \
    local_target="$target-am"; \
  else \
    local_target="$target"; \
  fi; \
  (CDPATH="${ZSH_VERSION+.}:" && cd $subdir && remake  $local_target) \
  || eval $failcom; \
done; \
if test "$dot_seen" = "no"; then \
  remake  "$target-am" || exit 1; \
fi; test -z "$fail"
##<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Making all in glob
Reading makefiles...
Updating makefiles....
-> (/home/galen_liu/remake/glob/Makefile:347)
Makefile: Makefile.in ../config.status
================================================================================
remake<<<0>>> q
remake: That's all, folks...
Makefile:880: recipe for target 'all-recursive' failed
Makefile:879: *** [all-recursive] Error 1

#0  all-recursive at /home/galen_liu/remake/Makefile:879

***Entering debugger because we encountered a fatal error.
** Exiting the debugger will exit make with exit code 1.
!! (/home/galen_liu/remake/Makefile:879)
all-recursive
================================================================================
remake<<2>> q
remake: That's all, folks...
remake[1]: *** Waiting for unfinished jobs....
remake[1]: *** wait: No child processes.  Stop.
Makefile:600: recipe for target 'all' failed
Makefile:599: *** [all] Error 2

#0  all at /home/galen_liu/remake/Makefile:599

***Entering debugger because we encountered a fatal error.
** Exiting the debugger will exit make with exit code 2.
!! (/home/galen_liu/remake/Makefile:599)
all
================================================================================
remake<2> q
remake: That's all, folks...
remake: *** Waiting for unfinished jobs....
remake: *** wait: No child processes.  Stop.
~/remake$ 

@rocky
Copy link
Owner

rocky commented Jul 25, 2015

Your target shell code is setting the exit code and that is what causing remake not exit all of the way to the top.

See help quit for how remake decides whether to stay in the debugger or exit.

Also, please when giving examples try to reduce the example to the smallest possible Makefile that exhibits the problem. Can you get the problem down to just one Makefile as I did in one of your previous example with https://gist.github.com/rocky/2bf8ee0000a1efd53929 ? If you do this, I bet you would understand the nature of the bug or feature better.

As I said before I have very limited time to work on this and probably should not be spending any time on this.

@rocky rocky closed this as completed Jul 25, 2015
@liugang
Copy link
Author

liugang commented Jul 25, 2015

As I said before I have very limited time to work on this and probably should not be spending any time on this.

OK, I also very busy on my project, and I just found some bug and try to fixed, but I am not familiar with the source code of make. so I commit the issue and want to see how you fix it, then I can learn the code quickly and can fix bug or improve the remake.

I'm sorry to disturb you.

@rocky
Copy link
Owner

rocky commented Jul 25, 2015

I'm sorry

Your intentions are good. It's just the timing that's unfortunate and that's not your fault.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants