News for hackers. Stuff that matters.
Re:From xz to ibus: more questionable tarballs by andersa on Tuesday April 02, 2024 @03:56AM (#39903320)
Why is this a thing? Can't packages use specific tags from the git repo? It seems so incredibly stupid to allow this, throwing out all of the "oh but it's open source you can review it" arguments in one go if the source displayed on GitHub is not what ends up used...
Re:From xz to ibus: more questionable tarballs by atlasduo on Tuesday April 02, 2024 @04:32AM (#39903504)
Tags can be changed. To actually pin the source code revision, they should pin to a specific commit hash.
Re:From xz to ibus: more questionable tarballs by viraptor on Tuesday April 02, 2024 @04:38AM (#39903535)
Sometimes they get changed for a silly reason (someone just didn't think of the consequences). Sometimes they get changed because they have to - if I remember correctly it was Asterisk that needed to drop some copyrighted music samples and retagged old versions.
Re:From xz to ibus: more questionable tarballs by gunapologist99 on Tuesday April 02, 2024 @08:09AM (#39904825)
That shouldn't matter, then; it should just result in a new release.
Re:From xz to ibus: more questionable tarballs by viraptor on Tuesday April 02, 2024 @08:28AM (#39904944)
You can't distribute the old versions with copyright violation. The problem doesn't go away just because you released a new version.
Re:From xz to ibus: more questionable tarballs by nilamo on Tuesday April 02, 2024 @09:27AM (#39905513)
But then you have two different things (with and without copyrighted data) both with the same version. Wouldn't it be better to just remove the bad release, and publish a new one? They are, after all, not the same things, and shouldn't have the same release.
Re:From xz to ibus: more questionable tarballs by andersa on Tuesday April 02, 2024 @04:41AM (#39903550)
Good point, that would make sense. But same difference. Why is that not how it works?
Re:From xz to ibus: more questionable tarballs by senectus1 on Tuesday April 02, 2024 @04:47AM (#39903586)
my understanding is for speed reasons most distro's dont build from the source they build from tarballs.

If they built from the source there wouldn't be this issue.

Re:From xz to ibus: more questionable tarballs by martijnvds on Tuesday April 02, 2024 @05:22AM (#39903778)
The tarballs also contain source. Just not the source control/revision history.
Re:From xz to ibus: more questionable tarballs by ZiiS on Tuesday April 02, 2024 @05:38AM (#39903864)
Do you mean if they built from a git hash? The tarball contains "Source code" which is what they are building.
Re:From xz to ibus: more questionable tarballs by bbarnett on Tuesday April 02, 2024 @05:29AM (#39903813)
If by "source" you mean the project's version controlled repo, it is for a variety of reasons.

One primary one is, sustainability. The build tarballs are kept forever. Try that with a remote repo that could vanish in a mere 10 or 20 years.. or tomorrow!

And tar is the most stable archive format in existence, with at least half a century of use.

note: Companies that care, should ask themselves what do you do, if you have a build system which relies upon externals, and a part of that build goes down?

And you have an urgent fix to PROD required?

Hope you can find all the bits, unvarnished, scattered on dev boxes? Cobble them together and hope they build, while your PROD is currently borked?

Or do you hotpatch PROD?

If your build process breaks due to an external repo going MIA, then you're doing it wrong.

Re:From xz to ibus: more questionable tarballs by mjochim on Tuesday April 02, 2024 @05:30AM (#39903821)
The path from source code to distributed binary file is known to be a blind spot.

Removing that blind spot is either Harder Than You'd Think or Easier Than You'd Think, depending on your perspective and expectations. You can find some issues listed here:

https://reproducible-builds.org/docs/

Or the homepage of reproducible-builds.org for a general take on the subject. (I am not associated with that website.)

Re:From xz to ibus: more questionable tarballs by ncruces on Tuesday April 02, 2024 @05:36AM (#39903852)
Definitely Harder Than You'd Think and we've known this for a very long time.

https://research.swtch.com/nih

Re:From xz to ibus: more questionable tarballs by segfaultbuserr on Tuesday April 02, 2024 @05:36AM (#39903847)
Historically, it was done for end-user convenience. Traditionally, each project has two separate sources, one is the actual development repository, strictly for use by developers. The next is the source tarball for end-user installation, pre-generated by developers by preprocessing the source repo - such as autotools script generation, gettext translation file generation, etc. The idea was that the end users were running on many flavor of incompatible Unix systems, so installing the full development tools such as autotools or CVS/SVN could be inconvenient. To avoid those troubles, developers pre-generate tarballs with necessary installation scripts such as ./configure for user-friendliness - so source tarballs are installers in a sense, at the middle way between actual source and pre-complied binary. On the other hand, because these scripts are machine-generated and are extremely sensitive to small chances to Makefiles, they should not pollute the canonical source tree, so they're not included in the source repository. Occasionally, under the strict Cathedral style of software development, the canonical source tree may even be private under exclusive access by the core team, end users only have access to release tarballs.

Nowadays, the repo-tarball split is largely unnecessary, but the practice remains. The xz incident became a wake-up call that the Reproducible Build movement focused on binary reproducibility, but have so far ignored tarball reproducibility. Hopefully, this problem will be addressed by the community in the future.

Re:From xz to ibus: more questionable tarballs by mid-kid on Tuesday April 02, 2024 @06:56AM (#39904334)
> Nowadays, the repo-tarball split is largely unnecessary

I think locking the source distribution mechanism to only git would be detrimental in the grand scheme. A source tarball is universal, independent of preferred tooling, easy to hash, sign and verify, and archive. Even git has loopholes in that a tag does not necessarily have to be a part of the master branch, and not everyone uses (or wants to use) github, or a similar online interface for git...

It's also worth considering that source generation tools are often keen to changing their API frequently, while their output is more weaponized against the passage of time. Autotools is significantly better about that these days, but many other tools aren't...

Re:From xz to ibus: more questionable tarballs by kevincox on Tuesday April 02, 2024 @07:08AM (#39904395)
I think most packagers that can pull from Git can also pull from Mercurial, SVN or whatever else.

Pulling from Git doesn't really require using GitHub other than connecting to their IP. You don't need an account or any tool other than Git to clone a public repo.

It seems to me that pulling directly from the primary source of truth is a good idea these days where possible.

Re:From xz to ibus: more questionable tarballs by kruador on Tuesday April 02, 2024 @08:04AM (#39904787)
The Git protocol is also substantially more heavyweight than just downloading a tarball.

'Dumb' HTTP involves requesting `info/refs` which lists all the references (branches and tags) available. The client has to find the tag you want, then request the corresponding commit object. That lists the hash of the tree object, which has to be requested, and recursively the tree object references other trees and finally the file blobs.

Any object request could fail because the object isn't stored 'loose' on disk, but is instead in a pack. So the client first downloads `objects/info/http-alternates` to see if it's in a different location, then if that doesn't list anything, it asks for the list of packs `objects/info/packs`. Then it asks for the index of each pack to determine which pack contains the object, then finally downloads that pack.

Because that's very slow, Git also supports 'Smart' HTTP. That moves all the lookups server-side, with a back-and-forth between client and server about what the client has and what it wants, ultimately building a custom pack containing what you asked for. This obviously can't be cached.

In contrast a tarball is one request for one file on disk which is fully cacheable, both by the server hosting the file and any proxies on the path.

This is why things like `bower` and `DefinitelyTyped` got deprecated. Some of them were even hosting the registry itself as a Git repository on GitHub.

Re:From xz to ibus: more questionable tarballs by Kwpolska on Tuesday April 02, 2024 @08:11AM (#39904836)
GitHub/GitLab can generate tarballs from specific git commits, and those are cacheable and don’t change (when GitHub deployed some changes to the format, many places noticed and GitHub had to undo the changes).
Re:From xz to ibus: more questionable tarballs by mid-kid on Wednesday April 03, 2024 @06:34AM (#39915635)
That's just a shortcut to the conventional tarball distribution method.
Re:From xz to ibus: more questionable tarballs by weinzierl on Tuesday April 02, 2024 @06:53AM (#39904318)
"The xz incident became a wake-up call that the Reproducible Build movement focused on binary reproducibility, but have so far ignored tarball reproducibility."

The reproducibility must stretch over all the outputs.

A related idea is the Hermetic Build", where the sameness of all the input is ensured, even including the build tools.

Re:From xz to ibus: more questionable tarballs by yencabulator on Tuesday April 02, 2024 @12:55PM (#39907991)
In this case, inputs, or more like the whole chain toward "real inputs".

A project can be reproducible when built from the release tarball, without being able to reproduce the release tarball from a git tag.

Re:From xz to ibus: more questionable tarballs by tutfbhuf on Tuesday April 02, 2024 @06:43AM (#39904245)
Wouldn't it be possible to incorporate a security-focused GPT¹ into the CI Pipeline and have the code automatically checked? I'm not sure if anyone has integrated the backdoor from Jia Tan into GPT-4 or something similar, but I wouldn't be surprised if GPT-4 could detect such backdoors. Maybe I'm completely wrong, but if so, please tell me in a comment and do not downvote just because I mention AI.

[^1]: https://securitysentinel.substack.com/p/awesome-gpts-agents-...

Re:From xz to ibus: more questionable tarballs by loloquwowndueo on Tuesday April 02, 2024 @07:13AM (#39904418)
We don’t understand how AI works. I would not trust an AI to not hallucinate unsafely in this context.
Re:From xz to ibus: more questionable tarballs by zopa on Tuesday April 02, 2024 @07:26AM (#39904507)
You wouldn’t want it in the CI pipeline, because any model clever enough to find real issues is also going to find plenty of false positives. That seems like too much friction for most open source projects.

I’m not one of the downvoters, but you’ve linked to a list of forty or fifty different projects, many of which don’t seem relevant to this use-case. It’s not too surprising people have nothing to say besides “ugh, more AI hype.”

Re:From xz to ibus: more questionable tarballs by VMG on Tuesday April 02, 2024 @07:58AM (#39904745)
You are wrong but there is no reason to downvote you. The idea might work in the future.
Re:From xz to ibus: more questionable tarballs by Kwpolska on Tuesday April 02, 2024 @08:17AM (#39904875)
It might work if AI stops producing random output and bullshit (which proponents call hallucinations to make it sound nice), and produces correct responses deterministically. Which may take forever.
Re:From xz to ibus: more questionable tarballs by lamontcg on Tuesday April 02, 2024 @01:00PM (#39908062)
> Nowadays, the repo-tarball split is largely unnecessary, but the practice remains.

I keep seeing this argument, but I don't understand why CI runners can't generate the configure script rather than offloading that onto the end user requiring them to have autotools/automake/autoconf/m4/etc

If you've ever tried to fight with that on an decade old enterprise system, those tarballs with configure scripts in them are useful. They get generated with new tooling on modern distros, but run on ancient systems. Getting the right versions installed can be an absolute pain in the ass.

Re:From xz to ibus: more questionable tarballs by gwd on Tuesday April 02, 2024 @07:46AM (#39904645)
For Xen, it's historical reasons funneled into "don't break things for your users". In the olden times, Xen had our own fork of QEMU, as well as our own fork of Linux, and some other useful tools like pvgrub. These were developed in a separate repository, but it was imported into the main Xen release tarball, so that you could just download the main tarball, do "./configure && make && make install" and have a reasonably complete Xen system.

These days most Linux kernels can do everything we need, and our release tag of QEMU might only be one or two patches not yet in the upstream branch; and in any case, you can always use the most upstream release. So this isn't necessary anymore (and indeed we only include QEMU in the release tarball, not Linux or pvgrub). And you can still "./configure && make && make install" to get a fairly complete system, it will just clone other repositories on your behalf.

On the other hand, I actually checked just last month, and the tarball for Xen 4.18.0, released back in November, was getting 700 downloads a week. Who are all these people downloading the release tarball, rather than using the distro version of Xen? Do they want and need these extra bits inside? We don't know and were hesitant to make any breaking changes.

I think with the xz fiasco, we now have justification to switch entirely to a `git archive` tarball of a specific tag, whether it's inconvenient for people or not.

Re:From xz to ibus: more questionable tarballs by brendank310 on Tuesday April 02, 2024 @08:31AM (#39904967)
It's been probably 2 years since I've messed with it, but I was still using the tarball download for Xen in OpenEmbedded builds.
Re:From xz to ibus: more questionable tarballs by mkj on Tuesday April 02, 2024 @08:14AM (#39904853)
Software projects will outlive git. Mine has gone CVS -> Monotone -> Mercurial -> Git over 20 years, it'll probably move again. But you can still download the tarballs from any of the releases made with those various systems, and they still have the same sha1sum (or now sha256sum).

Making reproducible tarballs from VCS isn't hard - with the advice from https://reproducible-builds.org/docs/archives/ (and requiring gnu tar) it's possible to get byte exact output from both Mercurial or git mirrors, on both Linux and MacOS. Put that in the github CI and it's reasonably difficult to subvert (compare against a local build too at release time).

It would be nice if "git archive" had guarantees about archive format, and if the github "download a tar.gz" matched that, but it doesn't seem to be the case at present.