Skip to content

Fetch only#1792

Open
Ytsejam76 wants to merge 1 commit into
wingtk:mainfrom
Ytsejam76:fetch-only
Open

Fetch only#1792
Ytsejam76 wants to merge 1 commit into
wingtk:mainfrom
Ytsejam76:fetch-only

Conversation

@Ytsejam76

@Ytsejam76 Ytsejam76 commented Jul 3, 2026

Copy link
Copy Markdown

This PR adds support for downloading all required sources separately from the build and then building without network access.

It introduces:

  • --fetch-only is the cache/mirror population mode. It can run on Linux or any other host, and its job is to download the sources and create the git mirror archives.

  • --offline is still a build mode. It avoids network access by reusing the already downloaded sources and mirror archives, but it keeps the normal build-environment requirements on Windows.

Example:

gvsbuild --fetch-only --archives-download-dir /path/to/sources gtk4

The source directory can then be copied to the build machine:

gvsbuild build --offline \
    --archives-download-dir C:\gvs-sources \
    gtk4

Git-based projects are stored as archives containing the complete repository, including submodules and revision information, so they can be restored without contacting the remote server.

The download command also skips Windows-specific build-tool checks, making it possible to prepare the source cache on another platform.

@Ytsejam76 Ytsejam76 force-pushed the fetch-only branch 2 times, most recently from 924e994 to 7e8788d Compare July 3, 2026 22:02

@danyeaw danyeaw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hi @Ytsejam76, thanks for the contribution.

Could you please explain what the use case of this feature is and what motivated you to implement it?

Could you please also update the README to explain the feature and how it is supposed to work as docs for the change?

Comment thread gvsbuild/build.py Outdated
Comment thread gvsbuild/utils/offline_repos.py Outdated
Comment thread gvsbuild/utils/builder.py Outdated
@Ytsejam76 Ytsejam76 force-pushed the fetch-only branch 2 times, most recently from fee6f82 to c08a83c Compare July 4, 2026 17:33
@Ytsejam76

Copy link
Copy Markdown
Author

Hi @Ytsejam76, thanks for the contribution.

Could you please explain what the use case of this feature is and what motivated you to implement it?

Could you please also update the README to explain the feature and how it is supposed to work as docs for the change?

I added some paragraphs in the README.

@danyeaw danyeaw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hey @Ytsejam76, this is looking really good. Just a couple of suggestions.

Comment thread gvsbuild/utils/offline_repos.py Outdated
Comment thread gvsbuild/build.py
Comment thread gvsbuild/utils/offline_repos.py Outdated
@Ytsejam76 Ytsejam76 force-pushed the fetch-only branch 2 times, most recently from d102320 to e8fba6b Compare July 4, 2026 23:33
@Ytsejam76

Copy link
Copy Markdown
Author

I added those. I wonder whether a squash would look better but I leave it as it is.

@Ytsejam76 Ytsejam76 force-pushed the fetch-only branch 2 times, most recently from 7a945e5 to 8be5f5a Compare July 7, 2026 17:23
--fetch-only downloads and hash-checks source archives without building.
It does not require the build toolchain (msys2, Visual Studio) so it can
run on any platform, e.g. to populate a source mirror.

--offline builds using only pre-downloaded sources (no network). Git-based
projects are archived into <archives-download-dir>/git/<name>-<commit>.git.zip
and restored without network access. A missing source aborts the build.

Also makes script_title() a no-op off Windows where ctypes.windll is absent.
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.

2 participants