@@ -24,6 +24,10 @@ pub enum FromEnvErrorKind {
24
24
CannotOpenPath ,
25
25
/// Cannot open file descriptor from the jobserver environment variable value.
26
26
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 ,
27
31
/// File descriptor from the jobserver environment variable value is not a pipe.
28
32
NotAPipe ,
29
33
/// Jobserver inheritance is not supported on this platform.
@@ -39,6 +43,7 @@ impl FromEnvError {
39
43
FromEnvErrorInner :: CannotParse ( _) => FromEnvErrorKind :: CannotParse ,
40
44
FromEnvErrorInner :: CannotOpenPath ( ..) => FromEnvErrorKind :: CannotOpenPath ,
41
45
FromEnvErrorInner :: CannotOpenFd ( ..) => FromEnvErrorKind :: CannotOpenFd ,
46
+ FromEnvErrorInner :: NegativeFd ( ..) => FromEnvErrorKind :: NegativeFd ,
42
47
FromEnvErrorInner :: NotAPipe ( ..) => FromEnvErrorKind :: NotAPipe ,
43
48
FromEnvErrorInner :: Unsupported => FromEnvErrorKind :: Unsupported ,
44
49
}
@@ -53,6 +58,7 @@ impl std::fmt::Display for FromEnvError {
53
58
FromEnvErrorInner :: CannotParse ( s) => write ! ( f, "cannot parse jobserver environment variable value: {s}" ) ,
54
59
FromEnvErrorInner :: CannotOpenPath ( s, err) => write ! ( f, "cannot open path or name {s} from the jobserver environment variable value: {err}" ) ,
55
60
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" ) ,
56
62
FromEnvErrorInner :: NotAPipe ( fd, None ) => write ! ( f, "file descriptor {fd} from the jobserver environment variable value is not a pipe" ) ,
57
63
FromEnvErrorInner :: NotAPipe ( fd, Some ( err) ) => write ! ( f, "file descriptor {fd} from the jobserver environment variable value is not a pipe: {err}" ) ,
58
64
FromEnvErrorInner :: Unsupported => write ! ( f, "jobserver inheritance is not supported on this platform" ) ,
@@ -79,6 +85,7 @@ pub(crate) enum FromEnvErrorInner {
79
85
CannotParse ( String ) ,
80
86
CannotOpenPath ( String , std:: io:: Error ) ,
81
87
CannotOpenFd ( RawFd , std:: io:: Error ) ,
88
+ NegativeFd ( RawFd ) ,
82
89
NotAPipe ( RawFd , Option < std:: io:: Error > ) ,
83
90
Unsupported ,
84
91
}
0 commit comments