tisonkun commented on code in PR #7087:
URL: https://github.com/apache/opendal/pull/7087#discussion_r2642833170


##########
bindings/java/tools/build.py:
##########
@@ -96,6 +108,27 @@ def get_cargo_artifact_name(classifier: str) -> str:
 
     # History reason of cargo profiles.
     profile = "debug" if args.profile in ["dev", "test", "bench"] else 
args.profile
+
+    if target.endswith("-musl"):
+        static_artifact = get_static_artifact_name(args.classifier)
+        src = output / target / profile / static_artifact
+        artifact = get_cargo_artifact_name(args.classifier)
+        dst = basedir / "target" / "classes" / "native" / args.classifier / 
artifact
+        dst.parent.mkdir(exist_ok=True, parents=True)
+
+        link_cmd = [
+            "musl-gcc",
+            "-shared",
+            "-o",
+            str(dst),
+            "-Wl,--whole-archive",
+            str(src),
+            "-Wl,--no-whole-archive",
+        ]
+        print("$ " + subprocess.list2cmdline(link_cmd))
+        subprocess.run(link_cmd, cwd=basedir, check=True)
+        raise SystemExit(0)

Review Comment:
   But it looks still incorrect. We need the following lines to move the output 
artifacts.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to