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

conan package registry and header only packages #27090

Closed
lukester1975 opened this issue Sep 15, 2023 · 2 comments · Fixed by #27092
Closed

conan package registry and header only packages #27090

lukester1975 opened this issue Sep 15, 2023 · 2 comments · Fixed by #27092

Comments

@lukester1975
Copy link

Description

Header only conan packages can generate an empty conaninfo.txt, due to

def package_id(self):
    self.info.clear()

gitea is currently ignoring such files, which appears to be due to

if buf.Size() == 0 {
// ignore empty uploads, second request contains content
jsonResponse(ctx, http.StatusOK, nil)
return
}
which breaks the conan client when trying to consume such packages:

tuplet/2.1.1: ERROR: Exception while getting package: da39a3ee5e6b4b0d3255bfef95601890afd80709
tuplet/2.1.1: ERROR: Exception: <class 'conans.errors.ConanException'> Corrupted tuplet/2.1.1:da39a3ee5e6b4b0d3255bfef95601890afd80709 in 'external' remote: no conaninfo.txt
ERROR: Corrupted tuplet/2.1.1:da39a3ee5e6b4b0d3255bfef95601890afd80709 in 'external' remote: no conaninfo.txt

Removing the above block in conan.go allows the empty conaninfo.txt to be stored in the registry, and the conan client works successfully.

Whether there are any other side effects of removing the check I couldn't say... seems OK so far though.

Thanks

Gitea Version

1.20.4

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

N/a

Operating System

Linux

How are you running Gitea?

N/a but Fedora 38, systemd, custom build.

Database

MySQL/MariaDB

@KN4CK3R
Copy link
Member

KN4CK3R commented Sep 15, 2023

While implementing the Conan registry I noticed the conan client uploads empty files in a first request and with content in the second request. Therefore I ignored these requests. Will test it again, maybe this will work:

	isConaninfoFile := filename == conaninfoFile

	if buf.Size() == 0 && !isConaninfoFile {
		// ignore empty uploads, second request contains content
		jsonResponse(ctx, http.StatusOK, nil)
		return
	}

@KN4CK3R
Copy link
Member

KN4CK3R commented Sep 15, 2023

Looks like the Conan CLI has changed since last year. My package creation instructions don't work anymore and the empty uploads don't occur anymore.

lafriks pushed a commit that referenced this issue Sep 15, 2023
Fixes #27090

Looks like the Conan upload process has changed since last year. The
empty uploads don't occur anymore.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants