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

Update documentation with warning about overriding default tar options. #889

Merged
merged 1 commit into from
Oct 7, 2016

Conversation

mackler
Copy link
Contributor

@mackler mackler commented Oct 6, 2016

Includes an example (that seems to be working for me).

I'm completely unfamiliar with Sphinx neither an Sbt expert, so please forgive me if this is wrong in either substance or format.

@muuki88 muuki88 added documentation Documentation should be extended or updated universal Zip, tar.gz, tgz and bash issues labels Oct 6, 2016

.. code-block:: scala

universalArchiveOptions in (Universal, packageZipTarball) :=
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for clarifying this. It would be nicer add this as a second example as this is more a sbt operator confusion then a native-packager documentation issue. The := operator overrides an existing setting whereas += / ++= appends something to an existing setting that is a Seq. So you change the example to

// override settings
universalArchiveOptions in (Universal, packageZipTarball) := Seq("--force-local", "-pvcf")
// addditional settings
universalArchiveOptions in (Universal, packageZipTarball) ++= Seq("--exclude", "*~"

Copy link
Contributor Author

@mackler mackler Oct 6, 2016

Choose a reason for hiding this comment

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

Would the second one work? I am under the impression that extra options to tar need to be prepended rather than appended, because the default switches include -f which must be followed by the tar-file name. But I believe the appended options will be placed between the -f switch and the tar-file name. Am I wrong about that?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hm. Not sure. In your description you overrode the complete settings

universalArchiveOptions in (Universal, packageZipTarball) := Seq("--exclude", "*~")

which caused an error. Can you try if appending works as well? I guess since these are all options the order shouldn't matter.

Copy link
Contributor Author

@mackler mackler Oct 6, 2016

Choose a reason for hiding this comment

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

I tried the append as

universalArchiveOptions in (Universal, packageZipTarball) ++= Seq("--exclude", "*~")

and the resulting output included:

Running with tar -pcvf --exclude *~ /tmp/sbt_72102b69/myApp-0.1.tar myApp-0.1
tar: *~: Cannot stat: No such file or directory
tar: /tmp/sbt_72102b69/myApp-0.1.tar: Cannot stat: No such file or directory

and then later:

gzip: can't stat: /tmp/sbt_72102b69/myApp-0.1.tar: No such file or directory
java.lang.RuntimeException: Error gziping /tmp/sbt_72102b69/myApp-0.1.tar. Exit code: 1
[error] (server/universal:packageZipTarball) Error gziping /tmp/sbt_72102b69/myApp-0.1.tar. Exit code: 1

Correct me if I'm wrong, but it looks like the generated command told tar to name the tar-file --exclude, and that (nonexistent) files named *~ and /tmp/sbt_72102b69/myApp-0.1.tar are to be included in the archive.

Again, the default options seem to depend on nothing coming between the -f switch and the tar-file name, which is what appending--but not prepending--custom options to the defaults does.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I see. Thanks for checking all this, currently I don't have much time, even for the small things.

@muuki88 muuki88 merged commit 26a2765 into sbt:master Oct 7, 2016
kardapoltsev pushed a commit to kardapoltsev/sbt-native-packager that referenced this pull request Apr 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation should be extended or updated universal Zip, tar.gz, tgz and bash issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants