Patchwork [5,of,6,V2] rust: making runnable without LD_LIBRARY_PATH

login
register
mail settings
Submitter Georges Racinet
Date Oct. 9, 2018, 3:22 p.m.
Message ID <c5b4c3dd622ec7636eb7.1539098569@purity.tombe.racinet.fr>
Download mbox | patch
Permalink /patch/35580/
State Superseded
Headers show

Comments

Georges Racinet - Oct. 9, 2018, 3:22 p.m.
# HG changeset patch
# User Georges Racinet <gracinet@anybox.fr>
# Date 1538059603 -7200
#      Thu Sep 27 16:46:43 2018 +0200
# Node ID c5b4c3dd622ec7636eb78211b06cf86bb547444f
# Parent  210cd79d35d50e989a7eabbcebb4addde9365f9e
# EXP-Topic rustancestors-rfc
rust: making runnable without LD_LIBRARY_PATH

Building the Rust code as a static library makes
setup.py link it within parsers.so, so that
this Rust enhanced proof-of-concept can be tested,
benched etc with no modification of tooling, besides
the need for a working rustc/cargo (ususally also
involving GitHub access).

In the long run, a better runtime linking solution
should probably be investigated. Notably, if we needed
to enhance several extensions with Rust, then this
staticlib hack would result in a copy of the Rust
standard libraries in each produced extension.

Patch

diff -r 210cd79d35d5 -r c5b4c3dd622e mercurial/rust/Cargo.toml
--- a/mercurial/rust/Cargo.toml	Thu Sep 27 16:55:44 2018 +0200
+++ b/mercurial/rust/Cargo.toml	Thu Sep 27 16:46:43 2018 +0200
@@ -7,4 +7,4 @@ 
 libc = "*"
 
 [lib]
-crate-type = ["dylib"]
+crate-type = ["staticlib"]