-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Use cargo-kconv to install kconv, upload to coveralls - Add script to workaround ICE in rustc when building proptest with '-C link-dead-code'
- Loading branch information
1 parent
4b910e3
commit e975cee
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env python3 | ||
# | ||
# This script modifies calls to rustc such that the '-C link-dead-code' | ||
# compiler option is not passed only when building the proptest crate. | ||
# The link-dead-code option is necessary for accurate code coverage. | ||
# When https://github.com/rust-lang/rust/issues/52478 is fixed, or proptest is | ||
# modified to somehow not trigger the bug, this script can be deleted, and the | ||
# travis config updated. | ||
|
||
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) |