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

feat: add builds and use prebuilt action #415

Merged
merged 1 commit into from
Apr 11, 2023
Merged

Conversation

shawaj
Copy link
Contributor

@shawaj shawaj commented Apr 11, 2023

  • add ecc608 based x86_64 image (LongAP uses this configuration)
  • add docker builds for armv6 and armv7 via qemu
  • change the build and push step to use the prebuilt docker action
  • add github actions cache to builder action step to speed up future builds
  • fix typos and add a bit more detail to readme

- gateway-mfr-rs uses aarch64-unknown-linux-gnu instead of aarch64-unknown-linux-musl so this unifies the two
- adds missing armv7-unknown-linux-gnueabihf which is built in gateway-mfr-rs

@shawaj
Copy link
Contributor Author

shawaj commented Apr 11, 2023

As per helium/proto#318

I was attempting to build for aarch64-unknown-linux-gnu and armv7-unknown-linux-gnueabihf which are mentioned as being supported in gateway-rs readme (and used to be built for) but seem to have got lost in the migration from deb packages to tarballs.

however both fail with this error:

error: failed to run custom build command for `helium-proto v0.1.0 (https://github.com/helium/proto?branch=master#6edba809)`

Caused by:
  process didn't exit successfully: `/target/release/build/helium-proto-62cbd62839dbfd84/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-changed=src/blockchain_txn.proto
  cargo:rerun-if-changed=src/entropy.proto
  cargo:rerun-if-changed=src/data_rate.proto
  cargo:rerun-if-changed=src/region.proto
  cargo:rerun-if-changed=src/mapper.proto
  cargo:rerun-if-changed=src/reward_manifest.proto
  cargo:rerun-if-changed=src/blockchain_region_param_v1.proto
  cargo:rerun-if-changed=src/price_report.proto
  cargo:rerun-if-changed=src/service/router.proto
  cargo:rerun-if-changed=src/service/state_channel.proto
  cargo:rerun-if-changed=src/service/local.proto
  cargo:rerun-if-changed=src/service/gateway.proto
  cargo:rerun-if-changed=src/service/transaction.proto
  cargo:rerun-if-changed=src/service/follower.proto
  cargo:rerun-if-changed=src/service/poc_mobile.proto
  cargo:rerun-if-changed=src/service/poc_lora.proto
  cargo:rerun-if-changed=src/service/poc_entropy.proto
  cargo:rerun-if-changed=src/service/packet_router.proto
  cargo:rerun-if-changed=src/service/iot_config.proto
  cargo:rerun-if-changed=src/service/mobile_config.proto
  cargo:rerun-if-changed=src/service/downlink.proto
  cargo:rerun-if-changed=src/service/multi_buy.proto
  cargo:rerun-if-changed=src/service/packet_verifier.proto
  cargo:rerun-if-changed=src

  --- stderr
  Error: Custom { kind: Other, error: "protoc failed: blockchain_txn.proto:1:10: Unrecognized syntax identifier \"proto3\".  This parser only recognizes \"proto2\".\n" }
warning: build failed, waiting for other jobs to finish...
[cargo-make] ERROR - Error while executing command, exit code: 101
[cargo-make] WARN - Build Failed.
Error: Process completed with exit code 1.

@madninja
Copy link
Member

They "got lost" because no-one was actually using them. Do you have a use for them or are you trying to be complete because of the README?

@shawaj
Copy link
Contributor Author

shawaj commented Apr 11, 2023

@madninja yeah we only need the additional x86 one. I was trying to be helpful but have clearly done the opposite :-P

I assumed they were necessary / used as they were previously set up as targets for actual users in the makefile (and readme):
https://github.com/helium/gateway-rs/blob/2d44b5c11a6b6d80c7e5fe67ef1f94f389c7eeba/Makefile.toml

Is that not the case any more?

@madninja
Copy link
Member

@madninja yeah we only need the additional x86 one. I was trying to be helpful but have clearly done the opposite :-P

I assumed they were necessary / used as they were previously set up as targets for actual users in the makefile (and readme): https://github.com/helium/gateway-rs/blob/2d44b5c11a6b6d80c7e5fe67ef1f94f389c7eeba/Makefile.toml

