This is true in the US, though the process is tied to copyright - any copyrighted work (including software) distributed in the US needs to be deposited with the Library of Congress.
I think the most difficult issue with distributing these to the general public would be classifying abandoned vs. maintained copyrighted works.
Just to be clear, failure to meet the requirements of Mandatory Deposit has not historically affected your copyright status.
> any copyrighted work (including software) distributed in the US needs to be deposited with the Library of Congress.
This is overstating things. It's unlikely that the LOC really wants your stuff, and if it does, it will let you know by sending you a Notice of Mandatory Deposit. Until then, "Mandatory" doesn't really mean mandatory.
Also, you don't need to register the work to receive copyright protection. If you write some code put it up on Github without a license, that's your code and you have the right to deny people the right to use it (among other
rights). It's probably going to be difficult to prove that some random person is using your code, but that doesn't affect your rights in the code, because you fulfilled all the requirements to create those rights: you (1) created something and (2) fixed it in a tangible form.
As I mentioned, registration isn't necessary, though it does get you some presumptions that would be helpful if you ever end up in court.
Note, this is just to register your copyright. My understanding is that you still own the copyright if you don't register, but it's weaker in many ways, so when people expect there to be money involved, they usually register the copyright.
In practice, my understanding is that if it's distributed by a serious company, it's usually a registered copyright, and so the library of congress gets a copy.
Mandatory deposit applies regardless of registration; it's just that registration requires sending a copy, which satisfies the mandatory deposit rules.
"Mandatory deposit (17 U.S.C. section 407) requires the owner of copyright or the exclusive right of distribution to deposit in the Copyright Office for the use of the Library of Congress two complete copies of the best edition within 3 months after a work is published. Section 408 of the copyright law, for a fee, provides the option to formally register the work with the U.S. Copyright Office. This registration process provides a legal record of copyright ownership as well as additional legal benefits in cases of infringement. Optional registration fulfills mandatory deposit requirements."
Then later:
"Yes. Under certain circumstances, special relief from deposit requirements may be granted. The grant of special relief is discretionary with the U.S. Copyright Office and will depend on a careful balance of the acquisition policies of the Library of Congress, the examining requirements of the Copyright Office (if registration is sought), and the hardship to the copyright owner."
Note that "if registration is sought" - even if you're not registering, you still need to apply for an exemption.
"Neither the deposit requirements of this subsection nor the acquisition provisions of subsection (e) are conditions of copyright protection."
Which is to say, of course, that you are right, however you don't lose copyright protection if you don't comply. - it looks like there are no penalties until they ask you for a copy.
This lines up with my understanding that if you are serious business, the LOC gets a copy. If not? it doesn't really matter, and if you become a big deal later, well, following the rules helps you establish provenance, but isn't required for protection.
"This law requires that two copies of the best edition of every copyrightable work published in the United States be sent to the Copyright Office within three months of publication. Works deposited under this law are for the use of the Library of Congress."
"As described in Circular 61, the deposit requirement for registration is one copy of identifying portions of the computer program. However, to satisfy the mandatory deposit under section 407, a "complete copy" of the published work must be deposited. A complete copy is defined in the regulations as a copy that includes all components that make up the unit of publication, even if any of those units are in the public domain. So, if the published user guide is normally part of a package that contains other elements, then the mandatory deposit requirement requires the deposit of those other elements, too. For example, if the user guide is published as part of a package that contains a CD-ROM, an installation guide, and installation software, then each of these other elements must be deposited in addition to the user guide to fulfill the mandatory deposit requirement."
I think the most difficult issue with distributing these to the general public would be classifying abandoned vs. maintained copyrighted works.