Skip to content

sdl2_image: fix downloading#3135

Merged
clayote merged 5 commits into
kivy:developfrom
T-Dynamos:sdl2_image_fix
May 14, 2025
Merged

sdl2_image: fix downloading#3135
clayote merged 5 commits into
kivy:developfrom
T-Dynamos:sdl2_image_fix

Conversation

@T-Dynamos

Copy link
Copy Markdown
Member
[DEBUG]:        Cloning into 'external/libpng'...
[DEBUG]:        remote: Enumerating objects: 109787, done.
remote: Counting objects: 100% (11/11), done.
remote: Compressing objects: 100% (6/6), done.
error: RPC failed; curl 92 HTTP/2 stream 5 was not closed cleanly: CANCEL (err 8)
[DEBUG]:        error: 3705 bytes of body are still expected
[DEBUG]:        fetch-pack: unexpected disconnect while reading sideband packet
[DEBUG]:        fatal: early EOF
[DEBUG]:        fatal: fetch-pack: invalid index-pack output

Ref: #3115 (comment)

@misl6

misl6 commented Apr 8, 2025

Copy link
Copy Markdown
Member

Tried a build (without this PR) a few hours ago and worked flawlessly, is this patch still required on your side?

@T-Dynamos

Copy link
Copy Markdown
Member Author

This happens on slow internet connections only. Also it prevents download of commit history for all submodules.

@AndiEcker

AndiEcker commented Apr 9, 2025 via email

Copy link
Copy Markdown

@T-Dynamos

Copy link
Copy Markdown
Member Author

@clayote Thanks for taking over this.

Please do confirm if same fix is needed for sdl3_image.

@clayote

clayote commented May 12, 2025

Copy link
Copy Markdown
Contributor

I don't know a lot about sdl3 or even 2, really. The PR looks good, and it only affects the downloading stage, so I figured I'd tidy it a bit.

@clayote

clayote commented May 12, 2025

Copy link
Copy Markdown
Contributor

@AndiEcker I don't have a slow connection to test on, could you confirm that this PR fixes your issue?

@AndiEcker

AndiEcker commented May 13, 2025 via email

Copy link
Copy Markdown

@T-Dynamos

T-Dynamos commented May 13, 2025

Copy link
Copy Markdown
Member Author

@AndiEcker

p4a.fork = T-Dynamos
p4a.branch = sdl2_image_fix

@AndiEcker

AndiEcker commented May 13, 2025 via email

Copy link
Copy Markdown

@AndiEcker

AndiEcker commented May 14, 2025 via email

Copy link
Copy Markdown

@clayote clayote merged commit be3de2e into kivy:develop May 14, 2025
@kengoon

kengoon commented May 15, 2025

Copy link
Copy Markdown
Contributor

@T-Dynamos I think same should be done for sdl3_image

Comment on lines +23 to +40
build_dir = self.get_build_dir(arch.arch)

with open(os.path.join(build_dir, ".gitmodules"), "r") as file:
for section in file.read().split('[submodule "')[1:]:
line_split = section.split(" = ")
# Parse .gitmodule section
clone_path, url, branch = (
os.path.join(build_dir, line_split[1].split("\n")[0].strip()),
line_split[2].split("\n")[0].strip(),
line_split[-1].strip()
)
# Clone if needed
if not os.path.exists(clone_path) or not os.listdir(clone_path):
shprint(
sh.git, "clone", url,
"--depth", "1", "-b",
branch, clone_path, "--recursive"
)

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.

I should have commented that before, but when it's not that obvious what the code is doing, a comment is always helpful.
Maybe we could have added a block comment or method docstring saying:

# Prevents downloading commit history of all submodules, to improve cloning reliability on slow internet connection

@AndreMiras

Copy link
Copy Markdown
Member

Thanks @AndiEcker for testing this too and thank you @T-Dynamos for making the fix 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants