jetbrains: fix mismatched versions for source-built packages (#364259)

This commit is contained in:
Leona Maroni 2024-12-12 09:00:23 +01:00 committed by GitHub
commit df5e6d70d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 20 additions and 16 deletions

View File

@ -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;

View File

@ -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` & `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)

View File

@ -19,7 +19,8 @@
, pkg-config
, xorg
, buildVer
, version
, buildNumber
, buildType
, ideaHash
, androidHash
@ -35,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;
};
@ -75,7 +76,7 @@ let
libdbm = stdenv.mkDerivation {
pname = "libdbm";
version = buildVer;
version = buildNumber;
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ glib xorg.libX11 libdbusmenu ];
inherit src;
@ -95,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 = ''
@ -113,7 +114,7 @@ let
restarter = rustPlatform.buildRustPackage {
pname = "restarter";
version = buildVer;
version = buildNumber;
inherit src;
sourceRoot = "${src.name}/native/restarter";
cargoHash = restarterHash;
@ -136,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 ];
@ -200,7 +201,7 @@ let
in
stdenvNoCC.mkDerivation rec {
pname = "${buildType}-community";
version = buildVer;
inherit version buildNumber;
name = "${pname}-${version}.tar.gz";
inherit src;
nativeBuildInputs = [ p7zip jbr jps-bootstrap ];
@ -230,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 = ''
@ -239,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 \

View File

@ -3,7 +3,8 @@
{
idea-community = callPackage ./build.nix {
buildVer = "241.17890.1";
version = "2024.1.3";
buildNumber = "241.17890.1";
buildType = "idea";
ideaHash = "sha256-jWFnewxRkriSmV6CgGX1r//uaErMINfx3Z+JpkE34jk=";
androidHash = "sha256-hX2YdRYNRg0guskNiYfxdl9osgZojRen82IhgA6G0Eo=";
@ -12,7 +13,8 @@
mvnDeps = ./idea_maven_artefacts.json;
};
pycharm-community = callPackage ./build.nix {
buildVer = "241.17890.14";
version = "2024.1.3";
buildNumber = "241.17890.14";
buildType = "pycharm";
ideaHash = "sha256-tTB91/RHEWP/ZILPNFAbolVBLvgjLXTdD/uF/pdJ22Y=";
androidHash = "sha256-hX2YdRYNRg0guskNiYfxdl9osgZojRen82IhgA6G0Eo=";