bootsnap 1.18.0 → 1.18.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/ext/bootsnap/bootsnap.c +23 -5
- data/lib/bootsnap/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69d7ab3b264f447ac2a6a3ccea6a4cb27e6fa0ce6b50e6fef645c21d41a89a07
|
4
|
+
data.tar.gz: 595c8df291862a529b9a679f36bcae270c5d0efeee22b2fa68f1d7fc78cd7a86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38b9b648b181ca689c3ed64b5f01ad2bb1f41c0b51f241eed19b9d5b2fc93247b37fef4e507981b3e606f4d4b1840b2c57a0ef9656d36fbc398f14e725549235
|
7
|
+
data.tar.gz: e72104154d6b9bd688a2290e1704546e9dd08f792e2bf34d1a02329578e694c9849e79f3f62f197093ab42a06f8328028426cc0676b6c4c2a3a565ebd586bd44
|
data/CHANGELOG.md
CHANGED
data/ext/bootsnap/bootsnap.c
CHANGED
@@ -96,6 +96,7 @@ static ID instrumentation_method;
|
|
96
96
|
static VALUE sym_hit, sym_miss, sym_stale, sym_revalidated;
|
97
97
|
static bool instrumentation_enabled = false;
|
98
98
|
static bool readonly = false;
|
99
|
+
static bool perm_issue = false;
|
99
100
|
|
100
101
|
/* Functions exposed as module functions on Bootsnap::CompileCache::Native */
|
101
102
|
static VALUE bs_instrumentation_enabled_set(VALUE self, VALUE enabled);
|
@@ -119,7 +120,7 @@ static int update_cache_key(struct bs_cache_key *current_key, int cache_fd, cons
|
|
119
120
|
static void bs_cache_key_digest(struct bs_cache_key * key, const VALUE input_data);
|
120
121
|
static VALUE bs_fetch(char * path, VALUE path_v, char * cache_path, VALUE handler, VALUE args);
|
121
122
|
static VALUE bs_precompile(char * path, VALUE path_v, char * cache_path, VALUE handler);
|
122
|
-
static int open_current_file(char * path, struct bs_cache_key * key, const char ** errno_provenance);
|
123
|
+
static int open_current_file(const char * path, struct bs_cache_key * key, const char ** errno_provenance);
|
123
124
|
static int fetch_cached_data(int fd, ssize_t data_size, VALUE handler, VALUE args, VALUE * output_data, int * exception_tag, const char ** errno_provenance);
|
124
125
|
static uint32_t get_ruby_revision(void);
|
125
126
|
static uint32_t get_ruby_platform(void);
|
@@ -413,17 +414,34 @@ bs_rb_precompile(VALUE self, VALUE cachedir_v, VALUE path_v, VALUE handler)
|
|
413
414
|
|
414
415
|
return bs_precompile(path, path_v, cache_path, handler);
|
415
416
|
}
|
417
|
+
|
418
|
+
static int bs_open_noatime(const char *path, int flags) {
|
419
|
+
int fd = 1;
|
420
|
+
if (!perm_issue) {
|
421
|
+
fd = open(path, flags | O_NOATIME);
|
422
|
+
if (fd < 0 && errno == EPERM) {
|
423
|
+
errno = 0;
|
424
|
+
perm_issue = true;
|
425
|
+
}
|
426
|
+
}
|
427
|
+
|
428
|
+
if (perm_issue) {
|
429
|
+
fd = open(path, flags);
|
430
|
+
}
|
431
|
+
return fd;
|
432
|
+
}
|
433
|
+
|
416
434
|
/*
|
417
435
|
* Open the file we want to load/cache and generate a cache key for it if it
|
418
436
|
* was loaded.
|
419
437
|
*/
|
420
438
|
static int
|
421
|
-
open_current_file(char * path, struct bs_cache_key * key, const char ** errno_provenance)
|
439
|
+
open_current_file(const char * path, struct bs_cache_key * key, const char ** errno_provenance)
|
422
440
|
{
|
423
441
|
struct stat statbuf;
|
424
442
|
int fd;
|
425
443
|
|
426
|
-
fd =
|
444
|
+
fd = bs_open_noatime(path, O_RDONLY);
|
427
445
|
if (fd < 0) {
|
428
446
|
*errno_provenance = "bs_fetch:open_current_file:open";
|
429
447
|
return fd;
|
@@ -491,9 +509,9 @@ open_cache_file(const char * path, struct bs_cache_key * key, const char ** errn
|
|
491
509
|
int fd, res;
|
492
510
|
|
493
511
|
if (readonly) {
|
494
|
-
fd =
|
512
|
+
fd = bs_open_noatime(path, O_RDONLY);
|
495
513
|
} else {
|
496
|
-
fd =
|
514
|
+
fd = bs_open_noatime(path, O_RDWR);
|
497
515
|
}
|
498
516
|
|
499
517
|
if (fd < 0) {
|
data/lib/bootsnap/version.rb
CHANGED