@@ -7,6 +7,33 @@ function find_prev_tag(tag)
7
7
return get (tags, idx - 1 , " NO-PREV-TAG" )
8
8
end
9
9
10
+ # modify build-tmp.jl to only check correct version libs
11
+ function install_products_filter (build_file)
12
+ prod_filter = raw """ products = filter(products) do prod
13
+ endswith(prod.libnames[1], "$(VERSION.major)_$(VERSION.minor)")
14
+ end
15
+ """
16
+ lines = open (build_file) do io
17
+ read (io, String) |> x -> split (x, " \n " )
18
+ end
19
+ prod_in, prod_out, filter_written = false , false , false
20
+ open (build_file, " w" ) do io
21
+ for line in lines
22
+ if occursin (" products = [" , line)
23
+ prod_in = true
24
+ end
25
+ if prod_in && line == " ]"
26
+ prod_out = true
27
+ end
28
+ write (io, line * " \n " )
29
+ if prod_out && ! filter_written
30
+ write (io, prod_filter * " \n " )
31
+ filter_written = true
32
+ end
33
+ end
34
+ end
35
+ end
36
+
10
37
function include_build_script (version_str, try_prev= false )
11
38
build_script_url = " https://github.com/TuringLang/Libtask.jl/releases/download/v$(version_str) /build_LibtaskDylib.v$(version_str) .jl"
12
39
build_script = joinpath (@__DIR__ , " tmp-build.jl" )
@@ -15,6 +42,7 @@ function include_build_script(version_str, try_prev=false)
15
42
version_str = find_prev_tag (" v$version_str " ) |> strip |> (x) -> lstrip (x, [' v' ])
16
43
return include_build_script (version_str, false )
17
44
end
45
+ install_products_filter (build_script)
18
46
include (build_script)
19
47
end
20
48
@@ -30,20 +58,5 @@ function get_version_str()
30
58
end
31
59
end
32
60
33
- function remove_dlopen ()
34
- lines = open (joinpath (@__DIR__ , " deps.jl" )) do io
35
- read (io, String) |> x -> split (x, " \n " )
36
- end
37
- open (joinpath (@__DIR__ , " deps.jl" ), " w" ) do io
38
- for line in lines
39
- if occursin (" if Libdl.dlopen_e(" , line)
40
- line = " if false"
41
- end
42
- write (io, line * " \n " )
43
- end
44
- end
45
- end
46
-
47
61
version_str = get_version_str () |> strip |> (x) -> lstrip (x, [' v' ])
48
62
include_build_script (version_str, true )
49
- remove_dlopen ()
0 commit comments