Consider the logic when AOT is performed before TAC
authorj-h.choi <j-h.choi@samsung.com>
Mon, 12 May 2025 04:16:17 +0000 (13:16 +0900)
committer조웅석/MDE Lab(SR)/삼성전자 <ws77.cho@samsung.com>
Tue, 13 May 2025 04:08:26 +0000 (13:08 +0900)
Change-Id: I72f9328b7919262f882dcf2a9011f8e0184063d2

NativeLauncher/tool/tac_installer.cc

index 3a6b1d694ecd9754468ba17831ce8c9d2813033d..fffcaefb6bd7c79692d9fe6834b8e465b26c20a7 100644 (file)
@@ -139,26 +139,32 @@ static bool copyAssemblyCreateSymlink(std::string binPath, std::string tacDir, s
                                                _ERR("Failed to copy of %s", niFile.c_str());
                                        }
                                }
-                               bf::create_symlink(concatPath(tac_version_dir, assembly), concatPath(tacDir, assembly), error);
+
+                               if (exist(binNiPath)) {
+                                       bf::create_symlink(concatPath(tac_version_dir, niFile), concatPath(tacDir, assembly), error);
+                               } else {
+                                       bf::create_symlink(concatPath(tac_version_dir, assembly), concatPath(tacDir, assembly), error);
+                               }
                                if (error) {
                                        _ERR("Failed to create symlink %s file", concatPath(tacDir, assembly).c_str());
                                        nuget_restoration = true;
                                        break;
                                }
-                               if (exist(concatPath(tac_version_dir, niFile)) && exist(binNiPath)) {
-                                       bf::create_symlink(concatPath(tac_version_dir, niFile), concatPath(tacDir, assembly), error);
-                                       if (error) {
-                                               _ERR("Failed to create symlink %s file", concatPath(tacDir, assembly).c_str());
-                                       }
-                               }
-
                                copySmackAndOwnership(tacDir, concatPath(tacDir, assembly), true);
 
+                               if (exist(binNiPath) && exist(concatPath(tac_version_dir, niFile))) {
+                                       bf::create_symlink(concatPath(tac_version_dir, niFile), concatPath(tacDir, niFile));
+                                       copySmackAndOwnership(tacDir, concatPath(tacDir, niFile), true);
+                               }
+
                                if (!removeFile(concatPath(binPath, assembly))) {
                                        _ERR("Failed to remove of %s", assembly.c_str());
                                        nuget_restoration = true;
                                        break;
                                }
+                               if (!removeFile(concatPath(binNiPath, assembly))) {
+                                       _ERR("Failed to remove of %s", assembly.c_str());
+                               }
                                if (!removeFile(concatPath(binNiPath, niFile))) {
                                        _ERR("Failed to remove of %s", niFile.c_str());
                                }