@@ -24,6 +24,10 @@ pub enum FromEnvErrorKind {
2424 CannotOpenPath ,
2525 /// Cannot open file descriptor from the jobserver environment variable value.
2626 CannotOpenFd ,
27+ /// The jobserver style is a simple pipe, but at least one of the file descriptors
28+ /// is negative, which means it is disabled for this process
29+ /// ([GNU `make` manual: POSIX Jobserver Interaction](https://www.gnu.org/software/make/manual/make.html#POSIX-Jobserver)).
30+ NegativeFd ,
2731 /// File descriptor from the jobserver environment variable value is not a pipe.
2832 NotAPipe ,
2933 /// Jobserver inheritance is not supported on this platform.
@@ -39,6 +43,7 @@ impl FromEnvError {
3943 FromEnvErrorInner :: CannotParse ( _) => FromEnvErrorKind :: CannotParse ,
4044 FromEnvErrorInner :: CannotOpenPath ( ..) => FromEnvErrorKind :: CannotOpenPath ,
4145 FromEnvErrorInner :: CannotOpenFd ( ..) => FromEnvErrorKind :: CannotOpenFd ,
46+ FromEnvErrorInner :: NegativeFd ( ..) => FromEnvErrorKind :: NegativeFd ,
4247 FromEnvErrorInner :: NotAPipe ( ..) => FromEnvErrorKind :: NotAPipe ,
4348 FromEnvErrorInner :: Unsupported => FromEnvErrorKind :: Unsupported ,
4449 }
@@ -53,6 +58,7 @@ impl std::fmt::Display for FromEnvError {
5358 FromEnvErrorInner :: CannotParse ( s) => write ! ( f, "cannot parse jobserver environment variable value: {s}" ) ,
5459 FromEnvErrorInner :: CannotOpenPath ( s, err) => write ! ( f, "cannot open path or name {s} from the jobserver environment variable value: {err}" ) ,
5560 FromEnvErrorInner :: CannotOpenFd ( fd, err) => write ! ( f, "cannot open file descriptor {fd} from the jobserver environment variable value: {err}" ) ,
61+ FromEnvErrorInner :: NegativeFd ( fd) => write ! ( f, "file descriptor {fd} from the jobserver environment variable value is negative" ) ,
5662 FromEnvErrorInner :: NotAPipe ( fd, None ) => write ! ( f, "file descriptor {fd} from the jobserver environment variable value is not a pipe" ) ,
5763 FromEnvErrorInner :: NotAPipe ( fd, Some ( err) ) => write ! ( f, "file descriptor {fd} from the jobserver environment variable value is not a pipe: {err}" ) ,
5864 FromEnvErrorInner :: Unsupported => write ! ( f, "jobserver inheritance is not supported on this platform" ) ,
@@ -79,6 +85,7 @@ pub(crate) enum FromEnvErrorInner {
7985 CannotParse ( String ) ,
8086 CannotOpenPath ( String , std:: io:: Error ) ,
8187 CannotOpenFd ( RawFd , std:: io:: Error ) ,
88+ NegativeFd ( RawFd ) ,
8289 NotAPipe ( RawFd , Option < std:: io:: Error > ) ,
8390 Unsupported ,
8491}
0 commit comments