Skip to content

chore(operations): Add builder for armv7-unknown-linux-musleabihf #1054

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

Merged
47 commits merged into from
Nov 19, 2019

Conversation

ghost
Copy link

@ghost ghost commented Oct 18, 2019

Closes #859

This is an early stage builder for armv7-unknown-linux-musleabihf. It is able to produce binaries, but at the moment it supports only jemallocator feature, and not leveldb and rdkafka.

The problem with leveldb is that it expects a special configure flag saying that we are in a cross-compilation environment, and leveldb-sys crate doesn't pass it to the configure script. rdkafka has some issues related to the SSL library.

Also it uses LLD as the linker, so we would need to address #1035 before merging or use ld from the GCC toolchain for ARM.

@ghost ghost added the domain: operations label Oct 18, 2019
@ghost ghost changed the title Add initial builder for armv7-unknown-linux-musleabihf chore: Add initial builder for armv7-unknown-linux-musleabihf Oct 18, 2019
Signed-off-by: Alexander Rodin <[email protected]>
@ghost
Copy link
Author

ghost commented Oct 23, 2019

rdkafka and jemalloc features can be compiled now. leveldb is waiting for #1056.

@ghost
Copy link
Author

ghost commented Oct 25, 2019

Now we can compile Vector with all features. The resulting binary runs on Raspberry Pi 4, but cannot load config because of the same problem as in #791. So need to wait for #1035.

@@ -0,0 +1,332 @@
ARG RUST_VERSION=1.38.0
Copy link
Contributor

Choose a reason for hiding this comment

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

A lot of this seems repeated from our other musl container? I think this would be a good point to break this out into its own script?

Copy link
Author

Choose a reason for hiding this comment

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

I want to combine this and the other one into a single Dockerfile when doing #946. For now the goal is to just have Vector compiled and running on the new platoform.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good to me! I am just eager to get #946 done 😄

@ghost ghost changed the title chore: Add initial builder for armv7-unknown-linux-musleabihf chore(operations): Add initial builder for armv7-unknown-linux-musleabihf Oct 25, 2019
@ghost ghost changed the title chore(operations): Add initial builder for armv7-unknown-linux-musleabihf chore(operations): Add builder for armv7-unknown-linux-musleabihf Oct 25, 2019
@ghost
Copy link
Author

ghost commented Oct 25, 2019

Now Vector and the tests (not integration ones) can be executed. The current status of the tests:

  • Tests using grok_parser transform result in segmentation fault.
  • sources::file::tests::file_max_line_bytes test fails:
    thread 'main' panicked at 'assertion failed: `(left == right)`
      left: `[Bytes(b"short"), Bytes(b"exactly 10")]`,
     right: `[Bytes(b"short"), Bytes(b"exactly 10"), Bytes(b"last short")]`', src/sources/file.rs:1117:9
    
  • All other tests are passing.

@ghost ghost removed the domain: operations label Oct 25, 2019
@binarylogic
Copy link
Contributor

Nice! Do you know how to resolve the failing test? And how can we perform this check in CI?

@ghost
Copy link
Author

ghost commented Oct 26, 2019

Do you know how to resolve the failing test?

The segmentation fault in grok_parser is probably caused by C bindings in onig crate using types specific to 64-bit architectures instead of generic usize, c_ptr, etc. The same might be true about the problem with file source.

And how can we perform this check in CI?

There are two ways, one is to run QEMU virtual machine emulating ARMv7 in CircleCI and another is to spawn an A1 instance from CI to run the tests. I prefer the first approach because it would allow anyone to run these tests locally and I find it more convenient to have all tests running in one place if it is possible.

@ghost
Copy link
Author

ghost commented Oct 29, 2019

It turns out that for statically linked binaries it is possible to just install package qemu-user on a host x86_64 system and run ARMv7 binaries in a usual way, like ./vector.

@ghost ghost mentioned this pull request Oct 29, 2019
@ghost
Copy link
Author

ghost commented Oct 29, 2019

The file source tests are failing just because ARM devices (or QEMU emulating them) are slower than modern x86_64 machines, so sleeping 50 milliseconds is not enough. After increasing the sleep timeout up to 500 milliseconds they passed.

Signed-off-by: Alexander Rodin <[email protected]>
Signed-off-by: Alexander Rodin <[email protected]>
…v7-unknown-linux-musleabihf

Signed-off-by: Alexander Rodin <[email protected]>
Signed-off-by: Alexander Rodin <[email protected]>
Signed-off-by: Alexander Rodin <[email protected]>
Signed-off-by: Alexander Rodin <[email protected]>
Signed-off-by: Alexander Rodin <[email protected]>
@binarylogic
Copy link
Contributor

So close! @a-rodin what are you thinking the ETA is on this? Looking really good.

@ghost ghost marked this pull request as ready for review November 14, 2019 20:52
@ghost
Copy link
Author

ghost commented Nov 14, 2019

@binarylogic It is ready!

@binarylogic
Copy link
Contributor

Nice! I know you had to branch out a lot to support this. Great work! We'll be launching marketing pages to promote this + IOT in general.

@binarylogic
Copy link
Contributor

@a-rodin, @LucioFranco is out until the 25th. Would you prefer to wait, have someone else review, or go ahead and merge? I can also find someone that has more knowledge in this domain to review, but you clearly know what you're doing 😄 .

@ghost
Copy link
Author

ghost commented Nov 15, 2019

I think we can merge it, as it doesn’t break anything and subsequent changes in the build process would not be breaking changes.

@ghost ghost merged commit 90388ed into master Nov 19, 2019
@ghost ghost deleted the armv7-unknown-linux-musleabihf branch November 20, 2019 16:51
@poupryc
Copy link

poupryc commented Nov 22, 2019

Hello. Is it planned to publish a docker image for the arm architecture?

@ghost
Copy link
Author

ghost commented Nov 22, 2019

@HelloEdit Yes! Issue #1196 represents it.

This pull request was closed.
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.

Support ARMv7
4 participants