Pros: Ability to use Rust libraries from crates.io Problems: Need to lock library versions and document their reproducible building, either via Cargo.lock or vendoring.
		
			
				
	
	
		
			15 lines
		
	
	
		
			218 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
		
			218 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
#!/bin/sh
 | 
						|
set -e
 | 
						|
 | 
						|
export CARGO_TARGET_DIR=`pwd`
 | 
						|
if [ ! -z ${2} ]; then
 | 
						|
    OUT_PATH=`realpath "${2}"`
 | 
						|
fi
 | 
						|
 | 
						|
cd $1
 | 
						|
cargo $3 -p rs
 | 
						|
 | 
						|
if [ ! -z ${OUT_PATH} ]; then
 | 
						|
    cp "${CARGO_TARGET_DIR}"/debug/librs.a "${OUT_PATH}"
 | 
						|
fi
 |