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

How to enable online-mode for build-commands? #628

Closed
sequencerr opened this issue Jan 16, 2025 · 5 comments
Closed

How to enable online-mode for build-commands? #628

sequencerr opened this issue Jan 16, 2025 · 5 comments
Labels

Comments

@sequencerr
Copy link

  1. if you re-read the documentation you will learn that the build is offline. Which is exactly what is happening.

Originally posted by @hfiguiere in flatpak/flatpak#2855 (comment)

https://docs.flatpak.org/en/latest/flatpak-builder-command-reference.html

Permissions:
Builds have the --allow=devel and --allow=multiarch permissions that regular flatpak runs don't have by default. This limits the syscall filtering that is normally done so development tools like debuggers work. Otherwise the build sandbox is very limited, for example there is no network access.

Though devel feature is only about developer tools, I don't understand why network mentioned in that context. I have network connection to sources: type: git for example, to resolve dns github.com and download repo, but not to wget [something] in build-commands.
devel: Allow system calls used by development-oriented tools such as perf, strace and gdb.

flatpak-builder doesn't have --allow flag
https://docs.flatpak.org/en/latest/flatpak-command-reference.html#flatpak-run
and flatpak run --allow=devel org.flatpak.Builder doesn't help

Other that I can't find anything in docs/reference about network isolation during build.

@TingPing
Copy link
Member

build-options:
  build-args: ['--share=network']

@TingPing
Copy link
Member

TingPing commented Jan 21, 2025

but not to wget [something] in build-commands.

In case it wasn't obvious, you would do this with:

sources:
  - type: archive
    url: ...
    sha256: ...

Using wget doesn't make sense.

@sequencerr
Copy link
Author

Thank you!

but not to wget [something] in build-commands.

In case it wasn't obvious, you would do this with:

sources:
  - type: archive
    url: ...
    sha256: ...

Using wget doesn't make sense.

It was example of course. I need some build system tools like maven or gradle to install packages while building.

@sequencerr
Copy link
Author

BTW: you also need to remove --sandbox flag from flatpak-builder cli.

@TingPing
Copy link
Member

There are some scripts that generate a static list of downloads for tools like gradle: https://github.com/flatpak/flatpak-builder-tools

If you want to publish on Flathub you'd have to use them. But for your own usage it might not be worth it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants