Skip to content

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

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

Activity

  1. bjorn3 commented on Jan 31, 2023

    @bjorn3
    Member

    #107360 reverted back to the LLVM archive writer to fix another regression. Still I think this issuw should be kept open as a reminder to fix the new archive writer before it becomes the default again.

  2. added
    A-linkageArea: linking into static, shared libraries and binaries
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Apr 8, 2023
  3. jyn514 commented on Apr 8, 2023

    @jyn514
    Member

    cc #107407, which also needs to be fixed before relanding the archive writer change. BTW @bjorn3 is there a tracking issue for that somewhere? I see the original PR linked to https://github.com/bjorn3/rustc_codegen_cranelift/issues/1155, but it hasn't been reopened.

  4. bjorn3 commented on Apr 8, 2023

    @bjorn3
    Member

    I have kept all issues that need to be fixed before it can land again in my github notifications. There is currently no tracking issue, but feel free to open one. It did probably be a good idea to ensure no issue is forgotten about.

  5. added 3 commits that reference this issue on Mar 20, 2024
  6. added a commit that references this issue on Mar 22, 2024
    5b8677e
  7. added a commit that references this issue on Apr 17, 2024
  8. added a commit that references this issue on Apr 17, 2024
  9. added 3 commits that reference this issue on Aug 12, 2024
  10. added 3 commits that reference this issue on Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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