bootsnap 1.18.2 → 1.18.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 219e1686c3d7b3a3c3d0e4814c27842f1e1e9ab35958a1a655532ccaedfa4702
4
- data.tar.gz: 439966933d2dea1cf428b6b61d5e8e72e3c9e7963a00938aff46622a5f7342bf
3
+ metadata.gz: 4fa4ab785277ee01a1c8ee75b43f0efb93db42bffcdacc1c8505a65efa03dede
4
+ data.tar.gz: 8aaaca48ae257b563580023c8fa36a59463f4c30f5463c14f6b8b94bf5fe27df
5
5
  SHA512:
6
- metadata.gz: 6232067f5e67dc414233738b2d1e6390cf17726d78efe6150d30ccd7b7d2e206c68515ddb182988537331982e206be60e3c974fba779ca98a42810084507a827
7
- data.tar.gz: 6d7aa8fc570210a4798903e6150a5e97de4d67e29729c8a04db3ca2aae7bd47f3d9257e8b961158155103306e4ec99f8d50a94cac2c2798c86471d7219038d49
6
+ metadata.gz: 27b48d27d3330c8565952a2fbb979e71013b1e9585bcb3284656192808c304f2874c32a135b14895eec61a7ef038fa71fa111964a56e7aaedc9ff507ef307686
7
+ data.tar.gz: c3d83a0b068f2908a6298c7cd8e1a660f1228a7ddbfb9409cb3f6c174319f3974388ce73756c04062b17b97a37e199a07bccbb0b8dc1c6224998c58c51194b27
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Unreleased
2
2
 
3
+ # 1.18.3
4
+
5
+ * Fix the cache corruption issue in the revalidation feature. See #474.
6
+ The cache revalidation feature remains opt-in for now, until it is more battle tested.
7
+
3
8
  # 1.18.2
4
9
 
5
10
  * Disable stale cache entries revalidation by default as it seems to cause cache corruption issues. See #471 and #474.
@@ -124,7 +124,7 @@ static void bs_cache_path(const char * cachedir, const VALUE path, char (* cache
124
124
  static int bs_read_key(int fd, struct bs_cache_key * key);
125
125
  static enum cache_status cache_key_equal_fast_path(struct bs_cache_key * k1, struct bs_cache_key * k2);
126
126
  static int cache_key_equal_slow_path(struct bs_cache_key * current_key, struct bs_cache_key * cached_key, const VALUE input_data);
127
- static int update_cache_key(struct bs_cache_key *current_key, int cache_fd, const char ** errno_provenance);
127
+ static int update_cache_key(struct bs_cache_key *current_key, struct bs_cache_key *old_key, int cache_fd, const char ** errno_provenance);
128
128
 
129
129
  static void bs_cache_key_digest(struct bs_cache_key * key, const VALUE input_data);
130
130
  static VALUE bs_fetch(char * path, VALUE path_v, char * cache_path, VALUE handler, VALUE args);
@@ -353,10 +353,11 @@ static int cache_key_equal_slow_path(struct bs_cache_key *current_key,
353
353
  return current_key->digest == cached_key->digest;
354
354
  }
355
355
 
356
- static int update_cache_key(struct bs_cache_key *current_key, int cache_fd, const char ** errno_provenance)
356
+ static int update_cache_key(struct bs_cache_key *current_key, struct bs_cache_key *old_key, int cache_fd, const char ** errno_provenance)
357
357
  {
358
+ old_key->mtime = current_key->mtime;
358
359
  lseek(cache_fd, 0, SEEK_SET);
359
- ssize_t nwrite = write(cache_fd, current_key, KEY_SIZE);
360
+ ssize_t nwrite = write(cache_fd, old_key, KEY_SIZE);
360
361
  if (nwrite < 0) {
361
362
  *errno_provenance = "update_cache_key:write";
362
363
  return -1;
@@ -825,7 +826,7 @@ bs_fetch(char * path, VALUE path_v, char * cache_path, VALUE handler, VALUE args
825
826
  valid_cache = cache_key_equal_slow_path(&current_key, &cached_key, input_data);
826
827
  if (valid_cache) {
827
828
  if (!readonly) {
828
- if (update_cache_key(&current_key, cache_fd, &errno_provenance)) {
829
+ if (update_cache_key(&current_key, &cached_key, cache_fd, &errno_provenance)) {
829
830
  exception_message = path_v;
830
831
  goto fail_errno;
831
832
  }
@@ -993,7 +994,7 @@ bs_precompile(char * path, VALUE path_v, char * cache_path, VALUE handler)
993
994
  }
994
995
  valid_cache = cache_key_equal_slow_path(&current_key, &cached_key, input_data);
995
996
  if (valid_cache) {
996
- if (update_cache_key(&current_key, cache_fd, &errno_provenance)) {
997
+ if (update_cache_key(&current_key, &cached_key, cache_fd, &errno_provenance)) {
997
998
  goto fail;
998
999
  }
999
1000
  }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bootsnap
4
- VERSION = "1.18.2"
4
+ VERSION = "1.18.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootsnap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.18.2
4
+ version: 1.18.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Burke Libbey