Skip to content

Commit 66355c5

Browse files
author
Christopher Doris
committed
let condapkg handle libstdcxx-ng compat
1 parent d57a52c commit 66355c5

File tree

3 files changed

+5
-69
lines changed

3 files changed

+5
-69
lines changed

CondaPkg.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11

2+
[deps.libstdcxx-ng]
3+
channel = "conda-forge"
4+
version = "<=julia"
5+
26
[deps.python]
37
channel = "conda-forge"
48
build = "*cpython*"

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
1717
UnsafePointers = "e17b2a0c-0bdf-430a-bd0c-3a23cae4ff39"
1818

1919
[compat]
20-
CondaPkg = "0.2.12"
20+
CondaPkg = "0.2.15"
2121
MacroTools = "0.5"
2222
Requires = "1"
2323
Tables = "1"

src/cpython/context.jl

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -30,66 +30,6 @@ function _atpyexit()
3030
return
3131
end
3232

33-
# By default, ensure libstdc++ in the Conda environment is compatible with
34-
# the one linked in Julia. This is platform/version dependent, so needs to
35-
# occur at runtime.
36-
#
37-
# The following lists the mapping from GLIBCXX versions to GCC versions.
38-
# Start with GCC 4.8, as it's extremely difficult to build Julia with anything older.
39-
# See https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html.
40-
# See https://gcc.gnu.org/develop.html#timeline.
41-
# 3.4.18 => 4.8.0 - 4.8.2
42-
# 3.4.19 => 4.8.3 - 4.8.5
43-
# 3.4.20 => 4.9.0 - 4.9.4
44-
# 3.4.21 => 5.1.0 - 5.5.0
45-
# 3.4.22 => 6.1.0 - 6.5.0
46-
# 3.4.23 => 7.1.0 - 7.1.0
47-
# 3.4.24 => 7.2.0 - 7.5.0
48-
# 3.4.25 => 8.1.0 - 8.5.0
49-
# 3.4.26 => 9.1.0 - 9.1.0
50-
# 3.4.27 => 9.2.0 - 9.2.0
51-
# 3.4.28 => 9.3.0 - 10.4.0
52-
# 3.4.29 => 11.1.0 - 11.3.0
53-
# 3.4.30 => 12.1.0 - 12.2.0
54-
# 3.4.31 => 13.1.0 - 13.1.0
55-
function get_libstdcxx_version_bound()
56-
bound = get(ENV, "JULIA_PYTHONCALL_LIBSTDCXX_VERSION_BOUND", "")
57-
if bound != ""
58-
return bound
59-
end
60-
loaded_libstdcxx_version = Base.BinaryPlatforms.detect_libstdcxx_version()
61-
if loaded_libstdcxx_version === nothing
62-
return nothing
63-
elseif loaded_libstdcxx_version v"3.4.31"
64-
bound = "13.1"
65-
elseif loaded_libstdcxx_version v"3.4.30"
66-
bound = "12.2"
67-
elseif loaded_libstdcxx_version v"3.4.29"
68-
bound = "11.3"
69-
elseif loaded_libstdcxx_version v"3.4.28"
70-
bound = "10.4"
71-
elseif loaded_libstdcxx_version v"3.4.27"
72-
bound = "9.2"
73-
elseif loaded_libstdcxx_version v"3.4.26"
74-
bound = "9.1"
75-
elseif loaded_libstdcxx_version v"3.4.25"
76-
bound = "8.5"
77-
elseif loaded_libstdcxx_version v"3.4.24"
78-
bound = "7.5"
79-
elseif loaded_libstdcxx_version v"3.4.23"
80-
bound = "7.1"
81-
elseif loaded_libstdcxx_version v"3.4.22"
82-
bound = "6.5"
83-
elseif loaded_libstdcxx_version v"3.4.21"
84-
bound = "5.5"
85-
elseif loaded_libstdcxx_version v"3.4.20"
86-
bound = "4.9"
87-
else
88-
bound = "4.8"
89-
end
90-
return ">=3.4,<=$bound"
91-
end
92-
9333
function init_context()
9434

9535
CTX.is_embedded = haskey(ENV, "JULIA_PYTHONCALL_LIBPTR")
@@ -119,14 +59,6 @@ function init_context()
11959
end
12060
exe_path::String
12161
else
122-
if Sys.islinux()
123-
cxx_version = get_libstdcxx_version_bound()
124-
if cxx_version !== nothing
125-
CondaPkg.add("libstdcxx-ng", version=cxx_version, channel="conda-forge", temp=true, file=joinpath(@__DIR__, "..", "..", "CondaPkg.toml"), resolve=false)
126-
end
127-
# if cxx_version is nothing, then we assume that Julia does not link against any version ob libstdc++ known by Julia, and so we do not
128-
# enforce a version bound.
129-
end
13062
# By default, we use Python installed by CondaPkg.
13163
exe_path = Sys.iswindows() ? joinpath(CondaPkg.envdir(), "python.exe") : joinpath(CondaPkg.envdir(), "bin", "python")
13264
# It's not sufficient to only activate the env while Python is initialising,

0 commit comments

Comments
 (0)