Commit ff6f9d7f authored by Mike Hommey's avatar Mike Hommey
Browse files

Bug 1738133 - Undo workaround for...

Bug 1738133 - Undo workaround for https://github.com/rust-lang/rust/issues/88576. r=firefox-build-system-reviewers,nalexander

Differential Revision: https://phabricator.services.mozilla.com/D133015
parent aaa57dd9
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -5767,6 +5767,8 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
[[package]]
name = "winapi-util"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
dependencies = [
 "winapi",
]
+0 −4
Original line number Diff line number Diff line
@@ -109,7 +109,3 @@ path = "third_party/rust/mio-0.6.23"

[patch.crates-io.prost-derive]
path = "third_party/rust/prost-derive"

# Patched to work around https://github.com/rust-lang/rust/issues/88576
[patch.crates-io.winapi-util]
path = "third_party/rust/winapi-util"
+15 −2
Original line number Diff line number Diff line
@@ -153,10 +153,10 @@ def cargo_info(cargo):
    )


@depends(rustc_info, cargo_info)
@depends(rustc_info, cargo_info, target)
@imports(_from="mozboot.util", _import="MINIMUM_RUST_VERSION")
@imports(_from="textwrap", _import="dedent")
def rust_compiler(rustc_info, cargo_info):
def rust_compiler(rustc_info, cargo_info, target):
    if not rustc_info:
        die(
            dedent(
@@ -203,6 +203,19 @@ def rust_compiler(rustc_info, cargo_info):
            )
        )

    if target.kernel == "WINNT" and (version.major, version.minor) == (1, 56):
        die(
            dedent(
                """\
        Rust compiler 1.56.* is not supported for Windows builds.

        Use a newer or an older version.

        See https://github.com/rust-lang/rust/issues/88576.
        """
            )
        )

    if not cargo_info:
        die(
            dedent(
+3 −10
Original line number Diff line number Diff line
@@ -101,16 +101,13 @@ struct HandleRefInner(Option<File>);

impl Drop for HandleRefInner {
    fn drop(&mut self) {
        self.0.take().map(|f| f.into_raw_handle());
        self.0.take().unwrap().into_raw_handle();
    }
}

impl AsRawHandle for HandleRef {
    fn as_raw_handle(&self) -> RawHandle {
        match (self.0).0.as_ref() {
            Some(f) => f.as_raw_handle(),
            None => std::ptr::null_mut(),
        }
        self.as_file().as_raw_handle()
    }
}

@@ -162,11 +159,7 @@ impl HandleRef {
    /// is a valid handle. The caller must ensure this is true before invoking
    /// this constructor.
    pub unsafe fn from_raw_handle(handle: RawHandle) -> HandleRef {
        HandleRef(HandleRefInner(if handle.is_null() {
            None
        } else {
            Some(File::from_raw_handle(handle))
        }))
        HandleRef(HandleRefInner(Some(File::from_raw_handle(handle))))
    }

    /// Return this handle as a standard `File` reference.