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

Removal of p_fallocate #5114

Merged
merged 2 commits into from
Jun 14, 2019
Merged

Conversation

pks-t
Copy link
Member

@pks-t pks-t commented Jun 14, 2019

The p_fallocate platform is currently in use in our tests,
only, but it proved to be quite burdensome to get it implemented
in a cross-platform way. The only "real" user is the test
object::tree::read::largefile, where it's used to allocate a
large file in the filesystem only to commit it to the repo and
read its object back again. We can simplify this quite a bit by
just using an in-memory buffer of 4GB. Sure, this cannot be used
on platforms with low resources. But creating 4GB files is not
any better, and we already skip the test if the environment
variable "GITTEST_INVASIVE_FS_SIZE" is not set. So we're arguably
not worse off than before.

Supersedes #5087

Copy link
Contributor

@tiennou tiennou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I 🙇 to these changes. Thanks for taking care of it @pks-t !

@@ -79,46 +79,34 @@ void test_object_tree_read__two(void)

void test_object_tree_read__largefile(void)
{
git_reference *ref;
const git_tree_entry *entry;
git_index_entry ie = { 0 };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI NAKed this.

@ethomson
Copy link
Member

I 🙇 to these changes. Thanks for taking care of it @pks-t !

Same, thanks @tiennou and @pks-t to make sure that we're building carefully!

The `p_fallocate` platform is currently in use in our tests,
only, but it proved to be quite burdensome to get it implemented
in a cross-platform way. The only "real" user is the test
object::tree::read::largefile, where it's used to allocate a
large file in the filesystem only to commit it to the repo and
read its object back again. We can simplify this quite a bit by
just using an in-memory buffer of 4GB. Sure, this cannot be used
on platforms with low resources. But creating 4GB files is not
any better, and we already skip the test if the environment
variable "GITTEST_INVASIVE_FS_SIZE" is not set. So we're arguably
not worse off than before.
By now, we have repeatedly failed to provide a nice
cross-platform implementation of `p_fallocate`. Recent tries to
do that escalated quite fast to a set of different CMake checks,
implementations, fallbacks, etc., which started to look real
awkward to maintain. In fact, `p_fallocate` had only been
introduced in commit 4e3949b (tests: test that largefiles can
be read through the tree API, 2019-01-30) to support a test with
large files, but given the maintenance costs it just seems not to
be worht it.

As we have removed the sole user of `p_fallocate` in the previous
commit, let's drop it altogether.
@pks-t
Copy link
Member Author

pks-t commented Jun 14, 2019 via email

@ethomson
Copy link
Member

I hit this issue so many times already. I always wonder why it is that CI catches those things while my own system doesn't. I mean we're both using GCC -- are they setting up extra CFLAGS?

Huh. Maybe? More likely same CFLAGS but different compiler versions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants