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: musl build of ffi engine #332

Merged
merged 31 commits into from
Aug 25, 2024
Merged

feat: musl build of ffi engine #332

merged 31 commits into from
Aug 25, 2024

Conversation

markphelps
Copy link
Contributor

@markphelps markphelps commented Aug 23, 2024

Re: #141

  • build flipt-engine-ffi with musl so it can run on alpine hosts
  • remove rust-cross (uses docker to cross compile) and do it 'manually' on the build machines
  • moves downloading of build ffi engines into dagger / Go when packaging the SDKs (easier to express in code than YAML)

trying this with the Go SDK first, it will create a new tag vX.X.X-musl for the Go SDK which will contain only the musl libs

Testing

After getting this to work (with using cross again), I tested this by creating a Dockerfile locally, and putting the built lib from the GitHub actions workflow in the correct place (flipt-client-go/ext/linux_arm64 as im on a m1 mac)

FROM golang:1.21.3-alpine

RUN apk add --no-cache build-base

WORKDIR /src

COPY . .

ENV FLIPT_URL="https://try.flipt.io"
ENV FLIPT_AUTH_TOKEN="flipt"
ENV LD_LIBRARY_PATH="/src/ext/linux_arm64:$LD_LIBRARY_PATH"

RUN go mod download

RUN go test ./...

It runs correctly, just fails since the data at https://try.flipt.io doesnt exist

 > [6/6] RUN go test ./...:                                                                                                                                             
5.069 --- FAIL: TestVariant (0.00s)                                                                                                                                     
5.069     evaluation_test.go:39:                                                                                                                                        
5.069         	Error Trace:	/src/evaluation_test.go:39                                                                                                              
5.069         	Error:      	Not equal:                                                                                                                              
5.069         	           	expected: "success"
5.069         	           	actual  : "failure"
5.069         	           	
5.069         	           	Diff:
5.069         	           	--- Expected
5.069         	           	+++ Actual
5.069         	           	@@ -1 +1 @@
5.069         	           	-success
5.069         	           	+failure
5.069         	Test:       	TestVariant
5.069     evaluation_test.go:40: 
5.069         	Error Trace:	/src/evaluation_test.go:40
5.069         	Error:      	Should be empty, but was invalid request: failed to get flag information default/flag1
5.069         	Test:       	TestVariant

@codecov-commenter
Copy link

codecov-commenter commented Aug 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.38%. Comparing base (6190dd3) to head (c30436e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #332   +/-   ##
=======================================
  Coverage   88.38%   88.38%           
=======================================
  Files          10       10           
  Lines        3686     3686           
=======================================
  Hits         3258     3258           
  Misses        428      428           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@markphelps markphelps changed the title chore: try musl build of ffi engine feat: musl build of ffi engine Aug 23, 2024
@markphelps markphelps marked this pull request as ready for review August 25, 2024 01:49
@markphelps markphelps requested a review from a team as a code owner August 25, 2024 01:49
Copy link
Collaborator

@erka erka left a comment

Choose a reason for hiding this comment

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

I tried the artifact on x86_64 alpine and works great.

Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
@kodiakhq kodiakhq bot merged commit ae016a2 into main Aug 25, 2024
17 checks passed
@kodiakhq kodiakhq bot deleted the musl-build branch August 25, 2024 17:03
@markphelps markphelps mentioned this pull request Aug 26, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants