Skip to content

Make folly compile on Debian systems#1514

Closed
chaiken wants to merge 2 commits into
facebook:masterfrom
chaiken:forked-main
Closed

Make folly compile on Debian systems#1514
chaiken wants to merge 2 commits into
facebook:masterfrom
chaiken:forked-main

Conversation

@chaiken

@chaiken chaiken commented Jan 13, 2021

Copy link
Copy Markdown

The attached patches make Folly compile on Debian systems without affecting the build on Ubuntu 18.04. They fix the error message

folly/folly/portability/Time.cpp:278:2: error: No clock_gettime(3) compatibility wrapper available for this platform.
#error No clock_gettime(3) compatibility wrapper available for this platform.

which suggested, apparently erroneously, that a compatibility wrapper is needed for Linux systems other than Ubuntu 18.04. clock_gettime() is a Linux system call.

Debian, as Ubuntu's upstream, is largely compatible in its filesystem
layout and package versions.  Folly builds successfully on Debian's
rolling "Testing" release.
Fix the error message

    folly/folly/portability/Time.cpp:278:2: error: No clock_gettime(3)
    compatibility wrapper available for this platform.

Presumably no compatibility layer is needed.
@facebook-github-bot

Copy link
Copy Markdown
Contributor

Hi @chaiken!

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file.

In order for us to review and merge your code, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@chaiken

chaiken commented Jan 16, 2021

Copy link
Copy Markdown
Author

The test failures like "file_test.File.Simple" clearly have nothing to do with my patch, which only changes the Linux build and does not affect Mac or Windows at all. Unfortunately I see no way to prove that assertion, so I'll close the pull request and carry the patch locally.

@chaiken chaiken closed this Jan 16, 2021
@Orvid

Orvid commented Jan 17, 2021

Copy link
Copy Markdown
Contributor

The test failures are fine, we just need the CLA signed before we can do anything with it.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@chaiken

chaiken commented Jan 18, 2021

Copy link
Copy Markdown
Author

On Linux localhost I find that EventBaseTest/EventBaseTest/0.RunInThread reproducibly fails but that everything else passes. Also, there are 928 tests that the test frameworks reports are not found. Presumably if they actually failed to compile or link, that would be reported as a build failure.

@chaiken

chaiken commented Jan 18, 2021

Copy link
Copy Markdown
Author

Another note: clock_gettime_wrappers_test works fine with this patch. Assuredly it would fail if the patch were wrong. Here is the result:

`$ build/folly/clock_gettime_wrappers_test
[==========] Running 2 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 2 tests from ClockGettimeWrappers
[ RUN ] ClockGettimeWrappers.clockGettimeWrapperIsWithin120SecsOfSystemClock
[ OK ] ClockGettimeWrappers.clockGettimeWrapperIsWithin120SecsOfSystemClock (0 ms)
[ RUN ] ClockGettimeWrappers.clockGettimeNsWrapperIsWithin120SecsOfSystemClock
[ OK ] ClockGettimeWrappers.clockGettimeNsWrapperIsWithin120SecsOfSystemClock (0 ms)
[----------] 2 tests from ClockGettimeWrappers (0 ms total)

[----------] Global test environment tear-down
[==========] 2 tests from 1 test suite ran. (0 ms total)
[ PASSED ] 2 tests.
`

def run_project_cmd(self, args, loader, manifest):
platforms = [
HostType("linux", "ubuntu", "18"),
HostType("linux", None, None),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This needs to stay as ubuntu to run the github action on the right distro.

}
}
#else
#if !__linux__

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What's causing FOLLY_HAVE_CLOCK_GETTIME to not be defined? This shouldn't be getting reached if that is defined properly.

@chaiken

chaiken commented Jan 25, 2021

Copy link
Copy Markdown
Author

Replaced by #1517.

@chaiken chaiken closed this Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants