These are chat archives for sbt/sbt-native-packager

5th
Oct 2015
Richard Gomes
@frgomes
Oct 05 2015 18:19
Hello, I'm trying to call sbt-native-package from inside my plugin. In a nutshell, I'm traversing the BuildStructure in order to find universal under my project. But seems like things do not work this way: I cannot find universal under my project. Seems like I should find universal via delegation instead. Any ideas? Thanks.
> inspect Star5SafeJvm/universal:packageBin 
[info] Task: java.io.File [info] Description: 
[info] Produces a main artifact, such as a binary jar. 
[info] Provided by: 
[info] {file:/home/richard/Development/repository/DeathToMaven/}Star5SafeJvm/universal:packageBin 
[info] Defined at: 
[info] (com.typesafe.sbt.packager.universal.UniversalPlugin) UniversalPlugin.scala:104 
[info] Dependencies: 
[info] Star5SafeJvm/universal:target 
[info] Star5SafeJvm/universal:packageName 
[info] Star5SafeJvm/universal:packageBin::mappings 
[info] Star5SafeJvm/universal:topLevelDirectory 
[info] Reverse dependencies: 
[info] Star5SafeJvm/universal:dist 
[info] Delegates: 
[info] Star5SafeJvm/universal:packageBin 
[info] Star5SafeJvm/*:packageBin 
[info]  {.}/universal:packageBin 
[info]  {.}/*:packageBin 
[info]  */universal:packageBin 
[info]  */*:packageBin
Richard Gomes
@frgomes
Oct 05 2015 18:27

In particular, I'm interested on finding Star5SafeJvm/universal:packageBin.
In SBT sources, Project.scala, line 449:

printScopes("Delegates", delegates(structure, scope, key))

Does anyone know how I could construct parameters scope and key for calling delegates? Thanks

Nepomuk Seiler
@muuki88
Oct 05 2015 18:40
@arutskoj that's what docker does. For each command it creates a new layer. I'm not 100% sure why we need to chown the contents in the container though. @fiadliel may know more about this
@frgomes what are you trying to achieve?
Gary Coady
@fiadliel
Oct 05 2015 19:59
@arutskoj @muuki88 The intent was to have the owner of the directories be the same as the running user - allowing log files etc. to be written out. I don't remember it creating a layer of the same size as the original... perhaps I overlooked that, or else the behaviour was different before.
Having the files owned by that user seems the only reasonable default, because so many programs write out files randomly...
But perhaps there is a way of getting the files added with the correct initial ownership, will have to look
A lot of Docker images side-step this problematic area by running servers as root, but I don't really accept that as a valid approach :)