Skip to content

Regression 1.67.0: Static archives have different unix permissions than before #107495

Closed
@alexcrichton

Description

@alexcrichton

Given this code:

#[no_mangle]
pub extern "C" fn foo() {}

I get this output from rustc:

$ rustc +1.66.1 foo.rs --crate-type staticlib && ls -alh libfoo.a
-rw-r--r-- 1 acrichto acrichto 22M Jan 30 16:28 libfoo.a
$ rustc +1.67.0 foo.rs --crate-type staticlib && ls -alh libfoo.a
-rw------- 1 acrichto acrichto 22M Jan 30 16:28 libfoo.a

The most recent archive no longer has the "read" permission bit set for group/world owners. This ended up breaking Wasmtime's build because our files are built in a container with a different user and aren't then readable outside of the container. There's no particular reason we do this and we can work around this, but I also suspected that the change in permissions here probably wasn't intentional.

I think this is due to #97485 (cc @bjorn3), specifically this line. I haven't dug too deeply but my guess is that temp files specifically turn off other permission bits

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-linkageArea: linking into static, shared libraries and binariesT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions