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

make build attempts to rm -Rf /bin/* #49

Closed
meangrape opened this issue Feb 4, 2019 · 6 comments
Closed

make build attempts to rm -Rf /bin/* #49

meangrape opened this issue Feb 4, 2019 · 6 comments

Comments

@meangrape
Copy link
Contributor

meangrape commented Feb 4, 2019

I'm trying to build from source because I'm running on FreeBSD. I'm building such an old version because that's what the triton-kubernetes CLI tool tries to install.

The offending line is:

Makefile
21:     rm -Rf $(CURDIR)/bin/*

My assumption is that $(CURDIR) is a GNU extension. The default make on BSDs is not GNU make.

A possible solution is to use a GNUMakefile.

@meangrape meangrape changed the title make build attempts make build attempts to rm -Rf /bin/* Feb 4, 2019
@meangrape
Copy link
Contributor Author

[jayed@cabernet ~/triton/terraform-provider-rke-0.4.0]$ make build
rm -Rf /bin/*
rm: /bin/[: Permission denied
rm: /bin/cat: Permission denied
rm: /bin/chflags: Permission denied
rm: /bin/chio: Permission denied
rm: /bin/chmod: Permission denied
rm: /bin/cp: Permission denied
rm: /bin/csh: Permission denied
rm: /bin/date: Permission denied
rm: /bin/dd: Permission denied
rm: /bin/df: Permission denied
rm: /bin/domainname: Permission denied
rm: /bin/echo: Permission denied
rm: /bin/ed: Permission denied
rm: /bin/expr: Permission denied
rm: /bin/freebsd-version: Permission denied
rm: /bin/getfacl: Permission denied
rm: /bin/hostname: Permission denied
rm: /bin/kenv: Permission denied
rm: /bin/kill: Permission denied
rm: /bin/link: Permission denied
rm: /bin/ln: Permission denied
rm: /bin/ls: Permission denied
rm: /bin/mkdir: Permission denied
rm: /bin/mv: Permission denied
rm: /bin/pax: Permission denied
rm: /bin/pgrep: Permission denied
rm: /bin/pkill: Permission denied
rm: /bin/ps: Permission denied
rm: /bin/pwait: Permission denied
rm: /bin/pwd: Permission denied
rm: /bin/rcp: Permission denied
rm: /bin/realpath: Permission denied
rm: /bin/red: Permission denied
rm: /bin/rm: Permission denied
rm: /bin/rmail: Permission denied
rm: /bin/rmdir: Permission denied
rm: /bin/setfacl: Permission denied
rm: /bin/sh: Permission denied
rm: /bin/sleep: Permission denied
rm: /bin/stty: Permission denied
rm: /bin/sync: Permission denied
rm: /bin/tcsh: Permission denied
rm: /bin/test: Permission denied
rm: /bin/unlink: Permission denied
rm: /bin/uuidgen: Permission denied
*** Error code 1

Stop.
make: stopped in /usr/home/jayed/triton/terraform-provider-rke-0.4.0

@yamamoto-febc
Copy link
Contributor

Hi @Jayed, Thank you for your report!

I think this is an undesirable behavior:scream:
I'm going to fix this.

@yamamoto-febc
Copy link
Contributor

I just released v0.7.1.

This version includes some fixes. Please try it:pray:

@metalefty
Copy link

$$PWD should work fine with both GNU make and FreeBSD make.
http://lists.gnu.org/archive/html/help-make/2002-10/msg00029.html

However, regardless make is GNU make or other make, relative paths from current directory should be used carefully. For example, this also attempt to rm -Rf /bin/* with GNU make.

$ cd /tmp
$ git clone https://github.com/yamamoto-febc/terraform-provider-rke.git
$ cd /
$ make -f /tmp/terraform-provider-rke/Makefile 

You might mean the Makefile directory in this case. Following example works only with GNU make but safer.

MKFILE_DIR := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))

clean:
        rm -Rf $(MKFILE_DIR)bin/*

@yamamoto-febc
Copy link
Contributor

@metalefty Thank you for your suggestion!!

Looks good! I'll fix it in near future:+1:

@yamamoto-febc
Copy link
Contributor

I'm going to close this. When we take additional action, we will open other Issue/PR.

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