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

[PATCH] $(MINIPERL_EXE) shouldn't be required to exist for "rm" #17127

Closed
p5pRT opened this issue Aug 13, 2019 · 9 comments
Closed

[PATCH] $(MINIPERL_EXE) shouldn't be required to exist for "rm" #17127

p5pRT opened this issue Aug 13, 2019 · 9 comments

Comments

@p5pRT
Copy link

p5pRT commented Aug 13, 2019

Migrated from rt.perl.org#134361 (status was 'rejected')

Searchable as RT134361$

@p5pRT
Copy link
Author

p5pRT commented Aug 13, 2019

From @haukex

Hi,

Pretty simple​: "rm \$(MINIPERL_EXE)" can cause the build step to fail,
"rm -f \$(MINIPERL_EXE)" seems to make more sense. Patch attached.

Thanks, Best,
-- Hauke D

@p5pRT
Copy link
Author

p5pRT commented Aug 13, 2019

From @haukex

0001-Don-t-require-MINIPERL_EXE-to-exist-for-removal.patch
From 182809027cce9a844ab9e730d620f21369282c7f Mon Sep 17 00:00:00 2001
From: Hauke D <haukex@zero-g.net>
Date: Tue, 13 Aug 2019 22:12:36 +0200
Subject: [PATCH] Don't require $(MINIPERL_EXE) to exist for removal

---
 Makefile.SH | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile.SH b/Makefile.SH
index 9f04c7dcde..180def880b 100755
--- a/Makefile.SH
+++ b/Makefile.SH
@@ -1029,7 +1029,7 @@ lib/buildcustomize.pl: $& $(miniperl_objs) write_buildcustomize.pl
 			$spitshell >>$Makefile <<!GROK!THIS!
 lib/buildcustomize.pl: \$& \$(miniperl_dep) write_buildcustomize.pl
 	-@rm -f miniperl.xok
-	-@rm \$(MINIPERL_EXE)
+	-@rm -f \$(MINIPERL_EXE)
 	\$(LNS) \$(HOST_PERL) \$(MINIPERL_EXE)
 	\$(LDLIBPTH) ./miniperl\$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl.  Please run make minitest; exit 1'
 	\$(MINIPERL) -f write_buildcustomize.pl 'osname' "$osname"
-- 
2.22.0

@p5pRT
Copy link
Author

p5pRT commented Aug 15, 2019

From @tonycoz

On Tue, 13 Aug 2019 13​:24​:26 -0700, haukex@​zero-g.net wrote​:

Hi,

Pretty simple​: "rm \$(MINIPERL_EXE)" can cause the build step to fail,

I don't see how, the "-" means that the exit value from rm is ignored.

"rm -f \$(MINIPERL_EXE)" seems to make more sense. Patch attached.

This only prevents a diagnostic, it won't prevent any sort of build failure (which will happen if miniperl exista and is immutable for example.)

Tony

@p5pRT
Copy link
Author

p5pRT commented Aug 15, 2019

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Aug 15, 2019

From @haukex

Hi,

$ man rm
  -f, --force
  ignore nonexistent files and arguments, never prompt
$ rm doesnotexist ; echo $?
rm​: cannot remove 'doesnotexist'​: No such file or directory
1
$ rm -f doesnotexist ; echo $?
0

It's the nonzero exit code that causes `make` to think the build step failed. Or am I misunderstanding you?

Best,
-- Hauke D

On Wed, 14 Aug 2019 18​:15​:37 -0700, tonyc wrote​:

On Tue, 13 Aug 2019 13​:24​:26 -0700, haukex@​zero-g.net wrote​:

Hi,

Pretty simple​: "rm \$(MINIPERL_EXE)" can cause the build step to
fail,

I don't see how, the "-" means that the exit value from rm is ignored.

"rm -f \$(MINIPERL_EXE)" seems to make more sense. Patch attached.

This only prevents a diagnostic, it won't prevent any sort of build
failure (which will happen if miniperl exista and is immutable for
example.)

Tony

@p5pRT
Copy link
Author

p5pRT commented Aug 20, 2019

From @tonycoz

On Wed, 14 Aug 2019 23​:19​:58 -0700, haukex@​zero-g.net wrote​:

Hi,

$ man rm
-f, --force
ignore nonexistent files and arguments, never prompt
$ rm doesnotexist ; echo $?
rm​: cannot remove 'doesnotexist'​: No such file or directory
1
$ rm -f doesnotexist ; echo $?
0

It's the nonzero exit code that causes `make` to think the build step
failed. Or am I misunderstanding you?

  -@​rm \$(MINIPERL_EXE)

The "-" at the front of the recipe means that the exit code of rm is ignored. (The @​ means the command isn't echoed.)

From the GNU make documentation​:

  To ignore errors in a recipe line, write a '-' at the beginning of
the line's text (after the initial tab). The '-' is discarded before
the line is passed to the shell for execution.

  For example,

  clean​:
  -rm -f *.o

This causes 'make' to continue even if 'rm' is unable to remove a file.

Tony

@p5pRT
Copy link
Author

p5pRT commented Aug 20, 2019

From @haukex

Hi,

Oh, I see what you mean, thanks! That's strange then, I will have to do some more research on why the build failed on my end then. Will update once I know more.

Best,
-- Hauke D

On Mon, 19 Aug 2019 23​:22​:11 -0700, tonyc wrote​:

On Wed, 14 Aug 2019 23​:19​:58 -0700, haukex@​zero-g.net wrote​:

Hi,

$ man rm
-f, --force
ignore nonexistent files and arguments, never prompt
$ rm doesnotexist ; echo $?
rm​: cannot remove 'doesnotexist'​: No such file or directory
1
$ rm -f doesnotexist ; echo $?
0

It's the nonzero exit code that causes `make` to think the build step
failed. Or am I misunderstanding you?

-@​rm \$(MINIPERL_EXE)

The "-" at the front of the recipe means that the exit code of rm is
ignored. (The @​ means the command isn't echoed.)

From the GNU make documentation​:

To ignore errors in a recipe line, write a '-' at the beginning of
the line's text (after the initial tab). The '-' is discarded before
the line is passed to the shell for execution.

For example,

clean​:
-rm -f *.o

This causes 'make' to continue even if 'rm' is unable to remove a
file.

Tony

@p5pRT
Copy link
Author

p5pRT commented Aug 28, 2019

From @tonycoz

On Mon, 19 Aug 2019 23​:25​:06 -0700, haukex@​zero-g.net wrote​:

Hi,

Oh, I see what you mean, thanks! That's strange then, I will have to
do some more research on why the build failed on my end then. Will
update once I know more.

Closing this, if you end up finding the cause and it's our problem, please open a new ticket.

Tony

@p5pRT
Copy link
Author

p5pRT commented Aug 28, 2019

@tonycoz - Status changed from 'open' to 'rejected'

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

1 participant