@@ -62,11 +62,12 @@ type Opts struct {
6262type SetOpt func (* Opts )
6363
6464type setup struct {
65- path string
66- opts * Opts
67- depot * depot
68- env * envdef.Collection
69- buildplan * buildplan.BuildPlan
65+ path string
66+ opts * Opts
67+ depot * depot
68+ supportsHardLinks bool
69+ env * envdef.Collection
70+ buildplan * buildplan.BuildPlan
7071
7172 // toBuild encompasses all artifacts that will need to be build for this runtime.
7273 // This does NOT mean every artifact in the runtime closure if this is an update (as oppose to a fresh toInstall).
@@ -163,16 +164,17 @@ func newSetup(path string, bp *buildplan.BuildPlan, env *envdef.Collection, depo
163164 }
164165
165166 return & setup {
166- path : path ,
167- opts : opts ,
168- env : env ,
169- depot : depot ,
170- buildplan : bp ,
171- toBuild : artifactsToBuild .ToIDMap (),
172- toDownload : artifactsToDownload .ToIDMap (),
173- toUnpack : artifactsToUnpack .ToIDMap (),
174- toInstall : artifactsToInstall .ToIDMap (),
175- toUninstall : artifactsToUninstall ,
167+ path : path ,
168+ opts : opts ,
169+ env : env ,
170+ depot : depot ,
171+ supportsHardLinks : supportsHardLinks (depot .depotPath ),
172+ buildplan : bp ,
173+ toBuild : artifactsToBuild .ToIDMap (),
174+ toDownload : artifactsToDownload .ToIDMap (),
175+ toUnpack : artifactsToUnpack .ToIDMap (),
176+ toInstall : artifactsToInstall .ToIDMap (),
177+ toUninstall : artifactsToUninstall ,
176178 }, nil
177179}
178180
@@ -463,12 +465,14 @@ func (s *setup) install(id strfmt.UUID) (rerr error) {
463465 return errs .Wrap (err , "Could not get env" )
464466 }
465467
466- if envDef .NeedsTransforms () {
468+ if envDef .NeedsTransforms () || ! s . supportsHardLinks {
467469 if err := s .depot .DeployViaCopy (id , envDef .InstallDir , s .path ); err != nil {
468470 return errs .Wrap (err , "Could not deploy artifact via copy" )
469471 }
470- if err := envDef .ApplyFileTransforms (s .path ); err != nil {
471- return errs .Wrap (err , "Could not apply env transforms" )
472+ if envDef .NeedsTransforms () {
473+ if err := envDef .ApplyFileTransforms (s .path ); err != nil {
474+ return errs .Wrap (err , "Could not apply env transforms" )
475+ }
472476 }
473477 } else {
474478 if err := s .depot .DeployViaLink (id , envDef .InstallDir , s .path ); err != nil {
0 commit comments