Is that not the case any more?

The affected makers are either not using the builds here or are no longer in business. If you want to fix them up you can but you'd have to get an updated protoc in the build images.

@shawaj
Copy link
Contributor Author

shawaj commented Apr 11, 2023

ok - will keep it simple and can those two for now then 👍

thanks, as always, @madninja

have fixed and rebased

.github/workflows/ci.yml Outdated Show resolved Hide resolved
Makefile.toml Outdated Show resolved Hide resolved
- add ecc608 based x86_64 image
- add docker builds for armv6 and armv7
- change the build and push step to use the prebuilt docker action
@shawaj
Copy link
Contributor Author

shawaj commented Apr 11, 2023

I guess the build is failing because i don't have access to the repository secrets but otherwise seems to be ok...

Run docker/login-action@v2
Error: Username and password required

@shawaj shawaj requested a review from madninja April 11, 2023 20:57
@madninja madninja merged commit 58f0126 into helium:main Apr 11, 2023
@madninja madninja mentioned this pull request Apr 11, 2023
shawaj added a commit to shawaj/gateway-rs that referenced this pull request Apr 11, 2023
@shawaj shawaj mentioned this pull request Apr 11, 2023
shawaj added a commit to shawaj/gateway-rs that referenced this pull request Apr 11, 2023
shawaj added a commit to shawaj/gateway-rs that referenced this pull request Apr 11, 2023
@NkkVr
Copy link

NkkVr commented Mar 27, 2024

cross build --target armv7-unknown-linux-musleabihf --release I have no problem with this. but cross build --target aarch64-unknown-linux-gnu --release I did not overcome the problem.

root@Helium:~/Helium/gateway-rs# cross build --target aarch64-unknown-linux-gnu --release
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
Install the buildx component to build images with BuildKit:
https://docs.docker.com/go/buildx/

Compiling helium-proto v0.1.0 (https://github.com/helium/proto?branch=master#d94ed4b4)
error: failed to run custom build command for helium-proto v0.1.0 (https://github.com/helium/proto?branch=master#d94ed4b4)

Caused by:
process didn't exit successfully: /target/release/build/helium-proto-a8c15c324ceedd69/build-script-build (exit status: 1)
--- stdout
cargo:rerun-if-changed=src/blockchain_txn.proto
cargo:rerun-if-changed=src/entropy.proto
cargo:rerun-if-changed=src/data_rate.proto
cargo:rerun-if-changed=src/region.proto
cargo:rerun-if-changed=src/mapper.proto
cargo:rerun-if-changed=src/reward_manifest.proto
cargo:rerun-if-changed=src/blockchain_region_param_v1.proto
cargo:rerun-if-changed=src/price_report.proto
cargo:rerun-if-changed=src/service/router.proto
cargo:rerun-if-changed=src/service/state_channel.proto
cargo:rerun-if-changed=src/service/local.proto
cargo:rerun-if-changed=src/service/transaction.proto
cargo:rerun-if-changed=src/service/follower.proto
cargo:rerun-if-changed=src/service/poc_mobile.proto
cargo:rerun-if-changed=src/service/poc_lora.proto
cargo:rerun-if-changed=src/service/poc_entropy.proto
cargo:rerun-if-changed=src/service/packet_router.proto
cargo:rerun-if-changed=src/service/iot_config.proto
cargo:rerun-if-changed=src/service/mobile_config.proto
cargo:rerun-if-changed=src/service/downlink.proto
cargo:rerun-if-changed=src/service/multi_buy.proto
cargo:rerun-if-changed=src/service/packet_verifier.proto
cargo:rerun-if-changed=src

--- stderr
Error: Custom { kind: Other, error: "protoc failed: blockchain_txn.proto:1:10: Unrecognized syntax identifier "proto3". This parser only recognizes "proto2".\n" }
root@Helium:/Helium/gateway-rs# protoc --version
libprotoc 3.6.1
root@Helium:
/Helium/gateway-rs#

@madninja
Copy link
Member

This is an issue with your build system Ge a newer version of the protocol tool that supports proto3 format.

@NkkVr
Copy link

NkkVr commented Mar 29, 2024

So how can I solve this problem?

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