From 67f1c7775d845e94aac46c436f953cba91824464 Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Wed, 11 Dec 2024 14:45:33 +0000 Subject: [PATCH 1/2] jetbrains: fix mismatched versions for source-built packages --- pkgs/applications/editors/jetbrains/default.nix | 5 +++-- pkgs/applications/editors/jetbrains/readme.md | 2 +- pkgs/applications/editors/jetbrains/source/build.nix | 4 +++- pkgs/applications/editors/jetbrains/source/default.nix | 2 ++ 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/editors/jetbrains/default.nix b/pkgs/applications/editors/jetbrains/default.nix index 5f212cc1b679..244ca0a88db8 100644 --- a/pkgs/applications/editors/jetbrains/default.nix +++ b/pkgs/applications/editors/jetbrains/default.nix @@ -91,8 +91,9 @@ let url = products."${pname}".url; sha256 = products."${pname}".sha256; }; - inherit (products."${pname}") version; - buildNumber = products."${pname}".build_number; + version = if fromSource then communitySources."${pname}".version else products."${pname}".version; + buildNumber = + if fromSource then communitySources."${pname}".buildNumber else products."${pname}".build_number; inherit (ideInfo."${pname}") wmClass product; productShort = ideInfo."${pname}".productShort or ideInfo."${pname}".product; meta = mkMeta ideInfo."${pname}".meta fromSource; diff --git a/pkgs/applications/editors/jetbrains/readme.md b/pkgs/applications/editors/jetbrains/readme.md index c812b1d5b119..14dedbb79f49 100644 --- a/pkgs/applications/editors/jetbrains/readme.md +++ b/pkgs/applications/editors/jetbrains/readme.md @@ -20,7 +20,7 @@ To test the build process of every IDE (as well as the process for adding plugin - Source builds need a bit more effort, as they **aren't automated at the moment**: - Find the build of the stable release you want to target (usually different for pycharm and idea, should have three components) - I find this at https://jetbrains.com/updates/updates.xml (search for `product name="`, then `fullNumber`) - - Update the `buildVer` field in source/default.nix + - Update the `version` & `buildVer` fields in source/default.nix - Empty the `ideaHash`, `androidHash`, `jpsHash` and `restarterHash` (only `ideaHash` and `restarterHash` changes on a regular basis) fields and try to build to get the new hashes - Run `nix build .#jetbrains.(idea/pycharm)-community-src.src.src`, then `./source/build_maven.py source/idea_maven_artefacts.json result/` - Update `source/brokenPlugins.json` (from https://plugins.jetbrains.com/files/brokenPlugins.json) diff --git a/pkgs/applications/editors/jetbrains/source/build.nix b/pkgs/applications/editors/jetbrains/source/build.nix index 132a2c377c06..b03d450cad76 100644 --- a/pkgs/applications/editors/jetbrains/source/build.nix +++ b/pkgs/applications/editors/jetbrains/source/build.nix @@ -19,6 +19,7 @@ , pkg-config , xorg +, version , buildVer , buildType , ideaHash @@ -200,7 +201,8 @@ let in stdenvNoCC.mkDerivation rec { pname = "${buildType}-community"; - version = buildVer; + inherit version; + buildNumber = buildVer; name = "${pname}-${version}.tar.gz"; inherit src; nativeBuildInputs = [ p7zip jbr jps-bootstrap ]; diff --git a/pkgs/applications/editors/jetbrains/source/default.nix b/pkgs/applications/editors/jetbrains/source/default.nix index 53a64bdfbd95..502383dab8ce 100644 --- a/pkgs/applications/editors/jetbrains/source/default.nix +++ b/pkgs/applications/editors/jetbrains/source/default.nix @@ -3,6 +3,7 @@ { idea-community = callPackage ./build.nix { + version = "2024.1.3"; buildVer = "241.17890.1"; buildType = "idea"; ideaHash = "sha256-jWFnewxRkriSmV6CgGX1r//uaErMINfx3Z+JpkE34jk="; @@ -12,6 +13,7 @@ mvnDeps = ./idea_maven_artefacts.json; }; pycharm-community = callPackage ./build.nix { + version = "2024.1.3"; buildVer = "241.17890.14"; buildType = "pycharm"; ideaHash = "sha256-tTB91/RHEWP/ZILPNFAbolVBLvgjLXTdD/uF/pdJ22Y="; From 11369cdb18a1b047e6721fb12bc2893eb8dfd78e Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Wed, 11 Dec 2024 14:47:56 +0000 Subject: [PATCH 2/2] jetbrains: rename source-package arg `buildVer` -> `buildNumber` --- pkgs/applications/editors/jetbrains/readme.md | 2 +- .../editors/jetbrains/source/build.nix | 23 +++++++++---------- .../editors/jetbrains/source/default.nix | 4 ++-- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/pkgs/applications/editors/jetbrains/readme.md b/pkgs/applications/editors/jetbrains/readme.md index 14dedbb79f49..8908d0b29633 100644 --- a/pkgs/applications/editors/jetbrains/readme.md +++ b/pkgs/applications/editors/jetbrains/readme.md @@ -20,7 +20,7 @@ To test the build process of every IDE (as well as the process for adding plugin - Source builds need a bit more effort, as they **aren't automated at the moment**: - Find the build of the stable release you want to target (usually different for pycharm and idea, should have three components) - I find this at https://jetbrains.com/updates/updates.xml (search for `product name="`, then `fullNumber`) - - Update the `version` & `buildVer` fields in source/default.nix + - Update the `version` & `buildNumber` fields in source/default.nix - Empty the `ideaHash`, `androidHash`, `jpsHash` and `restarterHash` (only `ideaHash` and `restarterHash` changes on a regular basis) fields and try to build to get the new hashes - Run `nix build .#jetbrains.(idea/pycharm)-community-src.src.src`, then `./source/build_maven.py source/idea_maven_artefacts.json result/` - Update `source/brokenPlugins.json` (from https://plugins.jetbrains.com/files/brokenPlugins.json) diff --git a/pkgs/applications/editors/jetbrains/source/build.nix b/pkgs/applications/editors/jetbrains/source/build.nix index b03d450cad76..2b9d1d046fa0 100644 --- a/pkgs/applications/editors/jetbrains/source/build.nix +++ b/pkgs/applications/editors/jetbrains/source/build.nix @@ -20,7 +20,7 @@ , xorg , version -, buildVer +, buildNumber , buildType , ideaHash , androidHash @@ -36,14 +36,14 @@ let ideaSrc = fetchFromGitHub { owner = "jetbrains"; repo = "intellij-community"; - rev = "${buildType}/${buildVer}"; + rev = "${buildType}/${buildNumber}"; hash = ideaHash; }; androidSrc = fetchFromGitHub { owner = "jetbrains"; repo = "android"; - rev = "${buildType}/${buildVer}"; + rev = "${buildType}/${buildNumber}"; hash = androidHash; }; @@ -76,7 +76,7 @@ let libdbm = stdenv.mkDerivation { pname = "libdbm"; - version = buildVer; + version = buildNumber; nativeBuildInputs = [ cmake pkg-config ]; buildInputs = [ glib xorg.libX11 libdbusmenu ]; inherit src; @@ -96,12 +96,12 @@ let fsnotifier = stdenv.mkDerivation { pname = "fsnotifier"; - version = buildVer; + version = buildNumber; inherit src; sourceRoot = "${src.name}/native/fsNotifier/linux"; buildPhase = '' runHook preBuild - $CC -O2 -Wall -Wextra -Wpedantic -D "VERSION=\"${buildVer}\"" -std=c11 main.c inotify.c util.c -o fsnotifier + $CC -O2 -Wall -Wextra -Wpedantic -D "VERSION=\"${buildNumber}\"" -std=c11 main.c inotify.c util.c -o fsnotifier runHook postBuild ''; installPhase = '' @@ -114,7 +114,7 @@ let restarter = rustPlatform.buildRustPackage { pname = "restarter"; - version = buildVer; + version = buildNumber; inherit src; sourceRoot = "${src.name}/native/restarter"; cargoHash = restarterHash; @@ -137,7 +137,7 @@ let jps-bootstrap = stdenvNoCC.mkDerivation { pname = "jps-bootstrap"; - version = buildVer; + version = buildNumber; inherit src; sourceRoot = "${src.name}/platform/jps-bootstrap"; nativeBuildInputs = [ ant makeWrapper jbr ]; @@ -201,8 +201,7 @@ let in stdenvNoCC.mkDerivation rec { pname = "${buildType}-community"; - inherit version; - buildNumber = buildVer; + inherit version buildNumber; name = "${pname}-${version}.tar.gz"; inherit src; nativeBuildInputs = [ p7zip jbr jps-bootstrap ]; @@ -232,7 +231,7 @@ stdenvNoCC.mkDerivation rec { -e 's|MAVEN_REPO_HERE|${mvnRepo}/.m2/repository/|' \ -e 's|MAVEN_PATH_HERE|${maven}/maven|' \ -i build/deps/src/org/jetbrains/intellij/build/impl/BundledMavenDownloader.kt - echo '${buildVer}.SNAPSHOT' > build.txt + echo '${buildNumber}.SNAPSHOT' > build.txt ''; configurePhase = '' @@ -241,7 +240,7 @@ stdenvNoCC.mkDerivation rec { ln -s "$repo"/.m2 /build/.m2 export JPS_BOOTSTRAP_COMMUNITY_HOME=/build/source jps-bootstrap \ - -Dbuild.number=${buildVer} \ + -Dbuild.number=${buildNumber} \ -Djps.kotlin.home=${kotlin} \ -Dintellij.build.target.os=linux \ -Dintellij.build.target.arch=x64 \ diff --git a/pkgs/applications/editors/jetbrains/source/default.nix b/pkgs/applications/editors/jetbrains/source/default.nix index 502383dab8ce..7c7b7c81f7c8 100644 --- a/pkgs/applications/editors/jetbrains/source/default.nix +++ b/pkgs/applications/editors/jetbrains/source/default.nix @@ -4,7 +4,7 @@ { idea-community = callPackage ./build.nix { version = "2024.1.3"; - buildVer = "241.17890.1"; + buildNumber = "241.17890.1"; buildType = "idea"; ideaHash = "sha256-jWFnewxRkriSmV6CgGX1r//uaErMINfx3Z+JpkE34jk="; androidHash = "sha256-hX2YdRYNRg0guskNiYfxdl9osgZojRen82IhgA6G0Eo="; @@ -14,7 +14,7 @@ }; pycharm-community = callPackage ./build.nix { version = "2024.1.3"; - buildVer = "241.17890.14"; + buildNumber = "241.17890.14"; buildType = "pycharm"; ideaHash = "sha256-tTB91/RHEWP/ZILPNFAbolVBLvgjLXTdD/uF/pdJ22Y="; androidHash = "sha256-hX2YdRYNRg0guskNiYfxdl9osgZojRen82IhgA6G0Eo=";