Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore Read-Only Filesystems for Compile Cache #359

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/bootsnap/compile_cache/yaml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ def load_file(path, *args)
rescue Errno::EACCES
::Bootsnap::CompileCache.permission_error(path)
end
rescue SystemCallError
end

ruby2_keywords :load_file if respond_to?(:ruby2_keywords, true)
Expand Down
7 changes: 7 additions & 0 deletions test/compile_cache/yaml_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,11 @@ def test_load_file_unknown_option
FakeYaml.load_file('a.yml', fallback: true)
end
end

def test_ignore_read_only_filesystem
Help.set_file('a.yml', "---\nfoo", 100)
Bootsnap::CompileCache::Native.expects(:fetch).raises(Errno::EROFS.new("Read-only file system @ rb_sysopen"))
Bootsnap::CompileCache::YAML.install!(Bootsnap::CompileCache::YAML.cache_dir)
document = ::YAML.load_file('a.yml')
end
end