Skip to content

Conversation

@WeiZhang555
Copy link
Contributor

Add install support to make, for installing image tools binaries into
$PATH.

Signed-off-by: Zhang Wei [email protected]

Makefile Outdated
install:
install -D -m 755 oci-create-runtime-bundle ${INSTALL_DIR}
install -D -m 755 oci-unpack ${INSTALL_DIR}
install -D -m 755 oci-image-validate ${INSTALL_DIR}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not excited about repeatedly listing all of our compiled tools. I don't see a way around that here, but with #28 we could do:

install: $(TOOLS)
    install -D -t $(INSTALL_DIR) $^

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems better. I can wait until #28 is merged. 😄

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, more $(DESTDIR) which is more the autoconf standard

.travis.yml Outdated
- make check-license
- make test
- make tools
- sudo make install
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to have sudo here, if we just add a DESTDIR variable so it can be installed to a limited user tmp dir. Maybe. Just thinking out loud here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.+1 to using DESTDIR and dropping sudo.

@WeiZhang555 WeiZhang555 force-pushed the make-install branch 4 times, most recently from f9fab1f to 131575b Compare October 9, 2016 07:34
@WeiZhang555
Copy link
Contributor Author

do we need to have sudo here, if we just add a DESTDIR variable so it can be installed to a limited user tmp dir. Maybe. Just thinking out loud here.

@vbatts @wking
Well, the .travis file and Makefile has switched to ${DESTDIR} as you suggested 😄

.travis.yml Outdated
- go get -u github.com/alecthomas/gometalinter
- gometalinter --install --update
- go get -t -d ./...
- mkdir /tmp/image-tools -p
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use mkdir -p /tmp/image-tools? The POSIX template is:

mkdir [-p] [-m mode] dir…

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated~

@wking
Copy link
Contributor

wking commented Oct 11, 2016 via email

@WeiZhang555
Copy link
Contributor Author

Any suggestion? @vbatts

.travis.yml Outdated

before_script:
- export PATH=$HOME/gopath/bin:$PATH
- export DESTDIR=/tmp/image-tools
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works, but I guess I would likely just include this with the command

.travis.yml Outdated
- make check-license
- make test
- make tools
- make install
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right here, like make install DESTDIR=/tmp/image-tools

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK for me.

@WeiZhang555
Copy link
Contributor Author

@vbatts Updated.

.travis.yml Outdated
- make check-license
- make test
- make tools
- DESTDIR=/tmp/image-tools make install
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually the variable is set after the targets as in @vbatts' example or the POSIX make usage's macro=value… or in the GNU make docs for overriding variables. POSIX make (not that we support it) requires an -e before environment variables will override macros. GNU make has more complicated environment → variable logic. But it seems best here to avoid the environment-variable approach entirely and to use the make install DESTDIR=/tmp/image-tools phrasing instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All right, it's quite convincible.
I'll update, thanks 😄

.travis.yml Outdated
- make check-license
- make test
- make tools
- make install DESTDIR=/tmp/image-tools
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Travis reports trailing whitespace.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad. It's green now 😄

Add `install` support to make, for installing image tools binaries into
$PATH.

Signed-off-by: Zhang Wei <[email protected]>
@wking
Copy link
Contributor

wking commented Oct 26, 2016

2fa43fe looks good to me :).

@WeiZhang555
Copy link
Contributor Author

ping @vbatts

@xiekeyang
Copy link
Contributor

xiekeyang commented Nov 9, 2016

LGTM

@xiekeyang
Copy link
Contributor

xiekeyang commented Nov 18, 2016

LGTM

Approved with PullApprove

@WeiZhang555
Copy link
Contributor Author

Since this has been dangling for so long, I'm closing this.

@wking
Copy link
Contributor

wking commented Jan 10, 2017 via email

@WeiZhang555
Copy link
Contributor Author

So maybe I should re-open this and keep it for some more time 😂

@WeiZhang555 WeiZhang555 reopened this Jan 10, 2017
@xiekeyang
Copy link
Contributor

LGTM

@xiekeyang
Copy link
Contributor

Need Rebase

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

Successfully merging this pull request may close these issues.

4 participants