Bug 216514 - rpcgen leaves broken output file if ${CPP} not found
Summary: rpcgen leaves broken output file if ${CPP} not found
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-27 03:02 UTC by Ed Maste
Modified: 2017-01-27 03:02 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Maste freebsd_committer freebsd_triage 2017-01-27 03:02:11 UTC
As a result of a misconfigured external toolchain I ended up with ${CPP} set to a nonexistent file. In this case rpcgen creates a broken output file before exiting with an error, and subsequent builds do not try to rebuild it.

rpcgen should either not create the output file early (e.g., by writing to a temporary and renaming on success), or delete it on error.

(Root cause of this issue was an old, mismatched mips64-xtoolchain-gcc.)

Reproduction steps:
% touch foo.h
% RPCGEN_CPP=does-not-exist rpcgen -C -h foo.h -o foo.out
rpcgen: execvp does-not-exist: No such file or directory
% echo $?
1
% ls -l foo.out
-rw-r--r--  1 emaste  emaste  240 26 Jan 21:52 foo.out