Skip to content

Fix CI #582

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ci/run-docker.sh
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ run() {
--volume `pwd`/target:/checkout/target \
--workdir /checkout \
--privileged \
--env RUSTFLAGS \
--env RUSTFLAGS="-Lnative=/usr/lib/x86_64-linux-musl/" \
backtrace \
bash \
-c 'PATH=$PATH:/rust/bin exec ci/run.sh'
6 changes: 3 additions & 3 deletions src/print/fuchsia.rs
Original file line number Diff line number Diff line change
@@ -336,7 +336,7 @@ fn get_build_id<'a>(info: &'a dl_phdr_info) -> Option<&'a [u8]> {
enum Error {
/// NameError means that an error occurred while converting a C style string
/// into a rust string.
NameError(core::str::Utf8Error),
NameError,
/// BuildIDError means that we didn't find a build ID. This could either be
/// because the DSO had no build ID or because the segment containing the
/// build ID was malformed.
@@ -362,8 +362,8 @@ fn for_each_dso(mut visitor: &mut DsoPrinter<'_, '_>) {
unsafe { core::slice::from_raw_parts(info.name as *const u8, name_len) };
let name = match core::str::from_utf8(name_slice) {
Ok(name) => name,
Err(err) => {
return visitor.error(Error::NameError(err)) as i32;
Err(_) => {
return visitor.error(Error::NameError) as i32;
}
};
let build_id = match get_build_id(info) {
2 changes: 1 addition & 1 deletion src/windows.rs
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
//! This module largely exists to integrate into libstd itself where winapi is
//! not currently available.

#![allow(bad_style, dead_code)]
#![allow(bad_style, dead_code, unused)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It kinda feels like we should cfg this code properly rather than allowing unused and dead_code but that's an existing issue, so fair enough.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. I can clean this up in another PR maybe? I just poked through this and I think I've convinced myself that I can hack on this in this repo and not break rust-lang/rust's module use of it. I was worried about that somehow relying on visibility.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took a crack at this and decided I don't have the patience to untangle all the ways that things get used to not used based on the numerous cfgs that this crate is compiled with.


cfg_if::cfg_if! {
if #[cfg(feature = "verify-winapi")] {
15 changes: 5 additions & 10 deletions tests/current-exe-mismatch.rs
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ fn main() {
Ok(()) => {
println!("test result: ok");
}
Err(EarlyExit::IgnoreTest(_)) => {
Err(EarlyExit::IgnoreTest) => {
println!("test result: ignored");
}
Err(EarlyExit::IoError(e)) => {
@@ -34,7 +34,7 @@ const VAR: &str = "__THE_TEST_YOU_ARE_LUKE";

#[derive(Debug)]
enum EarlyExit {
IgnoreTest(String),
IgnoreTest,
IoError(std::io::Error),
}

@@ -47,7 +47,7 @@ impl From<std::io::Error> for EarlyExit {
fn parent() -> Result<(), EarlyExit> {
// If we cannot re-exec this test, there's no point in trying to do it.
if common::cannot_reexec_the_test() {
return Err(EarlyExit::IgnoreTest("(cannot reexec)".into()));
return Err(EarlyExit::IgnoreTest);
}

let me = std::env::current_exe().unwrap();
@@ -111,7 +111,7 @@ fn find_interpreter(me: &Path) -> Result<PathBuf, EarlyExit> {
.arg("-l")
.arg(me)
.output()
.map_err(|_err| EarlyExit::IgnoreTest("readelf invocation failed".into()))?;
.map_err(|_| EarlyExit::IgnoreTest)?;
if result.status.success() {
let r = BufReader::new(&result.stdout[..]);
for line in r.lines() {
@@ -124,11 +124,6 @@ fn find_interpreter(me: &Path) -> Result<PathBuf, EarlyExit> {
}
}
}

Err(EarlyExit::IgnoreTest(
"could not find interpreter from readelf output".into(),
))
} else {
Err(EarlyExit::IgnoreTest("readelf returned non-success".into()))
}
Err(EarlyExit::IgnoreTest)
}