Skip to content

Commit e134fc5

Browse files
authored
Merge pull request #65 from oscar-system/bl/symlinks
2 parents ab7ba5a + 857b0bd commit e134fc5

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.01)
1+
cmake_minimum_required(VERSION 3.10)
22

33
project(libpolymake_julia)
44

include/jlpolymake/jlpolymake.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
#define JLPOLYMAKE_VERSION_MAJOR 0
4747
#define JLPOLYMAKE_VERSION_MINOR 14
48-
#define JLPOLYMAKE_VERSION_PATCH 0
48+
#define JLPOLYMAKE_VERSION_PATCH 2
4949

5050
#define __JLPOLYMAKE_STR_HELPER(x) #x
5151
#define __JLPOLYMAKE_STR(x) __JLPOLYMAKE_STR_HELPER(x)

src/polymake/generate_deps_tree.jl

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,18 @@ function full_artifact_dir(m::Module)
2424
end
2525
end
2626

27-
function force_symlink(source::AbstractString, target::AbstractString)
28-
tmpfile = tempname(dirname(target); cleanup=false)
29-
symlink(source, tmpfile)
30-
Base.Filesystem.rename(tmpfile, target)
27+
function force_symlink(target::AbstractString, link::AbstractString)
28+
# the rename operation below should be atomic and make sure the link always points
29+
# to a valid directory
30+
# but macos disagrees and sometimes reading files below this path fails with `EINVAL`
31+
# see also: http://www.weirdnet.nl/apple/rename.html
32+
# (it seems to be fixed on hfs+ but not on apfs...)
33+
# to reduce the frequency of this we only write the symlink if necessary
34+
# (note this does not fully avoid the error)
35+
islink(link) && readlink(link) == target && return
36+
tmpfile = tempname(dirname(link); cleanup=false)
37+
symlink(target, tmpfile)
38+
Base.Filesystem.rename(tmpfile, link)
3139
end
3240

3341
function prepare_deps_tree(targetdir::String)

src/polymake/type_setup.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ sub EdgeMap {
272272

273273
Map(String,String),
274274
Map(String,Int),
275+
Map(Int,String),
275276
Map(Int,Int),
276277
Map(Integer,Int),
277278
Map(Rational,Rational),

0 commit comments

Comments
 (0)