about summary refs log tree commit diff
path: root/pkgs/applications/editors/jetbrains/patches/no-download.patch
blob: 700425665a9177c0be706c7697a3545034cf657e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
--- a/build/deps/src/org/jetbrains/intellij/build/impl/BundledMavenDownloader.kt
+++ b/build/deps/src/org/jetbrains/intellij/build/impl/BundledMavenDownloader.kt
@@ -89,7 +89,7 @@
       }
       val file = root.resolve("${split[1]}-${split[2]}.jar")
       val uri = BuildDependenciesDownloader.getUriForMavenArtifact(
-        mavenRepository = BuildDependenciesConstants.MAVEN_CENTRAL_URL,
+        mavenRepository = "MAVEN_REPO_HERE",
         groupId = split[0],
         artifactId = split[1],
         version = split[2],
@@ -145,22 +145,7 @@
   }

   suspend fun downloadMavenDistribution(communityRoot: BuildDependenciesCommunityRoot): Path {
-    val extractDir = communityRoot.communityRoot.resolve("plugins/maven/maven36-server-impl/lib/maven3")
-    val properties = BuildDependenciesDownloader.getDependencyProperties(communityRoot)
-    val bundledMavenVersion = properties.property("bundledMavenVersion")
-    mutex.withLock {
-      val uri = BuildDependenciesDownloader.getUriForMavenArtifact(
-        mavenRepository = BuildDependenciesConstants.MAVEN_CENTRAL_URL,
-        groupId = "org.apache.maven",
-        artifactId = "apache-maven",
-        version = bundledMavenVersion,
-        classifier = "bin",
-        packaging = "zip"
-      )
-      val zipPath = downloadFileToCacheLocation(uri.toString(), communityRoot)
-      BuildDependenciesDownloader.extractFile(zipPath, extractDir, communityRoot, BuildDependenciesExtractOptions.STRIP_ROOT)
-    }
-    return extractDir
+    return Path.of("MAVEN_PATH_HERE")
   }

   suspend fun downloadMavenTelemetryDependencies(communityRoot: BuildDependenciesCommunityRoot): Path =
