@@ -7,6 +7,33 @@ function find_prev_tag(tag)
77 return get (tags, idx - 1 , " NO-PREV-TAG" )
88end
99
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+
1037function include_build_script (version_str, try_prev= false )
1138 build_script_url = " https://github.com/TuringLang/Libtask.jl/releases/download/v$(version_str) /build_LibtaskDylib.v$(version_str) .jl"
1239 build_script = joinpath (@__DIR__ , " tmp-build.jl" )
@@ -15,6 +42,7 @@ function include_build_script(version_str, try_prev=false)
1542 version_str = find_prev_tag (" v$version_str " ) |> strip |> (x) -> lstrip (x, [' v' ])
1643 return include_build_script (version_str, false )
1744 end
45+ install_products_filter (build_script)
1846 include (build_script)
1947end
2048
@@ -30,20 +58,5 @@ function get_version_str()
3058 end
3159end
3260
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-
4761version_str = get_version_str () |> strip |> (x) -> lstrip (x, [' v' ])
4862include_build_script (version_str, true )
49- remove_dlopen ()
0 commit comments