folly icon indicating copy to clipboard operation
folly copied to clipboard

Implement support for RISC-V

Open luhenry opened this issue 2 years ago • 7 comments

RISC-V is a growing platform, and Folly and commonly used dependency. We want to make sure that any projects that relies on Folly can be ported to RISC-V.

I'm verifying that everything builds and run correctly by cross-compiling it locally and passing the test suite using QEMU.

luhenry avatar Nov 28 '23 20:11 luhenry

Hi @luhenry!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, 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.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

facebook-github-bot avatar Nov 28 '23 20:11 facebook-github-bot

I've contacted my internal legal department to get the CLA signed. Let me know if there is anything I can modify on this PR in the meantime. Thanks!

luhenry avatar Nov 29 '23 01:11 luhenry

I've also run the tests on a Lichee Pi 4a. There are the following test failures:

Start testing: Nov 29 01:25 UTC
----------------------------------------------------------
338/3075 Testing: cache_locality_test.CacheLocality.LinuxActual
338/3075 Test: cache_locality_test.CacheLocality.LinuxActual
Command: "/workspace/folly/_build/cache_locality_test" "--gtest_filter=CacheLocality.LinuxActual"
Directory: /workspace/folly
"cache_locality_test.CacheLocality.LinuxActual" start time: Nov 29 01:25 UTC
Output:
----------------------------------------------------------
Note: Google Test filter = CacheLocality.LinuxActual
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from CacheLocality
[ RUN      ] CacheLocality.LinuxActual
unknown file: Failure
C++ exception with description "unable to load cache sharing info" thrown in the test body.
[  FAILED  ] CacheLocality.LinuxActual (0 ms)
[----------] 1 test from CacheLocality (0 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (1 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] CacheLocality.LinuxActual

 1 FAILED TEST
<end of output>
Test time =   0.05 sec
----------------------------------------------------------
Test Failed.
"cache_locality_test.CacheLocality.LinuxActual" end time: Nov 29 01:25 UTC
"cache_locality_test.CacheLocality.LinuxActual" time elapsed: 00:00:00
----------------------------------------------------------

341/3075 Testing: cache_locality_test.CacheLocality.BenchmarkSysfs
341/3075 Test: cache_locality_test.CacheLocality.BenchmarkSysfs
Command: "/workspace/folly/_build/cache_locality_test" "--gtest_filter=CacheLocality.BenchmarkSysfs"
Directory: /workspace/folly
"cache_locality_test.CacheLocality.BenchmarkSysfs" start time: Nov 29 01:25 UTC
Output:
----------------------------------------------------------
Note: Google Test filter = CacheLocality.BenchmarkSysfs
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from CacheLocality
[ RUN      ] CacheLocality.BenchmarkSysfs
unknown file: Failure
C++ exception with description "unable to load cache sharing info" thrown in the test body.
[  FAILED  ] CacheLocality.BenchmarkSysfs (0 ms)
[----------] 1 test from CacheLocality (0 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (0 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] CacheLocality.BenchmarkSysfs

 1 FAILED TEST
<end of output>
Test time =   0.05 sec
----------------------------------------------------------
Test Failed.
"cache_locality_test.CacheLocality.BenchmarkSysfs" end time: Nov 29 01:25 UTC
"cache_locality_test.CacheLocality.BenchmarkSysfs" time elapsed: 00:00:00
----------------------------------------------------------

1373/3075 Testing: HHWheelTimerTest.HHWheelTimerTest.CancelTimeout
1373/3075 Test: HHWheelTimerTest.HHWheelTimerTest.CancelTimeout
Command: "/workspace/folly/_build/HHWheelTimerTest" "--gtest_filter=HHWheelTimerTest.CancelTimeout"
Directory: /workspace/folly
"HHWheelTimerTest.HHWheelTimerTest.CancelTimeout" start time: Nov 29 01:25 UTC
Output:
----------------------------------------------------------
Note: Google Test filter = HHWheelTimerTest.CancelTimeout
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from HHWheelTimerTest
[ RUN      ] HHWheelTimerTest.CancelTimeout
E1129 01:25:54.771282 81303 TimeUtil.cpp:216] error determining process wait time: %sfailed to open process schedstat file2
E1129 01:25:54.781003 81303 TimeUtil.cpp:216] error determining process wait time: %sfailed to open process schedstat file2
E1129 01:25:54.781119 81303 TimeUtil.cpp:216] error determining process wait time: %sfailed to open process schedstat file2
E1129 01:25:54.782888 81303 TimeUtil.cpp:216] error determining process wait time: %sfailed to open process schedstat file2
E1129 01:25:54.783669 81303 TimeUtil.cpp:216] error determining process wait time: %sfailed to open process schedstat file2
E1129 01:25:54.790696 81303 TimeUtil.cpp:216] error determining process wait time: %sfailed to open process schedstat file2
E1129 01:25:54.791286 81303 TimeUtil.cpp:216] error determining process wait time: %sfailed to open process schedstat file2
/workspace/folly/folly/io/async/test/HHWheelTimerTest.cpp:234: Failure
Failed
Timeout violates constraints, expectedMs = 5, elapsed wall time ms = 10
/workspace/folly/folly/io/async/test/HHWheelTimerTest.cpp:250: Failure
Failed
Timeout violates constraints, expectedMs = 10, elapsed wall time ms = 19
[  FAILED  ] HHWheelTimerTest.CancelTimeout (25 ms)
[----------] 1 test from HHWheelTimerTest (25 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (25 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] HHWheelTimerTest.CancelTimeout

 1 FAILED TEST
<end of output>
Test time =   0.08 sec
----------------------------------------------------------
Test Failed.
"HHWheelTimerTest.HHWheelTimerTest.CancelTimeout" end time: Nov 29 01:25 UTC
"HHWheelTimerTest.HHWheelTimerTest.CancelTimeout" time elapsed: 00:00:00
----------------------------------------------------------

1432/3075 Testing: ssl_session_test.SSLSessionTest.BasicTest
1432/3075 Test: ssl_session_test.SSLSessionTest.BasicTest
Command: "/workspace/folly/_build/ssl_session_test" "--gtest_filter=SSLSessionTest.BasicTest"
Directory: /workspace/folly
"ssl_session_test.SSLSessionTest.BasicTest" start time: Nov 29 01:25 UTC
Output:
----------------------------------------------------------
Note: Google Test filter = SSLSessionTest.BasicTest
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from SSLSessionTest
[ RUN      ] SSLSessionTest.BasicTest
unknown file: Failure
C++ exception with description "SSL_CTX_load_verify_locations: SSL error # 80000002; no such file; system lib" thrown in SetUp().
[  FAILED  ] SSLSessionTest.BasicTest (16 ms)
[----------] 1 test from SSLSessionTest (16 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (16 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] SSLSessionTest.BasicTest

 1 FAILED TEST
<end of output>
Test time =   0.08 sec
----------------------------------------------------------
Test Failed.
"ssl_session_test.SSLSessionTest.BasicTest" end time: Nov 29 01:25 UTC
"ssl_session_test.SSLSessionTest.BasicTest" time elapsed: 00:00:00
----------------------------------------------------------

1433/3075 Testing: ssl_session_test.SSLSessionTest.NullSessionResumptionTest
1433/3075 Test: ssl_session_test.SSLSessionTest.NullSessionResumptionTest
Command: "/workspace/folly/_build/ssl_session_test" "--gtest_filter=SSLSessionTest.NullSessionResumptionTest"
Directory: /workspace/folly
"ssl_session_test.SSLSessionTest.NullSessionResumptionTest" start time: Nov 29 01:25 UTC
Output:
----------------------------------------------------------
Note: Google Test filter = SSLSessionTest.NullSessionResumptionTest
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from SSLSessionTest
[ RUN      ] SSLSessionTest.NullSessionResumptionTest
unknown file: Failure
C++ exception with description "SSL_CTX_load_verify_locations: SSL error # 80000002; no such file; system lib" thrown in SetUp().
[  FAILED  ] SSLSessionTest.NullSessionResumptionTest (15 ms)
[----------] 1 test from SSLSessionTest (15 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (15 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] SSLSessionTest.NullSessionResumptionTest

 1 FAILED TEST
<end of output>
Test time =   0.08 sec
----------------------------------------------------------
Test Failed.
"ssl_session_test.SSLSessionTest.NullSessionResumptionTest" end time: Nov 29 01:25 UTC
"ssl_session_test.SSLSessionTest.NullSessionResumptionTest" time elapsed: 00:00:00
----------------------------------------------------------

1935/3075 Testing: concurrent_skip_list_test.ConcurrentSkipList.ConcurrentAdd
1935/3075 Test: concurrent_skip_list_test.ConcurrentSkipList.ConcurrentAdd
Command: "/workspace/folly/_build/concurrent_skip_list_test" "--gtest_filter=ConcurrentSkipList.ConcurrentAdd"
Directory: /workspace/folly
"concurrent_skip_list_test.ConcurrentSkipList.ConcurrentAdd" start time: Nov 29 01:26 UTC
Output:
----------------------------------------------------------
Note: Google Test filter = ConcurrentSkipList.ConcurrentAdd
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from ConcurrentSkipList
[ RUN      ] ConcurrentSkipList.ConcurrentAdd
<end of output>
Test time = 120.12 sec
----------------------------------------------------------
Test Failed.
"concurrent_skip_list_test.ConcurrentSkipList.ConcurrentAdd" end time: Nov 29 01:28 UTC
"concurrent_skip_list_test.ConcurrentSkipList.ConcurrentAdd" time elapsed: 00:02:00
----------------------------------------------------------

End testing: Nov 29 01:28 UTC

They all fail because either the board is too slow (ConcurrentSkipList.ConcurrentAdd) to finish the work in the 120s timeout, or it's not setup properly (missing /sys folders or missing packages).

luhenry avatar Nov 29 '23 10:11 luhenry

@Orvid has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot avatar Nov 30 '23 00:11 facebook-github-bot

@Orvid has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot avatar Nov 30 '23 19:11 facebook-github-bot

@Orvid anything else you would like me to get done? Thanks

luhenry avatar Dec 06 '23 13:12 luhenry

Nope, this should be good to go. I'm just waiting on review internally before this can be merged.

Orvid avatar Dec 06 '23 21:12 Orvid

@Orvid merged this pull request in facebook/folly@3e5359213ba8b60a3d6438579992a36337d6089b.

facebook-github-bot avatar Jan 04 '24 21:01 facebook-github-bot