Skip to content
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

Dependency: Change format for path-based dependencies #2316

Merged
merged 2 commits into from
Jul 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions source/dub/dependency.d
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,16 @@ struct Dependency {
if (!repository.empty) {
ret ~= repository.toString~"#";
}
ret ~= versionSpec;
if (path.empty)
ret ~= versionSpec;
if (optional) {
if (default_) ret ~= " (optional, default)";
else ret ~= " (optional)";
}

// NOTE Path is @system in vibe.d 0.7.x and in the compatibility layer
() @trusted {
if (!path.empty) ret ~= " @"~path.toNativeString();
if (!path.empty) ret ~= "@"~path.toNativeString();
} ();

return ret;
Expand Down
2 changes: 1 addition & 1 deletion source/dub/internal/vibecompat/inet/path.d
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ struct NativePath {
@property size_t length() const scope @safe pure nothrow @nogc { return m_nodes.length; }

/// True if the path contains no entries
@property bool empty() const { return m_nodes.length == 0; }
@property bool empty() const scope @safe pure nothrow @nogc { return m_nodes.length == 0; }

/// Determines if the path ends with a slash (i.e. is a directory)
@property bool endsWithSlash() const { return m_endsWithSlash; }
Expand Down
2 changes: 1 addition & 1 deletion test/expected-issue1037-output
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Unresolvable dependencies to package gitcompatibledubpackage:
b >=0.0.0 @DIR/b depends on gitcompatibledubpackage ~>1.0.2
b @DIR/b depends on gitcompatibledubpackage ~>1.0.2
issue1037-better-dependency-messages ~master depends on gitcompatibledubpackage 1.0.1