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

emacswiki snippets: cleanup #328074

Merged
merged 3 commits into from
Jul 19, 2024
Merged

Conversation

AndersonTorres
Copy link
Member

Description of changes

#278925 (comment)

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@@ -7,6 +7,8 @@ in
{
inherit (pkgs) emacspeak;

emacswiki = callPackage ./manual-packages/emacswiki { };
Copy link
Contributor

@jian-lin jian-lin Jul 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the motivation/benefit of adding emacswiki?

One disadvantage is that one package, e.g., yes-no, may remains the same even if its version changes.

Copy link
Member Author

@AndersonTorres AndersonTorres Jul 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically the source is the Emacswiki git repo.
Also, the Emacswiki can be kept frozen - their snippets are not being updated since decades.


To be honest I believe those packages should not be distributed by Nixpkgs.

They were removed from MELPA a long time ago because they were reputed insecure by design (anyone can edit a wiki). Some were migrated, others were effectively abandoned.

Essentially they are candidates for removal, per NixOS/rfcs#180

Many links documenting MELPA deleting Emacswiki

melpa/melpa#5034
melpa/melpa#5008

https://www.reddit.com/r/emacs/comments/7vocqa/comment/dtuhzmt/
https://www.reddit.com/r/emacs/comments/f4may5/why_melpa_has_decided_to_no_longer_accept_lisp/
https://www.reddit.com/r/emacs/comments/7suq6d/melpa_has_stopped_distributing_insecure_emacswiki/
https://www.reddit.com/r/emacs/comments/7vocqa/update_on_melpa_removing_emacswiki_packages_they/
https://www.reddit.com/r/emacs/comments/72b2ms/discussion_about_removing_all_emacswiki_packages/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, a somewhat hacky approach would be create GitHub repos for these snippets, at least the ones we want to keep on Nixpkgs. They can be easily extracted from EmacsWiki github.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically the source is the Emacswiki git repo.

I still do not see the benefit of inherit (emacswiki) version src; over

  src = fetchurl {
    url = "https://raw.githubusercontent.com/emacsmirror/emacswiki.org/185fdc34fb1e02b43759ad933d3ee5646b0e78f8/control-lock.el";
    hash = "sha256-JCrmS3FSGDHSR+eAR0X/uO0nAgd3TUmFxwEVH5+KV+4=";
  };

the Emacswiki can be kept frozen - their snippets are not being updated since decades.

Not sure what you mean, but emacswiki.src is updated frequently. See https://github.com/emacsmirror/emacswiki.org/commits/master/ .


To be honest I believe those packages should not be distributed by Nixpkgs.
They were removed from MELPA a long time ago because they were reputed insecure by design (anyone can edit a wiki).

IIUC, MELPA does not have a maintainer role for each of its packages. It just build and publish a package when there is a new version (snapshot or release). In this model, the code on wiki is indeed insecure.

Nixpkgs is different, we have meta.maintainers for each package. In this model, the code on wiki is secure (or less insecure).

Packages with an empty meta.maintainers can be removed or mark as insecure (with meta.knownVulnerabilities). They can be added back if someone becomes its maintainer.

Well, a somewhat hacky approach would be create GitHub repos for these snippets, at least the ones we want to keep on Nixpkgs. They can be easily extracted from EmacsWiki github.

There is no benefit of just fetching wiki packages from another source. What matters is maintenance which is the job of meta.maintainers.

The emacswiki = callPackage ./manual-packages/emacswiki { }; and inherit (emacswiki) version src; pattern actually makes wiki packages in Nixpkgs less secure because their maintainer cannot control src.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what you mean, but emacswiki.src is updated frequently. See https://github.com/emacsmirror/emacswiki.org/commits/master/ .

The EmacsWiki is modified potentially daily. However, most of Elisp codes aren't.
Indeed the perl-completion you cited was not touched since its inception nine years ago.

In this sense, we could just update this blob once a year.

The emacswiki = callPackage ./manual-packages/emacswiki { }; and inherit (emacswiki) version src; pattern actually makes wiki packages in Nixpkgs less secure because their maintainer cannot control src.

It is not hard to write something like grabEmacsWiki { rev = ""; hash = ""; }.


Nonetheless you are correct. Let's undo this.

@ofborg ofborg bot requested a review from rycee July 18, 2024 03:38
@@ -7,6 +7,8 @@ in
{
inherit (pkgs) emacspeak;

emacswiki = callPackage ./manual-packages/emacswiki { };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically the source is the Emacswiki git repo.

I still do not see the benefit of inherit (emacswiki) version src; over

  src = fetchurl {
    url = "https://raw.githubusercontent.com/emacsmirror/emacswiki.org/185fdc34fb1e02b43759ad933d3ee5646b0e78f8/control-lock.el";
    hash = "sha256-JCrmS3FSGDHSR+eAR0X/uO0nAgd3TUmFxwEVH5+KV+4=";
  };

the Emacswiki can be kept frozen - their snippets are not being updated since decades.

Not sure what you mean, but emacswiki.src is updated frequently. See https://github.com/emacsmirror/emacswiki.org/commits/master/ .


To be honest I believe those packages should not be distributed by Nixpkgs.
They were removed from MELPA a long time ago because they were reputed insecure by design (anyone can edit a wiki).

IIUC, MELPA does not have a maintainer role for each of its packages. It just build and publish a package when there is a new version (snapshot or release). In this model, the code on wiki is indeed insecure.

Nixpkgs is different, we have meta.maintainers for each package. In this model, the code on wiki is secure (or less insecure).

Packages with an empty meta.maintainers can be removed or mark as insecure (with meta.knownVulnerabilities). They can be added back if someone becomes its maintainer.

Well, a somewhat hacky approach would be create GitHub repos for these snippets, at least the ones we want to keep on Nixpkgs. They can be easily extracted from EmacsWiki github.

There is no benefit of just fetching wiki packages from another source. What matters is maintenance which is the job of meta.maintainers.

The emacswiki = callPackage ./manual-packages/emacswiki { }; and inherit (emacswiki) version src; pattern actually makes wiki packages in Nixpkgs less secure because their maintainer cannot control src.

@AndersonTorres AndersonTorres changed the title emacswiki snippets: init and cleanup emacswiki snippets: cleanup Jul 19, 2024
@AndersonTorres AndersonTorres marked this pull request as ready for review July 19, 2024 12:28
@ofborg ofborg bot requested a review from jcs090218 July 19, 2024 12:54
Copy link
Contributor

@jian-lin jian-lin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jian-lin jian-lin merged commit ad01110 into NixOS:master Jul 19, 2024
26 of 28 checks passed
@AndersonTorres AndersonTorres deleted the emacswiki branch July 24, 2024 02:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants