Skip to content

Instantly share code, notes, and snippets.

@jix
Created January 18, 2019 20:11
Show Gist options
  • Save jix/4342dd522a7125a2803c6edeedd8735c to your computer and use it in GitHub Desktop.
Save jix/4342dd522a7125a2803c6edeedd8735c to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import os
import sys
argv = sys.argv[1:]
try:
pkg_name = os.environ['CARGO_PKG_NAME']
except KeyError:
pass
else:
if pkg_name == 'proptest':
try:
pos = list(zip(argv, argv[1:])).index(('-C', 'link-dead-code'))
except ValueError:
pass
else:
argv[pos:pos + 2] = []
os.execv('/usr/bin/env', ['env', 'rustc'] + argv)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment