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

Building without network access #3412

Closed
jpalus opened this issue Nov 7, 2021 · 6 comments
Closed

Building without network access #3412

jpalus opened this issue Nov 7, 2021 · 6 comments

Comments

@jpalus
Copy link

jpalus commented Nov 7, 2021

For distribution packaged software it is desirable to do compilation in an isolated environment without network access (reproducible builds, no risk of downloading malicious code etc). In latest devilutionx version (1.3.0) that is no longer possible since ie asio must be downloaded. Therefore would it be possible to provide "full" source tarball as a part of release including all dependencies that are otherwise downloaded?

@AJenbo
Copy link
Member

AJenbo commented Nov 7, 2021

The needed dependencies depend on the target platform. If this is desirable for you I suggest having the system that downloads the code in the first place also download the dependencies before pushing it to your build server.

@AJenbo AJenbo closed this as completed Nov 7, 2021
@StephenCWills
Copy link
Member

In latest devilutionx version (1.3.0) that is no longer possible since ie asio must be downloaded.

FYI, it's not necessary to download ASIO during the build process.
cmake -DFETCHCONTENT_SOURCE_DIR_ASIO=/path/to/asio ...

@glebm
Copy link
Collaborator

glebm commented Nov 7, 2021

First, set this option:

-DFETCHCONTENT_FULLY_DISCONNECTED=ON

This will make sure none of the FetchContent calls do any network access.

You can then specify every dependency similar to how it's done in this Linux distribution:

https://github.com/batocera-linux/batocera.linux/blob/82712b8efb498d226edeb99c0a392fb22e5bcdd9/package/batocera/ports/devilutionx/devilutionx.mk#L45-L55

There is no better way at the moment.

@jpalus
Copy link
Author

jpalus commented Nov 7, 2021

While I'm interested in particular platform it does not change the fact that I believe all sources which cannot be satisfied by system library should be included in source release. So I wouldn't mind including SDL2 in a source tarball because Android needs it. Not up to me though. Thanks for the tips with FETCHCONTENT_* vars -- I will start maintaining dependencies manually.

@AJenbo
Copy link
Member

AJenbo commented Nov 7, 2021

Including them in git will affect performance during development, if you develop a script for generating a full tarball you are welcome to open a PR with it. It's worth noting that we do checksum validation on dependencies so reproducible builds are assured as the build will fail if they change.

pld-gitsync pushed a commit to pld-linux/devilutionX that referenced this issue Nov 15, 2021
- prepare dependencies manually since otherwise they are fetched over
  network (also see diasurgical/devilutionX#3412)
- updatream patch for using system SDL2_image (from
  diasurgical/devilutionX#3386)
- patch to avoid static linking of libstdc++
@glebm
Copy link
Collaborator

glebm commented Nov 28, 2021

@jpalus DevilutionX now provides a full source tarball that includes all the FetchContent dependencies and devilutionx.mpq.
This makes packaging it a lot easier, e.g. batocera-linux/batocera.linux#5146

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

4 participants