Skip to content

Commit

Permalink
Add regression test for #107495
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed Mar 19, 2024
1 parent 91b87c4 commit 45cb9d8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/run-make/issue-107495-archive-permissions/foo.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

22 changes: 22 additions & 0 deletions tests/run-make/issue-107495-archive-permissions/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
extern crate run_make_support;

use run_make_support::{aux_build, out_dir};
use std::fs;
#[cfg(unix)]
use std::os::unix::fs::PermissionsExt;
use std::path::Path;

fn main() {
aux_build().arg("foo.rs").run();
verify(&out_dir().join("libfoo.rlib"));
}

fn verify(path: &Path) {
let perm = fs::metadata(path).unwrap().permissions();

assert!(!perm.readonly());

// Check that the file is readable for everyone
#[cfg(unix)]
assert_eq!(perm.mode(), 0o100664);
}

0 comments on commit 45cb9d8

Please sign in to comment.