# glibc: fix race condition when building stubs · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/4cfeb9a541b3e6db2c67a494abf4f6bd12900353)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 4cfeb9a541b3e6db2c67a494abf4f6bd12900353

Requested commit: 4cfeb9a541b3e6db2c67a494abf4f6bd12900353

Commit: 4cfeb9a541b3e6db2c67a494abf4f6bd12900353

Tree: ff71b6cffa2d9b41549fcf97d69381cc5775391f

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
glibc: fix race condition when building stubs

Before, the code for building glibc stubs used a special case of the
Cache API that did not add any file inputs, and did not use
writeManifest(). This is not really how the Cache API is designed to
work and it shows because there was a race condition.

This commit adds as an input file the abilists file that comes with
Zig's installation, which has the added benefit of making glibc stub
caching properly detect cache invalidation when the user decides to
overwrite their abilists file. This harmonizes with the rest of how Zig
works, which intentionally allows you to hack the installation files and
have it behave properly with the cache system.

Finally, because of having any file inputs, the normal API flow of the
Cache system can be used, eliminating the one place that used the Cache
API in a special way. In other words, it uses writeManifest() now and
properly obeys the cache hit/miss semantics.

closes #13160

```

## Parents

- [20925b2f5c5c0ae20fdc0574e5d4e5740d17b4d6](https://git.cafe/gitcafe/zig/commit/20925b2f5c5c0ae20fdc0574e5d4e5740d17b4d6?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/4cfeb9a541b3e6db2c67a494abf4f6bd12900353?format=markdown)
