Skip to content

sdl2_image: fix downloading #3135

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

Merged
merged 5 commits into from
May 14, 2025
Merged

sdl2_image: fix downloading #3135

merged 5 commits into from
May 14, 2025

Conversation

T-Dynamos
Copy link
Contributor

[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
Copy link
Member

misl6 commented Apr 8, 2025

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
Contributor Author

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

@AndiEcker
Copy link

AndiEcker commented Apr 9, 2025 via email

@T-Dynamos
Copy link
Contributor Author

@clayote Thanks for taking over this.

Please do confirm if same fix is needed for sdl3_image.

@clayote
Copy link
Contributor

clayote commented May 12, 2025

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
Copy link
Contributor

clayote commented May 12, 2025

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

@AndiEcker
Copy link

AndiEcker commented May 13, 2025 via email

@T-Dynamos
Copy link
Contributor Author

T-Dynamos commented May 13, 2025

@AndiEcker

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

@AndiEcker
Copy link

AndiEcker commented May 13, 2025 via email

@AndiEcker
Copy link

AndiEcker commented May 14, 2025 via email

@clayote clayote merged commit be3de2e into kivy:develop May 14, 2025
30 of 33 checks passed
@kengoon
Copy link
Contributor

kengoon commented May 15, 2025

@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
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
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