Skip to content

Commit f1465db

Browse files
committed
Fix bug where path of local dependency inside of a local dependency was calculated from the wrong project.
1 parent 81a504c commit f1465db

4 files changed

Lines changed: 17 additions & 14 deletions

File tree

src/Terminal/PackageBump.gren

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ type alias Result =
6464
, publishedVersion :
6565
{ outline : Outline
6666
, rootSources : Dict String Compiler.Backend.SourceFile
67-
, dependencies : Dict String { outline : Outline.PkgOutline, sources : Dict String String }
67+
, dependencies : Dict String { path : Path, outline : Outline.PkgOutline, sources : Dict String String }
6868
}
6969
, currentVersion :
7070
{ outline : Outline
7171
, rootSources : Dict String Compiler.Backend.SourceFile
72-
, dependencies : Dict String { outline : Outline.PkgOutline, sources : Dict String String }
72+
, dependencies : Dict String { path : Path, outline : Outline.PkgOutline, sources : Dict String String }
7373
}
7474
}
7575

src/Terminal/PackageDiff.gren

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ type alias Result =
6666
, firstPackage :
6767
{ outline : Outline
6868
, rootSources : Dict String Compiler.Backend.SourceFile
69-
, dependencies : Dict String { outline : Outline.PkgOutline, sources : Dict String String }
69+
, dependencies : Dict String { path : Path, outline : Outline.PkgOutline, sources : Dict String String }
7070
}
7171
, secondPackage :
7272
{ outline : Outline
7373
, rootSources : Dict String Compiler.Backend.SourceFile
74-
, dependencies : Dict String { outline : Outline.PkgOutline, sources : Dict String String }
74+
, dependencies : Dict String { path : Path, outline : Outline.PkgOutline, sources : Dict String String }
7575
}
7676
}
7777

src/Terminal/PackageInstall.gren

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ type alias PackageResolution =
6767
{ projectPath : Path
6868
, outline : Outline
6969
, rootSources : Dict String Compiler.Backend.SourceFile
70-
, dependencies : Dict String { outline : Outline.PkgOutline, sources : Dict String String }
70+
, dependencies : Dict String { path : Path, outline : Outline.PkgOutline, sources : Dict String String }
7171
, didDownload : Bool
7272
}
7373

@@ -173,7 +173,8 @@ run config { projectPath, outline } =
173173
loadedPackages =
174174
Dict.map
175175
(\_name pkg ->
176-
{ outline = pkg.outline
176+
{ path = pkg.path
177+
, outline = pkg.outline
177178
, sources = pkg.sources
178179
}
179180
)
@@ -282,7 +283,7 @@ type alias StepOptions =
282283
, startedDownload : Bool
283284
, rootPackages : Array { name : PackageName, version : SemanticVersionRange }
284285
, rootPackageConstraints : Dict String (Outline.VersionConstraint SemanticVersionRange)
285-
, loadedPackages : Dict String { outline : Outline.PkgOutline, sources : Dict String String }
286+
, loadedPackages : Dict String { path : Path, outline : Outline.PkgOutline, sources : Dict String String }
286287
, solvedPackages : Dict String Compiler.Dependencies.SimplifiedOutline
287288
}
288289

@@ -383,7 +384,8 @@ installStep config opts =
383384
acc
384385
|> Task.andThen
385386
(\_ ->
386-
FileSystem.realPath config.fsPermission path
387+
Path.join [ loadedPackage.path, path ]
388+
|> FileSystem.realPath config.fsPermission
387389
|> Task.mapError
388390
(\err ->
389391
PackageInstallFileSystemError
@@ -446,7 +448,7 @@ installStep config opts =
446448
| loadedPackages =
447449
Dict.set
448450
(PackageName.toString name)
449-
{ outline = pkg.outline, sources = pkg.sources }
451+
{ path = pkg.path, outline = pkg.outline, sources = pkg.sources }
450452
opts.loadedPackages
451453
}
452454
)
@@ -521,6 +523,7 @@ installStep config opts =
521523
files
522524
in
523525
{ name = name
526+
, path = repoPath
524527
, outline = packageOutline
525528
, sources = sources
526529
, data =
@@ -594,7 +597,7 @@ installStep config opts =
594597
|> PP.toString
595598
|> Stream.Log.line config.stdout
596599
)
597-
|> Task.map (\_ -> pkg)
600+
|> Task.map (\_ -> { pkg | path = bundlePath })
598601
)
599602
|> Task.map
600603
(\pkg ->
@@ -603,7 +606,7 @@ installStep config opts =
603606
, loadedPackages =
604607
Dict.set
605608
(PackageName.toString name)
606-
{ outline = pkg.outline, sources = pkg.sources }
609+
{ path = pkg.path, outline = pkg.outline, sources = pkg.sources }
607610
opts.loadedPackages
608611
}
609612
)
@@ -615,7 +618,7 @@ installStep config opts =
615618
Task.fail <| PackageInstallConflict
616619
{ package = conflict.name
617620
, version1 = conflict.version1
618-
, version2 = conflict.version2
621+
, version2 = conflict.version2
619622
}
620623

621624

src/Terminal/PackageValidate.gren

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,12 @@ type alias Result =
7474
Maybe
7575
{ outline : Outline
7676
, rootSources : Dict String Compiler.Backend.SourceFile
77-
, dependencies : Dict String { outline : Outline.PkgOutline, sources : Dict String String }
77+
, dependencies : Dict String { path : Path, outline : Outline.PkgOutline, sources : Dict String String }
7878
}
7979
, currentVersion :
8080
{ outline : Outline
8181
, rootSources : Dict String Compiler.Backend.SourceFile
82-
, dependencies : Dict String { outline : Outline.PkgOutline, sources : Dict String String }
82+
, dependencies : Dict String { path : Path, outline : Outline.PkgOutline, sources : Dict String String }
8383
}
8484
}
8585

0 commit comments

Comments
 (0)