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

remake -xn isn't the same as remake -nx #40

Open
MayeulC opened this issue Aug 25, 2018 · 9 comments
Open

remake -xn isn't the same as remake -nx #40

MayeulC opened this issue Aug 25, 2018 · 9 comments

Comments

@MayeulC
Copy link
Contributor

MayeulC commented Aug 25, 2018

remake -nx does perform a dry run; remake -xn does not.

The problem might seat between the keyboard and the chair, as I didn't extensively read the documentation (thus it could be intended behaviour, just unexpected for me); but I would expect them to perform the same.


System configuration

OS: Arch Linux
make: GNU Make 4.2.1
remake: GNU Make 4.2.1+dbg-1.4

Steps to reproduce

Example Makefile:

a:
	echo this was executed

Correct output

$ remake -nx
Reading makefiles...
Updating makefiles...
Updating goal targets...
 File 'a' does not exist.
Must remake target 'a'.
Makefile:2: target 'a' does not exist
##>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
echo this was executed
##<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Successfully remade target file 'a'.
$ remake --trace -n
Reading makefiles...
Updating makefiles...
Updating goal targets...
 File 'a' does not exist.
Must remake target 'a'.
Makefile:2: target 'a' does not exist
##>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
echo this was executed
##<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Successfully remade target file 'a'.
$ remake -x
Reading makefiles...
Updating makefiles...
Updating goal targets...
 File 'a' does not exist.
Must remake target 'a'.
Makefile:2: target 'a' does not exist
##>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
echo this was executed
##<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
this was executed
Successfully remade target file 'a'.

Unexpected output

$ remake -xn
Makefile:2: target 'a' does not exist
##>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
echo this was executed
##<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
this was executed
@rocky
Copy link
Owner

rocky commented Aug 26, 2018

Make it easy for me to help you. Come up with a specific Makefile, and show the results of one over the other. Then do the same with GNU make.

Give the GNU remake and GNU make versions that you used as well as the OS versions.

@MayeulC
Copy link
Contributor Author

MayeulC commented Aug 26, 2018

All right, sorry for that oversight, I was quite tired at the time. I expanded a bit with some system information and more examples on how to reproduce this.

This isn't reproducible with make, as it doesn't have a -x option, and both remake --trace -n & remake -n --trace perform the same, so I left the

Then do the same with GNU make.

part out.


Off-topic, but might be worthy to discuss:

I also reported a French translation bug to https://translationproject.org/team/index.html since that's what was indicated on that page; but I had to read this repository's makefiles to find that page, so I guess it could be a bit more documented as well. The bug was:

update target 'xxx' due to: yyy

is translated to

mise à jour de la cible « xxx » nécessaire pour : yyy

litterally meaning:

updating target « xxx » necessary for: yyy

which is completely backwards, and hard to understand. "nécessaire pour" should be something along the lines of "à cause de" (~"because of") or "causée par" (~"caused by").

I'm only writing this here to get confirmation that this was the right channel to report the translation issue; if not, I can open a ticket in the right place.

@rocky
Copy link
Owner

rocky commented Aug 27, 2018

Will have to look at what's up with -nx vs `-xn and it may take a while. It is a bug, but it feels like a minor one.

As for the translations, that discussion isn't going to do anything here.

@boretom
Copy link
Collaborator

boretom commented Feb 8, 2020

I did have a look at this issue and I can't decide if it's a bug or expected behaviour.

The trace (-x | --trace) parameter accepts an argument and therefore the character(s) that follow '-x' are assumed to be that argument. No argument is necessary since it sets a default, hence '-nx' works.

The same erroneous behaviour can be seen if running remake -xv which should just print the version information. But the output is the same as if I run remake -xn.

For debugging this issue I used the source of hashdeep since it got no dependencies expect autoconf/automake build tools. But every project will do.

I would expect remake to exit with an error if the argument passed to '-x'(or --trace) is none of the following expected arguments.

  -x, --trace[=TYPE]          Trace command execution TYPE may be
                              "command", "read", "normal"."
                              "noshell", or "full". Default is "normal"

It doesn't do that yet, see main.c, line 563-584 function decode_trace_flags(). Personally I would let remake exit with a meaningful error text.

@rocky
Copy link
Owner

rocky commented Feb 8, 2020

It doesn't do that yet, see main.c, line 563-584 function decode_trace_flags(). Personally I would let remake exit with a meaningful error text.

Feel free to fix and put in a PR!

If you are feeling more ambitious there is a new vesion of GNU make, version 4.3 out. So there eventually will be a 4.3 branch with an entires set of patches to add the features here that aren't in GNU make.

@boretom
Copy link
Collaborator

boretom commented Feb 9, 2020

I'll create a PR probably sometimes next week.

And for the being more ambitious, I'll have a look at the code to see if I can wrap my head around that topic.

boretom added a commit to boretom/remake that referenced this issue Feb 9, 2020
- This fix came to light through issue rocky#40 'remake -xn isn't the same
   as remake -nx'
- Added a check for invalid tracing option (-x|--trace)
@boretom
Copy link
Collaborator

boretom commented Feb 13, 2020

Is fixed with remake@e141b6a

@rocky
Copy link
Owner

rocky commented Feb 13, 2020

@boretom Thanks!

@MayeulC please try this out. If we don't hear back from you in a couple of days, I'll assume this is fixed.

@boretom
Copy link
Collaborator

boretom commented Feb 14, 2020

@rocky, regarding make 4.3: I did a diff and I'm up for the task - not like from 3.8 to 4 :) ... it may take a week or two. If you're ok with that timeline I would take on the task.

@rocky rocky mentioned this issue Feb 14, 2020
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

3 participants