Can't upload amd64 and arm64 packages since the orig file name is the same. Error : nameX_2023.04.orig.tar.gz already exists.

Asked by neodix

Creating a source package with binaries included, and can't upload amd64 and arm64 packages with different original sources since the name of orig file is the same (even though the files inside are different).

Getting an Error : nameX_2023.04.orig.tar.gz already exists.

I would expect to have a package named nameX_2023.04-arm64.orig.tag.gz and nameX_2023.04-amd64.orig.tar.gz inside each dsc and source.changes files.

Building in separate folders for each architecture
arm64 debian/control file:
...

Package: nameX
Architecture: arm64
Multi-Arch: same # not sure about it, still produces orig file without arch included
...

amd64 debian/control file:
...

Package: nameX
Architecture: amd64
...

after executing:
debuild -sa -Zxz -S -us -uc -i -I
both produce the same nameX_2023.04.orig.tar.gz and after dput getting an email:

Rejected:
File nameX_2023.04.orig.tar.gz already exists in ton, but uploaded version has different contents. See more information about this error in https://help.launchpad.net/Packaging/UploadErrors.
Files specified in DSC are broken or missing, skipping package unpack verification.

Need to highlight, that the artifact does not include any sources, it uses include-binaries to include precompiled with NixPkgs binaries.

Could you please advise on how to do it properly, so that PPA accepts the same version of two packages (with different source files per architecture)?

Question information

Language:
English Edit question
Status:
Solved
For:
Launchpad itself Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
neodix (ton-foundation) said :
#1

I can upload each architecture of the package with a different version without any problems. They are accepted and visible. But since the versions are different the latest package supersedes the previous with other architecture.

Revision history for this message
Colin Watson (cjwatson) said :
#2

Source packages are generally expected to produce binaries for multiple architectures. If I were you, I wouldn't be trying to create multiple source packages for different architectures at all, but instead I'd include both precompiled amd64 and arm64 binaries in the same source package - then your debian/rules machinery can select the right set of binaries to package up.

Revision history for this message
Colin Watson (cjwatson) said :
#3

(Also "Multi-Arch: same" is totally unrelated to any of this, and is for library packages where it makes sense and is possible to simultaneously install the same package for multiple architectures. See https://wiki.ubuntu.com/MultiarchSpec. From what I understand this is not what you want.)

Revision history for this message
neodix (ton-foundation) said :
#4

Thanks for the quick response, Colin.
I guess I lack understanding of how that orig package is used.
Currently, I am using debian/source/include-binary file with the list of files I want to include, e.g. content:

debian/usr/bin/file1
debian/usr/bin/file1

then before executing rebuild -S I copy the binaries into debian/usr/bin and upon execution, the binaries get included. My rule file stays empty:

#!/usr/bin/make -f
%:
 dh $@

is the orig file somehow used/downloaded overall within installation?

>then your debian/rules machinery can select the right set of binaries to package up.
can it recognize architecture from the file name or should I write a rule (e.g. using "if DEB_BUILD_ARCH") where I filter the binaries?

Thanks for Multi-Arch explanation!

Revision history for this message
neodix (ton-foundation) said (last edit ):
#5

Tried a few things here.

After building and uploading amd64 package with version 2023.05.1, I built arm64 package with the same version using the same orig file as for amd64, but different binaries (ones of arm64 copied to debian/usr dir).

Like expected, uploading the second package with dput I get an error:

Package has already been uploaded to ppa on ppa.launchpad.net
Nothing more to do for ../ton_2023.05.1-1_source.changes

I can't understand how to tell dput that this is not the same package. Orig file is the same, but the content of the package is different.

ok, like you said, let's put everything in one package, and hopefully within an installation with apt install, debian/rules will recognize what to install, still in the process of testing this.

Revision history for this message
Manfred Hampl (m-hampl) said :
#6

You seem to confuse meaning and contents of the sourcename.origversion.orig.tar.gz and the sourcename.debversion.debian.tar.gz files.

sourcename.origversion.orig.tar.gz should be the original source, as found upstream (e.g. on github).

sourcename.debversion.debian.tar.gz should contain everything that is needed to create the debian packages for all architectures from the source package (i.e. the control file, rules file, config files listing the files to install, etc.).

You can upload the same source file with the same number several times, if the contents stay the same:
If you try building from a certain source (e.g. origversion 2023.04) and if that fails because of errors in your rule file, then you can (and should) upload the identical source file again, with the same number and the same content, but together with a new debian file with a different debversion number (e.g. appending -1, -2, -3 etc. making the debversion number 2023.04-1, 2023.04-2 and so on).

Revision history for this message
neodix (ton-foundation) said :
#7

Manfred, that seemed to be the point I missed. Thanks! That helped.

So basically with the help of Colin and Manfred, I managed to upload a common orig file with arm64 and amd64 binaries. Then next to it with different revisions I uploaded arm64 and amd64 packages. All works. Although only one revision is visible in the dashboard, the first one is superseded.

Here comes the problem. In the dashboard, I can see and select only the package with the latest revision.
So I picked "ton - 2023.05.5001-2 - Jammy - arm64" and copied it to Focal - all worked.
Now I want to Copy package "ton - 2023.05.5001-1 - Jammy - amd64" to Focal, but I cannot select it.

So the question now is - how to copy the package with the previous revision with a different arch to another distro?

https://launchpad.net/~ton-foundation/+archive/ubuntu/ppa/+packages

Revision history for this message
Best Manfred Hampl (m-hampl) said (last edit ):
#8

What you are doing (uploading binaries inside the debian tarball) is a very unusual way of using Launchpad PPAs.

The "normal" way is uploading the original source (in the "orig" tarball) and the instructions how to compile and package the software in the debian tarball (including the instructions for all architectures). After a new upload, all architectures are then automatically built simultaneously.

Why are you deviating from the normal ways of working?

If you really need to upload the binaries, then you have to include the binaries for all architectures together in the same debian zip file and rewrite the instructions that they work for all architectures. It does not make sense to create architecture-specific uploads.

Maybe something like that:
put the amd64 binaries into a directory below /debian/bin/amd64/ and those for arm64 below /debian/bin/arm64/ and then set a rule like "cp /debian/bin/$(arch)/* /usr/bin/"

Revision history for this message
neodix (ton-foundation) said :
#9

Manfred, for me, it looked logical to create a package per architecture, this thing " all architectures are then automatically built simultaneously.: is not obvious I would say.

So I put all binaries of both architectures inside orig file, changed in the control file Architecture to any, and to my surprise Launchpad recognized that I have binaries of two arch (or maybe because I simply marked the checkbox in the profile) and executed builds for both arch.

One build for arm64 failed with the error:
"strip: Unable to recognize the format of the input file.."
but this is another story. Nix is already stripping the files, so I need to skip that step, I guess by overriding dh binary-arch rule with the whole list with excluded dh_strip step.

Revision history for this message
neodix (ton-foundation) said :
#10

Even though the documentation of building ppa packages could have been improved, the support here is awesome.
Thank you Colin and Manfred for the quick and prompt support!

Revision history for this message
neodix (ton-foundation) said :
#11

Thanks Manfred Hampl, that solved my question.