fix(runtime): keep QEMU ASLR in sync across runtime and data folder changes

This commit is contained in:
ELDment committed 2026-12-04 08:11:39 +08:00
1 parent 7049f3e388
commit a8b7894208
35 files changed
+1021 -186

No files matched your search

+8 -2
View File
@@ -283,6 +283,12 @@ func formatGPUCompatNote(loc i18n.Locale, g host.GPUInfo) string {
}
}
func activateRuntime(ctx context.Context, cfg *config.Config, loc i18n.Locale, commit string) error {
return rt.Activate(ctx, cfg, commit, func(warning error) {
fmt.Fprintln(os.Stderr, i18n.FormatCLIError(loc, warning))
})
}
func cmdRuntime(cfg *config.Config, loc i18n.Locale, args []string) error {
if len(args) == 0 {
return fmt.Errorf("usage: reims-go runtime <available|fetch|install|list|use|remove>")
@@ -299,7 +305,7 @@ func cmdRuntime(cfg *config.Config, loc i18n.Locale, args []string) error {
}
return err
}
if err := rt.Activate(context.Background(), cfg, inst.Commit); err != nil {
if err := activateRuntime(context.Background(), cfg, loc, inst.Commit); err != nil {
return err
}
fmt.Println(i18n.T(loc, "runtime.installed", inst.Commit, inst.Dir))
@@ -334,7 +340,7 @@ func cmdRuntime(cfg *config.Config, loc i18n.Locale, args []string) error {
if len(args) < 2 {
return fmt.Errorf("usage: reims-go runtime use <commit>")
}
if err := rt.Activate(context.Background(), cfg, args[1]); err != nil {
if err := activateRuntime(context.Background(), cfg, loc, args[1]); err != nil {
if errors.Is(err, rt.ErrNotFound) {
return errors.New(i18n.T(loc, "runtime.not_found", args[1]))
}