@platforma-sdk/r-builder 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@platforma-sdk/r-builder",
3
3
  "description": "Build R run environment for Platforma",
4
4
  "type": "module",
5
- "version": "1.1.0",
5
+ "version": "1.1.1",
6
6
  "files": [
7
7
  "assets/",
8
8
  "scripts/"
@@ -64,7 +64,7 @@ async function installRockyLinuxPackages(logger) {
64
64
 
65
65
  util.runInherit(`sudo dnf -y install R`);
66
66
  util.runInherit(`sudo dnf -y builddep R`);
67
- util.runInherit(`sudo dnf -y install patchelf openssl-devel libcurl-devel libpng-devel lapack-devel blas-devel fontconfig-devel libxml2-devel`);
67
+ util.runInherit(`sudo dnf -y install curl rsync unzip diffutils procps patchelf openssl-devel libcurl-devel libpng-devel lapack-devel blas-devel fontconfig-devel libxml2-devel`);
68
68
  }
69
69
 
70
70
  function getGCCMajorVersion() {
@@ -125,36 +125,19 @@ async function buildRDist(logger, buildDir, installRoot, rRoot) {
125
125
  util.runInherit(`make`, { cwd: buildDir });
126
126
  util.runInherit(`make install`, { cwd: buildDir });
127
127
 
128
- const isArm64 = os.arch() === 'arm64';
129
-
130
- // Determine library path based on architecture
131
- let rLibPath = isArm64 ?
132
- path.join(installRoot, 'lib', 'R') :
133
- path.join(installRoot, 'lib64', 'R');
134
-
135
- // Ensure the source path exists before attempting to rename
136
- if (!fs.existsSync(rLibPath)) {
137
- logger.warn(`R library not found at expected path: ${rLibPath}, trying alternative...`);
138
-
139
- // Try the alternative paths as fallback
140
- rLibPath = rLibPath.includes('lib64')
141
- ? path.join(installRoot, 'lib', 'R') // Try lib if lib64 failed
142
- : path.join(installRoot, 'lib64', 'R'); // Try lib64 if lib failed
143
-
144
- if (!fs.existsSync(rLibPath)) {
145
- throw new Error(`R library not found in either lib or lib64 directories`);
146
- }
128
+ let libsDir = path.join(installRoot, 'lib64', 'R');
129
+ if (!fs.existsSync(libsDir)) {
130
+ libsDir = path.join(installRoot, 'lib', 'R');
131
+ }
132
+ if (!fs.existsSync(libsDir)) {
133
+ throw new Error(`R libraries directory not found in ${installRoot} (neither 'lib64/R' nor 'lib/R')`);
147
134
  }
148
135
 
149
- logger.info(`Moving R from ${rLibPath} to ${rRoot}`);
150
- fs.renameSync(rLibPath, rRoot);
151
-
152
- // Move core of R installation into desired R root, leaving behind all supporting
153
- // (and unnecessary) files.
136
+ logger.info(`Moving R from ${libsDir} to ${rRoot}`);
154
137
  if (fs.existsSync(rRoot)) {
155
138
  fs.rmSync(rRoot, { recursive: true });
156
139
  }
157
- fs.renameSync(path.join(installRoot, 'lib', 'R'), rRoot);
140
+ fs.renameSync(libsDir, rRoot);
158
141
 
159
142
  // 1st round of dependencies collection with binaries ELF patching to make R work from
160
143
  // its new location. We'll collect dependencies of installed packages later by one more round.