You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix local dependencies of dependencies of local dependencies (#870)
* fix local dependencies of dependencies of local dependencies
* add changelog
* move some prints to trace
* remove `logger.` from debug or trace calls
* commit missing changes
* Update CHANGELOG.md
Co-authored-by: Robrecht Cannoodt <robrecht@data-intuitive.com>
* fix passing relative paths causing issues with dependency resolution
* add local dependencies in the mix for the testbench
* add helper methods to reduce boilerplate code
* remove debug code
---------
Co-authored-by: Robrecht Cannoodt <robrecht@data-intuitive.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,8 @@
7
7
*`Nextflowrunner`: fix publishing of directories when the output file name template contains a trailing slash (PR #867).
8
8
9
9
*`Logging`: Reduce log level for fetching repositories from info to debug (PR #871).
10
+
*
11
+
*`Dependencies`: Fix an edge case during dependency resolving (PR #870). Local dependencies of dependencies of local dependencies were resolved incorrectly and resulted in a wrongly resolved destination path.
10
12
11
13
# Viash 0.9.6 (2025-10-10): Hotfix for dependency path resolution
require(alias.get.matches("^[A-Za-z][A-Za-z0-9_]*$"), message =f"alias '${alias.get}' must begin with a letter and consist only of alphanumeric characters or underscores.")
@@ -124,12 +124,14 @@ case class Dependency(
124
124
if (isLocalDependency) {
125
125
// Local dependency so it will only exist once the component is built.
126
126
// TODO improve this, for one, the runner id should be dynamic
127
+
debug("getRelativePath: isLocalDependency is true, using ViashNamespace to determine the path")
// This is empty if we're resolving the first level of dependencies.
166
171
// For the most part we should not end up here, but there is an edge case where we have to resolve a local dependency for a dependency of a dependency.
167
172
// In this case, we don't have the context of the location where the dependency is stored under the dependency folder, however we know where the dependant is stored,
168
173
// so we can use the remote local dependency resolver to find the source path.
169
-
logger.debug(s"Couldn't find sourcePath, using remote local dependency resolver for $dependencyPath")
170
-
logger.debug(s"Remote local dependency resolver: $remoteLocalDependencyResolver")
174
+
debug(s"Couldn't find sourcePath, using remote local dependency resolver for $dependencyPath")
175
+
debug(s"Remote local dependency resolver: $remoteLocalDependencyResolver")
171
176
valalternativeSourcePath= remoteLocalDependencyResolver.get._1 // This is the path where the dependant is located
172
-
valalternativeTargetPath= remoteLocalDependencyResolver.get._2// This is the relative path of the dependant in the target folder
177
+
valalternativeTargetPath= remoteLocalDependencyResolver.get._3// This is the relative path of the dependant in the target folder
173
178
174
179
// strips alternativeTargetPath from dependencyPath
175
180
// ie. `target` from `target/foo/bar` so that it can be added to alternativeSourcePath as it doesn't contain the `target` folder anymore at this point
// Handle dependencies of dependencies. For a given already built component, get their dependencies, copy them to our new target folder and recurse into these.
valrightPath= commonParts.flatMap(_._2).reverse.reduceOption((p1, p2) => p1.resolve(p2)).getOrElse(Paths.get("")) // if there is no right part, use empty path
valrightPath= commonSourceParts.flatMap(_._2).reverse.reduceOption((p1, p2) => p1.resolve(p2)).getOrElse(Paths.get("")) // if there is no right part, use empty path
0 commit comments