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

chore: try embed trick to include non-go files on vendor #559

Merged
merged 5 commits into from
Dec 6, 2024
Merged

Conversation

markphelps
Copy link
Contributor

try to fix: #558

@markphelps markphelps requested a review from a team as a code owner December 5, 2024 21:23
@codecov-commenter
Copy link

codecov-commenter commented Dec 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.48%. Comparing base (52fec14) to head (c58bc43).
Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #559   +/-   ##
=======================================
  Coverage   85.48%   85.48%           
=======================================
  Files           8        8           
  Lines        3933     3933           
=======================================
  Hits         3362     3362           
  Misses        571      571           

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

@markphelps markphelps requested a review from erka December 5, 2024 22:18
Copy link

@nhunam nhunam left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@GeorgeMac GeorgeMac left a comment

Choose a reason for hiding this comment

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

Nice hack. Do we need to do the same for the other non go files?

seems like we will run into this with the dynamic libs too?

Shame we have to then also add all these objects to any resulting binaries in another location in memory for everyone just to make this work 😮‍💨

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.

this doesn't work :(

ext.go should be in evaluation package with

package evaluation 

import "embed"

//go:embed ext/*
var _ embed.FS

@markphelps
Copy link
Contributor Author

this doesn't work :(

ext.go should be in evaluation package with

package evaluation 

import "embed"

//go:embed ext/*
var _ embed.FS

is this because we need to fake embed the libraries too for vendoring? i hope this doesn't make the filesize double in the archive

 into embed-go

* 'embed-go' of https://github.com/flipt-io/flipt-client-sdks:
  build(deps-dev): bump @typescript-eslint/eslint-plugin (#554)
  build(deps-dev): bump prettier in /flipt-client-react (#561)
  chore(rust): update rust from 1.74 to 1.83 (#560)
@erka
Copy link
Collaborator

erka commented Dec 6, 2024

@markphelps I tried the local app with vendor vs shared deps and the binary size was the same. It would be nice to have a deeper knowledge about this situation.

@markphelps markphelps merged commit ab2e0d5 into main Dec 6, 2024
23 checks passed
@markphelps markphelps deleted the embed-go branch December 6, 2024 16:12
@markphelps
Copy link
Contributor Author

So this is interesting.. it now packages both libc folders in /ext and includes them in the archive:

CleanShot 2024-12-06 at 12 43 57

This might actually allow us to implement what is asked for in #141 (comment) by using buildtags to for the appropriate arch. It still would mean that the initial go get would be like 30mb transfered though, but it would only include the needed lib in the actual build of the consuming binary

@markphelps
Copy link
Contributor Author

markphelps commented Dec 6, 2024

also its just plain wrong as the musl folder is missing the linux subfolders.. something is off with the packaging workflow now

@markphelps
Copy link
Contributor Author

ok so i removed the ext.go embed and published a new release and can verify the packaging issue is not related to the ext.go change, there is something else wrong with our packaging workflow that I'll need to fix first

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.

After go get go.flipt.io/flipt-client this error occurs
5 participants