-
Notifications
You must be signed in to change notification settings - Fork 443
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
Conversation
|
||
.. code-block:: scala | ||
|
||
universalArchiveOptions in (Universal, packageZipTarball) := |
There was a problem hiding this comment.
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", "*~"
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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.