--- 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
@@ -33,11 +33,7 @@
   }

   suspend fun getJdkHome(communityRoot: BuildDependenciesCommunityRoot, os: OS, arch: Arch, infoLog: (String) -> Unit): Path {
-    val jdkUrl = getUrl(communityRoot = communityRoot, os = os, arch = arch)
-    val jdkArchive = downloadFileToCacheLocation(url = jdkUrl.toString(), communityRoot = communityRoot)
-    val jdkExtracted = BuildDependenciesDownloader.extractFileToCacheLocation(communityRoot = communityRoot,
-                                                                              archiveFile = jdkArchive,
-                                                                              BuildDependenciesExtractOptions.STRIP_ROOT)
+    val jdkExtracted = Path.of("JDK_PATH_HERE")
     val jdkHome = if (os == OS.MACOSX) jdkExtracted.resolve("Contents").resolve("Home") else jdkExtracted
     infoLog("JPS-bootstrap JDK (jdkHome=$jdkHome, executable=${getJavaExecutable(jdkHome)})")
     return jdkHome
--- a/platform/build-scripts/src/org/jetbrains/intellij/build/LinuxDistributionCustomizer.kt
+++ b/platform/build-scripts/src/org/jetbrains/intellij/build/LinuxDistributionCustomizer.kt
@@ -46,7 +46,7 @@
   /**
    * If `true`, a separate *[org.jetbrains.intellij.build.impl.LinuxDistributionBuilder.NO_RUNTIME_SUFFIX].tar.gz artifact without a runtime will be produced.
    */
-  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
@@ -9,6 +9,8 @@
 import java.io.ByteArrayOutputStream
 import java.io.DataOutputStream
 import java.util.*
+import java.nio.file.Path
+import kotlin.io.path.readText

 private const val MARKETPLACE_BROKEN_PLUGINS_URL = "https://plugins.jetbrains.com/files/brokenPlugins.json"

@@ -19,7 +21,7 @@
   val span = Span.current()

   val allBrokenPlugins = try {
-    val content = downloadAsText(MARKETPLACE_BROKEN_PLUGINS_URL)
+    val content = Path.of("BROKEN_PLUGINS_HERE").readText()
     @Suppress("JSON_FORMAT_REDUNDANT")
     Json { ignoreUnknownKeys = true }.decodeFromString(ListSerializer(MarketplaceBrokenPlugin.serializer()), content)
   }
--- a/platform/build-scripts/src/org/jetbrains/intellij/build/kotlin/KotlinCompilerDependencyDownloader.kt
+++ b/platform/build-scripts/src/org/jetbrains/intellij/build/kotlin/KotlinCompilerDependencyDownloader.kt
@@ -23,31 +23,11 @@
 
 object KotlinCompilerDependencyDownloader {
   fun downloadAndExtractKotlinCompiler(communityRoot: BuildDependenciesCommunityRoot): Path {
-    val kotlinJpsPluginVersion = getKotlinJpsPluginVersion(communityRoot)
-    val kotlinDistUrl = getUriForMavenArtifact(MAVEN_REPOSITORY_URL, ARTIFACT_GROUP_ID, "kotlin-dist-for-ide", kotlinJpsPluginVersion, "jar")
-    val kotlinDistJar = downloadFileToCacheLocation(communityRoot, kotlinDistUrl)
-    return extractFileToCacheLocation(communityRoot, kotlinDistJar)
+    return Path.of("KOTLIN_PATH_HERE")
   }
 
   suspend fun downloadKotlinJpsPlugin(communityRoot: BuildDependenciesCommunityRoot): Path = withContext(Dispatchers.IO) {
-    val kotlinJpsPluginVersion = getKotlinJpsPluginVersion(communityRoot)
-    val kotlinJpsPluginUrl = getUriForMavenArtifact(MAVEN_REPOSITORY_URL, ARTIFACT_GROUP_ID, "kotlin-jps-plugin-classpath", kotlinJpsPluginVersion, "jar")
-
-    val cacheLocation = getTargetFile(communityRoot, kotlinJpsPluginUrl.toString())
-    if (cacheLocation.exists()) {
-      return@withContext cacheLocation
-    }
-
-    // Download file by hand since calling entire ktor/cio/coroutines stuff *before* loading JPS plugin into classpath
-    // leads to funny kotlin-reflect failures later in Kotlin JPS plugin
-    // Ideal solution would be to move compilation to other process altogether and do not modify current process classpath
-    println(" * Downloading $kotlinJpsPluginUrl")
-    val tmpLocation = Files.createTempFile(cacheLocation.parent, cacheLocation.name, ".tmp")
-    suspendingRetryWithExponentialBackOff {
-      FileUtils.copyURLToFile(kotlinJpsPluginUrl.toURL(), tmpLocation.toFile())
-    }
-    Files.move(tmpLocation, cacheLocation, StandardCopyOption.ATOMIC_MOVE)
-    return@withContext cacheLocation
+    return@withContext Path.of("JPS_PLUGIN_CLASSPATH_HERE")
   }
 
   fun getKotlinJpsPluginVersion(communityRoot: BuildDependenciesCommunityRoot): String {
--- a/platform/build-scripts/downloader/src/ktor.kt
+++ b/platform/build-scripts/downloader/src/ktor.kt
@@ -221,6 +221,11 @@
   val lock = fileLocks.getLock(targetPath.hashCode())
   lock.lock()
   try {
+    if (url.startsWith("/")) {
+      var sourceUrl = Path.of(url)
+      Files.copy(sourceUrl, target)
+    }
+
     if (Files.exists(target)) {
       Span.current().addEvent("use asset from cache", Attributes.of(
         AttributeKey.stringKey("url"), url,