lifting-bits / remill

Library for lifting machine code to LLVM bitcode
Apache License 2.0
1.22k stars 143 forks source link

Update Dockerfile base image #695

Closed ekilmer closed 5 months ago

ekilmer commented 5 months ago

~DO NOT MERGE until cxx-common docker image PR (https://github.com/lifting-bits/cxx-common/pull/1045) is merged.~

We now build the docker base image for ARM64.

Supersedes the Dockerfile changes in #692

yomaytk commented 5 months ago

@ekilmer Thank you for this PR! I tried building a container image on the branch ekilmer/update-docker on the aarch64, and the new deps stage looks good. However, I couldn't build an image because the test failed. The error message is as follows (I omitted a large part of it because it is a little long).

0.410 0% tests passed, 3 tests failed out of 3
0.410 
0.410 Total Test time (real) =   0.05 sec
0.410 Errors while running CTest
0.410 
0.410 The following tests FAILED:
0.410     1 - small_diff_test (Failed)
0.410     2 - thumb-tests (Not Run)
0.410     3 - ppc-tests (Not Run)
0.413 gmake: *** [Makefile:74: test] Error 8
0.414 
------
Dockerfile:44
--------------------
  43 |     
  44 | >>> RUN cd remill-build && \
  45 | >>>     cmake --build . --target test_dependencies -- -j $(nproc) && \
  46 | >>>     CTEST_OUTPUT_ON_FAILURE=1 cmake --build . --verbose --target test -- -j $(nproc) && \
  47 | >>>     cmake --build . --target install
  48 |     
--------------------

Does this test pass on your environments? Incidentally, I executed the command following.

docker build . -t remill -f Dockerfile \
--build-arg UBUNTU_VERSION=22.04 \
--build-arg ARCH=aarch64 \
--build-arg LLVM_VERSION=16
yomaytk commented 5 months ago

Also in LLVM 17 (with argument --build-arg LLVM_VERSION=17), small_diff_test failed but the failure points are different. Furthermore, thumb-tests and ppc-tests passed.

0.347     Start 1: small_diff_test
1.177 1/3 Test #1: small_diff_test ..................***Failed    0.83 sec
...
1.177 Ran 530 with 530 failing. Success rate of: 0.0
1.177 
1.177     Start 2: thumb-tests
8.056 2/3 Test #2: thumb-tests ......................   Passed    6.88 sec
8.056     Start 3: ppc-tests
17.88 3/3 Test #3: ppc-tests ........................   Passed    9.82 sec
17.88 
17.88 67% tests passed, 1 tests failed out of 3
17.88 
17.88 Total Test time (real) =  17.53 sec
17.88 
17.88 The following tests FAILED:
17.88 Errors while running CTest
17.88     1 - small_diff_test (Failed)
17.88 gmake: *** [Makefile:74: test] Error 8
17.88 
------
Dockerfile:44
--------------------
  43 |     
  44 | >>> RUN cd remill-build && \
  45 | >>>     cmake --build . --target test_dependencies -- -j $(nproc) && \
  46 | >>>     CTEST_OUTPUT_ON_FAILURE=1 cmake --build . --verbose --target test -- -j $(nproc) && \
  47 | >>>     cmake --build . --target install
  48 |     
--------------------
ekilmer commented 5 months ago

Hi @yomaytk, I'm happy you are able to use the new Docker image(s)!

I couldn't build an image because the test failed

I have changed the Docker image to ignore the test results on non-x86_64 architectures. This will allow the image to be built; however this probably isn't the fix you are expecting or want. Unfortunately, I'm unable to help with fixing the tests on aarch64. If you open an issue with more details about the failing tests, someone else should be able to help.

Does this test pass on your environments?

Unfortunately, we only officially support what is tested in CI, which is x86_64 using LLVM 17. LLVM 16 and aarch64 aren't tested in CI, so this combination sometimes fails. If you open a new issue with details about the errors you see, someone else should be able to help.


We generally try to keep documentation updated, but sometimes we forget. We happily review and accept PRs that improve the user experience and workflow. Thank you for your patience and understanding.

ekilmer commented 5 months ago

i believe we still need to update the ci.yml not sure if we want to only build amd64 or also update it to do a cross platform build

Ideally, yes, but I don't think we have the time (to wait for emulation) or resources (to run natively) to support ARM64 builds in CI.

I can update the README to indicate that "ARM64 builds are supported, but they are not tested in CI and could break. If they do, please open an issue, and we will investigate."