Can mill native launcher be statically linked? #5568
Replies: 3 comments 1 reply
-
Mill delegates the native image building to Graal. Perhaps you could try following https://www.graalvm.org/latest/reference-manual/native-image/guides/build-static-executables/ and adding |
Beta Was this translation helpful? Give feedback.
-
Building a native executable with $ git diff
diff --git a/dist/package.mill b/dist/package.mill
index fc069e6357c..5012e87e684 100644
--- a/dist/package.mill
+++ b/dist/package.mill
@@ -306,7 +306,8 @@ object `package` extends MillJavaModule with DistModule {
def nativeImageOptions = Seq(
"--no-fallback",
"--enable-url-protocols=https",
- "-Os"
+ "-Os",
+ "--static-nolibc"
// Enable JVisualVM support
// https://www.graalvm.org/latest/tools/visualvm/#using-visualvm-with-graalvm-native-executables
// "--enable-monitoring=jvmstat,heapdump" @jackkoenig probably need you to try it out and see if it fixes the problem in your environment, if it does then we can just turn it on by default |
Beta Was this translation helpful? Give feedback.
-
Hey @lihaoyi, I did some digging and here is what I figured out and think. I think That doesn't actually solve my original problem though, as it specifically is the system libraries like libc that cause issues on older Linux distributions. For circt/firtool we fully statically link using musl libc1. I am not certain if a fully statically linked binary should be the default as there is disagreement about that, but it's worth considering. Another option that might be simpler would be to have the Mill boostrap script check the system's glibc version (at least on Linux). If it's new enough then it can fetch the native binary, if it isn't, then it can fall back to the JVM client. My main concern is Chisel users (who as I mentioned are often on older Linux distros) following default Mill instructions and being confused. I could add Footnotes
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In the hardware industry, it's common to have an older Linux distro, e.g. RHEL8 is really common which will gives the following linkage error when trying out Mill 1.0.0.
This can be worked around by using the JVM version of the client, but it would be nice if the client could be statically linked.
Beta Was this translation helpful? Give feedback.
All reactions