Merge pull request #275418 from ShadowRZ/shadowrz/idea-pycharm-community-2023.3.1

jetbrains.{idea,pycharm}-community-src: 2023.2.2 -> 2023.3.2
This commit is contained in:
Thomas Gerbet 2024-01-17 20:52:04 +01:00 committed by GitHub
commit 5776198f66
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 1997 additions and 2401 deletions

View File

@ -0,0 +1,11 @@
--- a/platform/build-scripts/src/org/jetbrains/intellij/build/impl/sbom/SoftwareBillOfMaterialsImpl.kt
+++ b/platform/build-scripts/src/org/jetbrains/intellij/build/impl/sbom/SoftwareBillOfMaterialsImpl.kt
@@ -162,6 +162,8 @@
}
override suspend fun generate() {
+ Span.current().addEvent("SBOM generation are unavaliable due to requiring internet, skipping")
+ return
val skipReason = when {
!context.shouldBuildDistributions() -> "No distribution was built"
documentNamespace == null -> "Document namespace isn't specified"

View File

@ -39,6 +39,17 @@
+ return Path.of("MAVEN_PATH_HERE")
}
}
--- a/platform/build-scripts/downloader/src/org/jetbrains/intellij/build/dependencies/BuildDependenciesDownloader.kt
+++ b/platform/build-scripts/downloader/src/org/jetbrains/intellij/build/dependencies/BuildDependenciesDownloader.kt
@@ -70,7 +70,7 @@
version: String,
classifier: String?,
packaging: String): URI {
- val base = mavenRepository.trim('/')
+ val base = mavenRepository.trimEnd('/')
val groupStr = groupId.replace('.', '/')
val classifierStr = if (classifier != null) "-${classifier}" else ""
return URI.create("${base}/${groupStr}/${artifactId}/${version}/${artifactId}-${version}${classifierStr}.${packaging}")
--- a/platform/build-scripts/downloader/src/org/jetbrains/intellij/build/dependencies/JdkDownloader.kt
+++ b/platform/build-scripts/downloader/src/org/jetbrains/intellij/build/dependencies/JdkDownloader.kt
@@ -25,11 +25,7 @@
@ -56,21 +67,35 @@
jdkExtracted.resolve("Contents").resolve("Home")
--- a/platform/build-scripts/src/org/jetbrains/intellij/build/LinuxDistributionCustomizer.kt
+++ b/platform/build-scripts/src/org/jetbrains/intellij/build/LinuxDistributionCustomizer.kt
@@ -43,12 +43,12 @@
@@ -46,7 +46,7 @@
/**
* If `true` a separate *-no-jbr.tar.gz artifact without runtime will be produced.
* If `true`, a separate *[org.jetbrains.intellij.build.impl.LinuxDistributionBuilder.NO_RUNTIME_SUFFIX].tar.gz artifact without a runtime will be produced.
*/
- var buildTarGzWithoutBundledRuntime = false
+ var buildTarGzWithoutBundledRuntime = true
/**
* If `true`, the only *-no-jbr.tar.gz will be produced, no other binaries for Linux will be built.
*/
- var buildOnlyBareTarGz = false
+ var buildOnlyBareTarGz = true
- var buildArtifactWithoutRuntime = false
+ var buildArtifactWithoutRuntime = true
/**
* Set both properties if a .snap package should be produced.
--- a/platform/build-scripts/src/org/jetbrains/intellij/build/impl/LinuxDistributionBuilder.kt
+++ b/platform/build-scripts/src/org/jetbrains/intellij/build/impl/LinuxDistributionBuilder.kt
@@ -45,7 +45,7 @@
withContext(Dispatchers.IO) {
val distBinDir = targetPath.resolve("bin")
val sourceBinDir = context.paths.communityHomeDir.resolve("bin/linux")
- copyFileToDir(NativeBinaryDownloader.downloadRestarter(context = context, os = OsFamily.LINUX, arch = arch), distBinDir)
+ copyFileToDir(sourceBinDir.resolve("${arch.dirName}/restarter"), distBinDir)
copyFileToDir(sourceBinDir.resolve("${arch.dirName}/fsnotifier"), distBinDir)
copyFileToDir(sourceBinDir.resolve("${arch.dirName}/libdbm.so"), distBinDir)
generateBuildTxt(context, targetPath)
@@ -85,6 +85,8 @@
}
}
+ return@executeStep
+
val runtimeDir = context.bundledRuntime.extract(os = OsFamily.LINUX, arch = arch)
updateExecutablePermissions(runtimeDir, executableFileMatchers)
val tarGzPath = buildTarGz(arch = arch, runtimeDir = runtimeDir, unixDistPath = osAndArchSpecificDistPath, suffix = suffix(arch))
--- a/platform/build-scripts/src/org/jetbrains/intellij/build/impl/brokenPlugins.kt
+++ b/platform/build-scripts/src/org/jetbrains/intellij/build/impl/brokenPlugins.kt
@@ -11,6 +11,7 @@

View File

@ -1,41 +0,0 @@
--- a/python/build/src/PyCharmCommunityInstallersBuildTarget.kt
+++ b/python/build/src/PyCharmCommunityInstallersBuildTarget.kt
@@ -2,9 +2,11 @@
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.runBlocking
+import org.jetbrains.intellij.build.BuildOptions
import org.jetbrains.intellij.build.BuildTasks
import org.jetbrains.intellij.build.IdeaProjectLoaderUtil
import org.jetbrains.intellij.build.impl.BuildContextImpl
+import org.jetbrains.intellij.build.pycharm.PyCharmBuildUtils
import org.jetbrains.intellij.build.pycharm.PyCharmCommunityProperties
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
@@ -12,13 +14,26 @@
@JvmStatic
fun main(args: Array<String>) {
runBlocking(Dispatchers.Default) {
+ val options = BuildOptions().apply {
+ // we cannot provide consistent build number for PyCharm Community if it's built separately so use *.SNAPSHOT number to avoid confusion
+ buildNumber = null
+
+ // do not bother external users about clean/incremental
+ // just remove out/ directory for clean build
+ incrementalCompilation = true
+ useCompiledClassesFromProjectOutput = false
+ buildStepsToSkip.addAll(listOf(
+ BuildOptions.MAC_SIGN_STEP,
+ ))
+ }
val communityHome = IdeaProjectLoaderUtil.guessCommunityHome(javaClass)
val context = BuildContextImpl.createContext(
communityHome = communityHome,
projectHome = communityHome.communityRoot,
productProperties = PyCharmCommunityProperties(communityHome.communityRoot),
+ options = options,
)
BuildTasks.create(context).buildDistributions()
}
}
}

View File

@ -0,0 +1,9 @@
--- a/.cargo/config.toml
+++ b/.cargo/config.toml
@@ -3,6 +3,3 @@
[target.'cfg(all(target_os = "macos", target_arch = "x86_64"))']
rustflags = ["-C", "link-arg=-mmacosx-version-min=10.15"]
-
-[target.'cfg(all(target_os = "linux", target_arch = "x86_64"))']
-rustflags = ["-C", "target-feature=+crt-static"]

View File

@ -17,12 +17,12 @@ To test the build process of every IDE (as well as the process for adding plugin
## How to update stuff:
- Run ./bin/update_bin.py
- This will update binary IDEs and plugins, and automatically commit them
- Source builds need a bit more effort, as they aren't automated at the moment:
- 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 `fullNumber`)
- I find this at https://jetbrains.com/updates/updates.xml (search for `product name="`, then `fullNumber`)
- Update the `buildVer` field in source/default.nix
- Empty the `ideaHash`, `androidHash` and `jpsHash` (only `ideaHash` changes on a regular basis) fields and try to build to get the new hashes
- Run `nix build .#jetbrains.(idea/pycharm)-community-source.src`, then `./source/build_maven.py source/idea_maven_artefacts.json result/`
- 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)
- Do a test build
- If it succeeds, make a PR/merge

File diff suppressed because one or more lines are too long

View File

@ -6,6 +6,7 @@
, runCommand
, stdenv
, stdenvNoCC
, rustPlatform
, ant
, cmake
@ -23,6 +24,7 @@
, ideaHash
, androidHash
, jpsHash
, restarterHash
, mvnDeps
}:
@ -109,6 +111,15 @@ let
'';
};
restarter = rustPlatform.buildRustPackage {
pname = "restarter";
version = buildVer;
inherit src;
patches = [ ../patches/restarter-no-static-crt-override.patch ];
sourceRoot = "source/native/restarter";
cargoHash = restarterHash;
};
jpsRepo = runCommand "jps-bootstrap-repository"
{
outputHashAlgo = "sha256";
@ -163,6 +174,7 @@ let
"https://cache-redirector.jetbrains.com/packages.jetbrains.team/maven/p/grazi/grazie-platform-public/${entry.url}"
"https://cache-redirector.jetbrains.com/dl.google.com/dl/android/maven2/${entry.url}"
"https://packages.jetbrains.team/maven/p/kpm/public/${entry.url}"
"https://packages.jetbrains.team/maven/p/ki/maven/${entry.url}"
"https://packages.jetbrains.team/maven/p/dpgpv/maven/${entry.url}"
"https://cache-redirector.jetbrains.com/download.jetbrains.com/teamcity-repository/${entry.url}"
];
@ -176,11 +188,11 @@ let
repoUrl = "https://cache-redirector.jetbrains.com/maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-ide-plugin-dependencies";
groupId = builtins.replaceStrings [ "." ] [ "/" ] "org.jetbrains.kotlin";
artefactId = "kotlin-jps-plugin-classpath";
version = "1.8.20";
version = "1.9.10";
in
fetchurl {
url = repoUrl + "/" + groupId + "/" + artefactId + "/" + version + "/" + artefactId + "-" + version + ".jar";
hash = "sha256-w+vmEBSXGcyvxHB3byIOFjTeCIC7tkWh9rvOoP0//9A=";
hash = "sha256-gpB4lg6wailtxSgPyyOrarXCL9+DszojaYGC4ULgU3c=";
};
targetClass = if buildType == "pycharm" then "intellij.pycharm.community.build" else "intellij.idea.community.build";
@ -197,10 +209,11 @@ stdenvNoCC.mkDerivation rec {
patches = [
../patches/no-download.patch
../patches/pycharm-build-fix.patch
../patches/disable-sbom-generation.patch
];
postPatch = ''
cp ${restarter}/bin/restarter bin/linux/amd64/restarter
cp ${fsnotifier}/bin/fsnotifier bin/linux/amd64/fsnotifier
cp ${libdbm}/lib/libdbm.so bin/linux/amd64/libdbm.so
@ -224,9 +237,6 @@ stdenvNoCC.mkDerivation rec {
configurePhase = ''
runHook preConfigure
# Will need removing after update
cp plugins/devkit/devkit-core/src/run/OpenedPackages.txt platform/platform-impl/resources/META-INF/OpenedPackages.txt
ln -s "$repo"/.m2 /build/.m2
export JPS_BOOTSTRAP_COMMUNITY_HOME=/build/source
jps-bootstrap \

View File

@ -3,19 +3,21 @@
{
idea-community = callPackage ./build.nix {
buildVer = "232.9921.47";
buildVer = "233.13135.103";
buildType = "idea";
ideaHash = "sha256-sibp2Pa+NNHEeHMDRol45XOK0JzEhIZeI7TY04SkIx4=";
androidHash = "sha256-bc/UlR0DJQiQ3mdscucHkvzkSQxD0KnDFIM9UIb7Inw=";
jpsHash = "sha256-dBz64oATg45BMwd6etncQm84eHQSfSE9kDbuU9IVpmo=";
ideaHash = "sha256-ld6qvc0ceERrLSJOC07JEgDmg3lEYdU/XgjZXgzWTAg=";
androidHash = "sha256-D8zKkmPOx4RliAtyq2Z8Up2u224blP0SjNjW3yO7nSQ=";
jpsHash = "sha256-0cmn0N1UVNzw1hNOpy+9HhkHHNq+rVKnfXM+LjHAQ40=";
restarterHash = "sha256-56GqBY/w8expWTXSP3Bad9u7QV3q8LpNN8nd8tk+Zzk=";
mvnDeps = ./idea_maven_artefacts.json;
};
pycharm-community = callPackage ./build.nix {
buildVer = "232.10072.31";
buildVer = "233.13135.95";
buildType = "pycharm";
ideaHash = "sha256-NTQGz5HViQlJQaxcAnsliZS4NCKScVqx25FMILkBjpk=";
androidHash = "sha256-bc/UlR0DJQiQ3mdscucHkvzkSQxD0KnDFIM9UIb7Inw=";
jpsHash = "sha256-dBz64oATg45BMwd6etncQm84eHQSfSE9kDbuU9IVpmo=";
ideaHash = "sha256-avRdwIr+uSXZhcMeamfy7OMYy0Ez7qWljwPc5V6n/60=";
androidHash = "sha256-D8zKkmPOx4RliAtyq2Z8Up2u224blP0SjNjW3yO7nSQ=";
jpsHash = "sha256-0cmn0N1UVNzw1hNOpy+9HhkHHNq+rVKnfXM+LjHAQ40=";
restarterHash = "sha256-YW+5Jl0EWqBj7iRkk70NFL+gccK9/tAOlm/n08XKH8M=";
mvnDeps = ./idea_maven_artefacts.json;
};
}