Skip to content

Commit 3f00740

Browse files
authored
Merge pull request #158 from kbase/sdkdev
Prep for base-image-less SDK
2 parents 2cbc77b + 32a9c2c commit 3f00740

2 files changed

Lines changed: 22 additions & 3 deletions

File tree

build.gradle

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,18 @@ graalvmNative {
268268
'--enable-url-protocols=https,http',
269269
'-H:+AddAllCharsets'
270270
])
271+
272+
def arch = System.getProperty("os.arch")
273+
println "Detected architecture: ${arch}"
274+
275+
if (arch == "x86_64" || arch == "amd64") {
276+
println "Adding -march=x86-64-v2 to build args"
277+
// the KBase CI catalog service hardware is oooooold
278+
// TODO KBASE_HW remove this stuff if we ever get modern HW
279+
buildArgs.add("-march=x86-64-v2")
280+
} else {
281+
println "Skipping -march option for architecture: ${arch}"
282+
}
271283
}
272284
}
273285
}

src/main/java/us/kbase/sdk/compiler/TemplateBasedGenerator.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ public static void generate(List<KbService> srvs, String defaultUrl,
7676
pythonClient.close();
7777
}
7878
//////////////////////////////////////// Servers /////////////////////////////////////////
79+
// AFAICT at this pint either
80+
// * the python server name is null and getPythonServer is false
81+
// * the python server name is supplied and getPythonServer is true
82+
// so one implies the other
7983
if (pythonServerName != null) {
8084
String pythonServerPath = fixPath(pythonServerName, ".") + ".py";
8185
initPythonPackages(pythonServerPath, output, false);
@@ -184,6 +188,8 @@ private static void initPythonPackages(String relativePyPath, FileSaver output,
184188
copyResourceFile(relativePyPath, output, "authclient.py");
185189
if (client) {
186190
copyResourceFile(relativePyPath, output, "baseclient.py");
191+
} else {
192+
copyResourceFile("biokbase/log.py", output, "log.py");
187193
}
188194
}
189195

@@ -199,9 +205,10 @@ private static void copyResourceFile(
199205
filepath = Paths.get(relativePath).getParent()
200206
.resolve(file);
201207
}
202-
try (final InputStream input =
203-
TemplateFormatter.getResource(file);
204-
final Writer w = output.openWriter(filepath.toString())) {
208+
try (
209+
final InputStream input = TemplateFormatter.getResource(file);
210+
final Writer w = output.openWriter(filepath.toString())
211+
) {
205212
IOUtils.copy(input, w);
206213
}
207214
}

0 commit comments

Comments
 (0)