pfitzseb / GithubMarkdown.jl

MIT License
6 stars 2 forks source link

Loading package sets global LD_LIBRARY_PATH #7

Closed mortenpi closed 1 year ago

mortenpi commented 1 year ago

The check_deps function from deps/deps.jl (generated by BinaryProvider) has the following line:

ENV["LD_LIBRARY_PATH"] = join(filter(!isempty, libpaths), ":")

This has obvious bad consequences for any Julia sessions that try to run external programs.

I guess the correct solution here would be to use BB products anyway. Or is this package more or less deprecated?

Full deps.jl ```julia ## This file autogenerated by BinaryProvider.write_deps_file(). ## Do not edit. ## ## Include this file within your main top-level source, and call ## `check_deps()` from within your module's `__init__()` method if isdefined((@static VERSION < v"0.7.0-DEV.484" ? current_module() : @__MODULE__), :Compat) import Compat.Libdl elseif VERSION >= v"0.7.0-DEV.3382" import Libdl end const libgfm_extensions = joinpath(dirname(@__FILE__), "usr/lib/libcmark-gfm-extensions.so") const libgfm = joinpath(dirname(@__FILE__), "usr/lib/libcmark-gfm-extensions.so") const gfm = joinpath(dirname(@__FILE__), "usr/bin/cmark-gfm") function check_deps() global libgfm_extensions if !isfile(libgfm_extensions) error("$(libgfm_extensions) does not exist, Please re-run Pkg.build(\"GithubMarkdown\"), and restart Julia.") end if Libdl.dlopen_e(libgfm_extensions) in (C_NULL, nothing) error("$(libgfm_extensions) cannot be opened, Please re-run Pkg.build(\"GithubMarkdown\"), and restart Julia.") end global libgfm if !isfile(libgfm) error("$(libgfm) does not exist, Please re-run Pkg.build(\"GithubMarkdown\"), and restart Julia.") end if Libdl.dlopen_e(libgfm) in (C_NULL, nothing) error("$(libgfm) cannot be opened, Please re-run Pkg.build(\"GithubMarkdown\"), and restart Julia.") end global gfm if !isfile(gfm) error("$(gfm) does not exist, Please re-run Pkg.build(\"GithubMarkdown\"), and restart Julia.") end libpaths = split(get(ENV, "LD_LIBRARY_PATH", ""), ":") if !("/home/mortenpi/.julia/juliaup/julia-1.8.4+0.x64.linux.gnu/bin/../lib/julia" in libpaths) push!(libpaths, "/home/mortenpi/.julia/juliaup/julia-1.8.4+0.x64.linux.gnu/bin/../lib/julia") end ENV["LD_LIBRARY_PATH"] = join(filter(!isempty, libpaths), ":") end ```
pfitzseb commented 1 year ago

It's not, but we should switch it to use one of the gfm artifacts in Yggdrasil.