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

Fix "make tar" and "make dist" #4179

Closed
wants to merge 4 commits into from

Conversation

levitte
Copy link
Member

@levitte levitte commented Aug 17, 2017

The "tar" make target wasn't quite right, it didn't change directory correctly, making the preparation command given in the "dist" target useless. This also clarifies that a tar command that understands --owner and --group is expected.


This is an alternative to the fix in #4114

We changed directory to the wrong directory.
This change also separates the preparation phase from the tarball
building phase.
@levitte levitte added 1.1.0 branch: master Merge to master branch labels Aug 17, 2017
@levitte
Copy link
Member Author

levitte commented Aug 17, 2017

@meena-vyas, I would very much appreciate it if you had a look at this on Solaris.

@@ -679,9 +679,12 @@ tags TAGS: FORCE

# Release targets (note: only available on Unix) #####################

# If your tar command doesn't support --owner and --group, make sure to
# use one that does, for example GNU tar
TAR_COMMAND=$(TAR) $(TARFLAGS) --owner 0 --group 0 -cvf -
Copy link
Contributor

Choose a reason for hiding this comment

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

If you put those flags into a make variable

TARFLAGS = --owner 0 -- group 0

then it's at least easier for folks to work around.

Copy link
Member Author

Choose a reason for hiding this comment

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

Nah. Set the whole TAR_COMMAND then. See .travis-create-release.sh, which does exactly that for Mac OS X.

Copy link
Contributor

Choose a reason for hiding this comment

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

But you have "TARFLAGS". Oh well.

Copy link
Member Author

Choose a reason for hiding this comment

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

True. However, we have enforced user 0 and group 0 since the start of OpenSSL (a long time ago, we used tardy to do that)... I'm not sure now is the time to stop.

Copy link
Contributor

Choose a reason for hiding this comment

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

I am not saying stop. I am saying putting it in a variable lets someone easily override it if they have to.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think you and I don't quite understand "enforce" the same way ;-)

Copy link
Contributor

@dot-asm dot-asm Aug 18, 2017

Choose a reason for hiding this comment

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

I suppose question here is if we want users to use this or not. If we don't, then all bets on obscurity and linux specifics are off. But if we do want users to use it, then we're better off making it more intuitive. And more intuitive would be to detect if tar is GNU and act accordingly, e.g. issue warning and omit non-standard flags, or terminate with "GNU tar only" message. And command replacement should be more convenient. E.g. on Solaris one should be able to do say make tar TAR=gtar, i.e. without having to figure out/remember that it's TAR_COMMAND, which should really be called TAR_CREATE (because that's what the operation it does)...

Copy link
Contributor

Choose a reason for hiding this comment

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

TAR_COMMAND, which should really be called TAR_CREATE

If not TAR_CREATE_STDOUT...

Copy link
Member Author

Choose a reason for hiding this comment

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

Nevertheless, if users are using the tar (or dist) target, it would be unwise to make sudden variable changes now. Chances are that there are scripts that depend on them (such as our own .travis-create-release.sh).

Copy link
Contributor

Choose a reason for hiding this comment

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

It wasn't my intention to suggest TAR_COMMAND rename. [I suppose I should have written "which should really have been called"?] The implication was rather to detect if tar (or more specifically $(TAR)) is GNU and do something about that...

@dot-asm
Copy link
Contributor

dot-asm commented Aug 18, 2017

$grep -v -E
grep: illegal option -- E

What's emoji for dropped jaw? I've explicitly checked Solaris manual page yesterday, before suggesting to replace egrep... Though it was quite old version... Yeah, newer page says -E is not an option. Wow! To recap, the background for suggestion to replace egrep with grep -E was that egrep is listed as deprecated [at least on Linux, Tru64 and HP-UX], but apparently Solaris goes different opposite direction. Well, I suppose we should switch back to egrep. Sorry, Richard, for caused confusion...

@dot-asm
Copy link
Contributor

dot-asm commented Aug 18, 2017

newer [manual] page says -E is not an option.

for /usr/bin/grep. But it is for /usr/xpg4/bin/grep. [And actually even old page says that. I suppose I was not attentive enough yesterday. Double-apologies, Richard.] BTW, Solaris manual page for egrep says that /usr/bin/egrep recognizes | between full expressions. Double-checking what does it mean in practice...

@dot-asm
Copy link
Contributor

dot-asm commented Aug 18, 2017

Just switch to egrep seems to work. I mean adjustment to the expression doesn't seem to be required.

@dot-asm
Copy link
Contributor

dot-asm commented Aug 18, 2017

on Solaris one should be able to do say make tar TAR=gtar

Well, one can actually do exactly that as it is now (modulo egrep thing). One probably should recognize that gtar is in an add-on package, i.e. one probably can't assume that it's available on all installations.

@levitte
Copy link
Member Author

levitte commented Aug 18, 2017

Cool. I'll do the change back to egrep a little later

@levitte
Copy link
Member Author

levitte commented Aug 18, 2017

egrep restored

@dot-asm dot-asm added the approval: done This pull request has the required number of approvals label Aug 18, 2017
levitte added a commit that referenced this pull request Aug 18, 2017
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from #4179)
levitte added a commit that referenced this pull request Aug 18, 2017
We changed directory to the wrong directory.
This change also separates the preparation phase from the tarball
building phase.

Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from #4179)
levitte added a commit that referenced this pull request Aug 18, 2017
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from #4179)
levitte added a commit that referenced this pull request Aug 18, 2017
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from #4179)

(cherry picked from commit 34a5b7d)
levitte added a commit that referenced this pull request Aug 18, 2017
We changed directory to the wrong directory.
This change also separates the preparation phase from the tarball
building phase.

Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from #4179)

(cherry picked from commit 17c84aa)
levitte added a commit that referenced this pull request Aug 18, 2017
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from #4179)

(cherry picked from commit 77a9c26)
@levitte
Copy link
Member Author

levitte commented Aug 18, 2017

Merged.

master: 34a5b7d to 77a9c26
1.1.0: a50c4aa to f48e792

@levitte levitte closed this Aug 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approval: done This pull request has the required number of approvals branch: master Merge to master branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants