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

vscode version compatablity fix #48

Open
lizelive opened this issue Nov 9, 2023 · 2 comments
Open

vscode version compatablity fix #48

lizelive opened this issue Nov 9, 2023 · 2 comments

Comments

@lizelive
Copy link

lizelive commented Nov 9, 2023

  1. include a version of package compatible with the version in nixos-unstable, nixos-stable, latest
    at very least make sure to have version that works with nix-vscode-extensions.inputs.nixpkgs
  2. expose an up to date vscode / codium
  3. tag daily commit with newest version of vscode / highest min engine version.
let
  pkgs = import <nixpkgs> {};
  inherit (pkgs) lib writeTextFile;
  inherit (lib) catAttrs pipe importJSON;
  inherit (lib.lists) unique naturalSort last;

  file = ./vscode-marketplace-latest.json;
  
  text = pipe file [
    importJSON
    (catAttrs "engineVersion")
    unique
    (map (lib.strings.removePrefix "^"))
    unique
    naturalSort
    last
  ];
  output = writeTextFile { name = "engineVersion.txt"; text = text; };
in
output

gets the highest engineVersion

@deemp
Copy link
Collaborator

deemp commented Nov 9, 2023

Please, check #41. I believe addressing the compatibility problem for all extensions is doomed. nix4vscode should solve this, but maintainers didn't have enough time to finish it and deprecate this repo (#47).

@lizelive
Copy link
Author

I saw #41 and am not a huge fan of having to generate lock file for extensions.

i use this script to figure out what version to pin to

with builtins; let
  pkgs = import <nixpkgs> { };
  inherit (pkgs) lib;
  currentVersion = "1.84.2";

  checkVersion = v: all (f: f v) [
    (lib.versionAtLeast currentVersion)
    (lib.versionOlder (lib.versions.major currentVersion))
  ];

  file = ./data/cache/vscode-marketplace-latest.json;


  json = lib.importJSON file;
  packages = filter (p: lib.strings.hasPrefix "github" p.publisher) json;
  getStripVersion = x: lib.strings.removePrefix "^" x.engineVersion;
  byVersion = groupBy getStripVersion packages;
  byMajor = groupBy lib.versions.major (attrNames byVersion);

  compatableVersions = filter checkVersion (attrNames byVersion);

  versionsThisMajor = byMajor.${(lib.versions.major currentVersion)};
  tooOldFor = lib.subtractLists compatableVersions versionsThisMajor;
  howBad = lib.flatten (lib.attrVals tooOldFor byVersion);

in
trace howBad (length howBad)

is it possible include latest extensions supported by code in nixpkgs-unstable by running through the git history of the cache?

it's not hard to program. i'm just wondering if the scrapper will stay up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants