Re: [ccache] ccache changes file permissions unexpectedly

2022-05-07 Thread Joel Rosdahl via ccache
Aleksey Midenkov wrote:

> After the software upgrade I noticed my IDE cannot compile a project
> after it was built from the terminal. It turned out that build
> directory now contains objects with such strange permissions:
>
> -r--r--r--
>
> When I removed ccache from the compiling command it created normal rw
> files. My umask is 0002

Do you use the hard link mode? When the hard link mode is enabled, ccache
intentionally makes hard-linked output files (currently only object files)
read-only. From :

"If the resulting file is modified, the file in the cache will also be
modified since they share content, which corrupts the cache entry. As of
version 4.0, ccache makes stored and fetched object files read-only as a
safety measure."

So if your build fails because files have read-only permissions, it sounds like
ccache has saved you from corrupting the cache since something tried to write to
a file that is hard-linked to a file in ccache's cache. The solution to this is
to either not use tools that write to object files after compilation or to
disable the hard link mode.

If you don't use the hard link mode then it sounds like a ccache bug. If so,
please describe a way to reproduce the problem.

> I suspected it is because of the new `umask` setting in ccache which works
> differently by default (which is a really bad design choice).

There is no design decision to change how umask works, and I'm not aware of any
change in behavior between ccache 3.x and 4.x.

-- Joel

___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache


Re: [ccache] ccache changes file permissions unexpectedly

2022-05-05 Thread Aleksey Midenkov via ccache
Actually `umask` option was already there (ccache version 3.7.11) but
it worked correctly: umask 002 worked well, umask 511 didn't work.

Now it works incorrectly: umask 002 doesn't work, umask 511 works
well. Looks like a bug with bitmask operations.

On Wed, May 4, 2022 at 8:36 PM Aleksey Midenkov  wrote:
>
> After the software upgrade I noticed my IDE cannot compile a project
> after it was built from the terminal. It turned out that build
> directory now contains objects with such strange permissions:
>
> -r--r--r--
>
> When I removed ccache from the compiling command it created normal rw
> files. My umask is 0002
>
> I suspected it is because of the new `umask` setting in ccache which
> works differently by default (which is a really bad design choice).
> `ccache -p` printed just an empty value for that setting. Setting it
> to 0002 and clearing it with `ccache -C` didn't help anything. So, how
> it works now and how to get it back to human-expected behaviour?
>
> ccache version 4.5.1
>
> --
> @midenok



-- 
@midenok

___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache