Skip to content

Commit e887198

Browse files
authored
Merge pull request #12 from staticfloat/sf/canonical_dirs
Ensure that directories always end in `'/'` for `canonical_rpaths()`
2 parents 9f6944e + 158bb02 commit e887198

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ os:
44
- linux
55
- osx
66
julia:
7-
- 0.7
7+
- 1.0
88
- nightly
99
notifications:
1010
email: false

src/Abstract/DynamicLink.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ function canonical_rpaths(rpath::RPath)
130130
paths[idx] = replace(paths[idx], "@loader_path" => origin)
131131
paths[idx] = replace(paths[idx], "@executable_path" => origin)
132132
paths[idx] = abspath(paths[idx])
133+
134+
# Make sure that if it's a directory, it _always_ has a "/" at the end.
135+
if isdir(paths[idx]) && paths[idx][end] != '/'
136+
paths[idx] = paths[idx] * "/"
137+
end
133138
end
134139
return paths
135140
end

src/COFF/COFFDynamicLink.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,5 @@ rpaths(crp::COFFRPath) = String[]
7171

7272
# COFF files don't have an RPath, but they _do_ always search the $ORIGIN
7373
function canonical_rpaths(crp::COFFRPath)
74-
return [dirname(path(handle(crp)))]
74+
return [abspath(dirname(path(handle(crp))) * "/")]
7575
end

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function test_libfoo_and_fooifier(fooifier_path, libfoo_path)
4646
# Ensure that `dir_path` is one of the RPath entries
4747
rpath = RPath(oh_exe)
4848
can_paths = canonical_rpaths(rpath)
49-
@test abspath(dir_path) in can_paths
49+
@test abspath(dir_path * "/") in can_paths
5050

5151
# Ensure that `fooifier` is going to try to load `libfoo`:
5252
foo_libs = find_libraries(oh_exe)

0 commit comments

Comments
 (0)