X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=lib%2Fxdsserver%2Fapiv1-exec.go;h=46c8148cb637f600cea7d23949c17746135c1f37;hb=6748a2637bffb56213a2a6981df96a070fb96467;hp=57ea1f1ca1bed762a3a0f41c410b4a6d643a547a;hpb=17812a0a4388ab0c87084ef7e8118d87e8fadcf7;p=src%2Fxds%2Fxds-server.git diff --git a/lib/xdsserver/apiv1-exec.go b/lib/xdsserver/apiv1-exec.go index 57ea1f1..46c8148 100644 --- a/lib/xdsserver/apiv1-exec.go +++ b/lib/xdsserver/apiv1-exec.go @@ -83,6 +83,15 @@ func (s *APIService) execCmd(c *gin.Context) { // Build command line cmd := []string{} + + // Reset by default LD_LIBRARY_PATH + // With new AGL SDK, New environment-setup-*-agl-linux file checks if + // LD_LIBRARY_PATH is set or not and not empty LD_LIBRARY_PATH is considered + // as misconfigured and prevent to use SDK + if !args.LdLibPathNoReset { + cmd = append(cmd, "unset LD_LIBRARY_PATH; ") + } + // Setup env var regarding Sdk ID (used for example to setup cross toolchain) if envCmd := s.sdks.GetEnvCmd(args.SdkID, prj.DefaultSdk); len(envCmd) > 0 { cmd = append(cmd, envCmd...) @@ -261,6 +270,7 @@ func (s *APIService) execCmd(c *gin.Context) { execWS.ExitCB = func(e *eows.ExecOverWS, code int, err error) { s.Log.Debugf("Command [Cmd ID %s] exited: code %d, error: %v", e.CmdID, code, err) + defer LockXdsUpdateCounter(s.Context, false) // Close client tty defer func() { if gdbPty != nil { @@ -330,8 +340,10 @@ func (s *APIService) execCmd(c *gin.Context) { // Start command execution s.Log.Infof("Execute [Cmd ID %s]: %v %v", execWS.CmdID, execWS.Cmd, execWS.Args) + LockXdsUpdateCounter(s.Context, true) err = execWS.Start() if err != nil { + LockXdsUpdateCounter(s.Context, false) common.APIError(c, err.Error()) return }