Skip to content

clang does not add executable rights to an existing output file on macOS #57120

@ThomasMader

Description

@ThomasMader

Issue description

This is the continuation for the problem in #55998 (comment).
cc @veprbl

The problem is that clang and gcc on macOS doesn't add executable rights if the output file was already created without executable rights.

Steps to reproduce

cd /tmp
touch executableTest
echo "int main() {}" > executableTest.c
nix-shell -p clang --pure --run "clang executableTest.c -o executableTest"
./executableTest

It works with gcc but still not with clang if I checkout nixpkgs master at 84be644 go into the checkout directory and do the following:

cd /tmp
touch executableTest
echo "int main() {}" > executableTest.c
nix-shell -p gcc --pure --run "gcc executableTest.c -o executableTest"
./executableTest

Technical details

Please run nix-shell -p nix-info --run "nix-info -m" and paste the
results.

  • system: "x86_64-darwin"
  • host os: Darwin 18.2.0, macOS 10.14.3
  • multi-user?: no
  • sandbox: no
  • version: nix-env (Nix) 2.1.3
  • channels(thomad): "nixpkgs-19.03pre171497.cc1fa81489e"
  • nixpkgs: /Users/thomad/.nix-defexpr/channels/nixpkgs

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bugSomething is broken6.topic: darwinRunning or building packages on Darwin
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions