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

Solution for sharing a build cache between modules, e.g. for Go #523

Open
2 tasks done
DeedleFake opened this issue Mar 6, 2023 · 1 comment
Open
2 tasks done

Comments

@DeedleFake
Copy link

Checklist

  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Suggestion

When building Flatpaks for Go apps locally, it would be useful to be able to gain access to the Go build cache, usually located at $XDG_CACHE_HOME/go-build. Adding --filesystem=home to the build-args works, but this is not allowed when publishing to Flathub, so the only solution at the moment is to add it to the manifest file temporarily for local development and then remember to remove it before pushing to Flathub. My particular use case involves building an app that, thanks to some massive C dependencies, can take upwards of 20+ minutes to build. With cache access, builds after the first one take less than 5 seconds.

If it was possible to specify extra build-options, such as with a --build=--filesystem=home --build=--env=CC=gcc, it would make this much easier and less error-prone.

An alternative that I would be O.K. with, though it would be less flexible, would be some option similar to --ccache that allows each local build to re-use a cache specifically for the build sandbox. The cache wouldn't benefit at all from usage of Go outside of building the current package, but at least repeat builds of the package would be much, much faster. The cache location can be changed via the $GOCACHE environment variable, so that shouldn't be too hard to do.

@TingPing
Copy link
Member

If it was possible to specify extra build-options, such as with a --build=--filesystem=home --build=--env=CC=gcc, it would make this much easier and less error-prone.

This is the same thing as build-args. It is obviously a security bypass.

You'll need a smarter option that deals with cache directories in some way.

@TingPing TingPing changed the title [Feature request]: mechanism to pass arguments to flatpak build from the command line Solution for sharing a build cache between modules, e.g. for Go Mar 13, 2023
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

No branches or pull requests

2 participants