Rework last changes about LD_LIBRARY_PATH issue 55/17255/1
authorSebastien Douheret <sebastien.douheret@iot.bzh>
Wed, 17 Oct 2018 14:41:58 +0000 (16:41 +0200)
committerSebastien Douheret <sebastien.douheret@iot.bzh>
Wed, 17 Oct 2018 14:43:04 +0000 (16:43 +0200)
Last fix that just add unset LD_LIBRARY_PATH in xds-project.conf file was
not good enough.
Fix problem in xds-server (see
https://gerrit.automotivelinux.org/gerrit/#/c/17253/)
and this commit just add propagation of new LdLibPathNoReset field
in xds-agent.

Change-Id: I8312e7d37a54ea6532b8988ca1c825b5d7d51c5d
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
.vscode/settings.json
lib/agent/apiv1-exec.go
lib/agent/projects.go
lib/xaapiv1/exec.go

index 075120d..1eb0fa5 100644 (file)
@@ -1,16 +1,13 @@
 // Place your settings in this file to overwrite default and user settings.
 {
-       // Specify GOPATH here to override the one that is set as environment variable. The inferred GOPATH from workspace root overrides this, if go.inferGopath is set to true.
-       "go.gopath": "${workspaceRoot}/../../../../../..",
-
-       // The number of spaces a tab is equal to. This setting is overriden based on the file contents when `editor.detectIndentation` is on.
-       "editor.tabSize": 4,
-       // Insert spaces when pressing Tab. This setting is overriden based on the file contents when `editor.detectIndentation` is on.
-       "editor.insertSpaces": true,
-
-       // When opening a file, `editor.tabSize` and `editor.insertSpaces` will be detected based on the file contents.
+  // Specify GOPATH here to override the one that is set as environment variable. The inferred GOPATH from workspace root overrides this, if go.inferGopath is set to true.
+  "go.gopath": "${workspaceRoot}/../../../../../..",
+  // The number of spaces a tab is equal to. This setting is overriden based on the file contents when `editor.detectIndentation` is on.
+  "editor.tabSize": 4,
+  // Insert spaces when pressing Tab. This setting is overriden based on the file contents when `editor.detectIndentation` is on.
+  "editor.insertSpaces": true,
+  // When opening a file, `editor.tabSize` and `editor.insertSpaces` will be detected based on the file contents.
   "editor.detectIndentation": true,
-
   // .jsbeautifyrc not at root directory but under webapp/
   "beautify.config": "webapp/.jsbeautifyrc",
   // Configure glob patterns for excluding files and folders.
@@ -23,7 +20,7 @@
     "bin": true,
     "tools": true,
     "webapp*/dist": true,
-    "webapp*/node_modules": true
+    "**/node_modules": true,
   },
   // Specify paths/files to ignore. (Supports Globs)
   "cSpell.ignorePaths": [
index 4a1340b..d742693 100644 (file)
@@ -181,17 +181,18 @@ func (s *APIService) execCmd(c *gin.Context) {
        // Forward back command to right server
        res := xsapiv1.ExecResult{}
        xsArgs := &xsapiv1.ExecArgs{
-               ID:              args.ID,
-               SdkID:           args.SdkID,
-               CmdID:           args.CmdID,
-               Cmd:             args.Cmd,
-               Args:            args.Args,
-               Env:             args.Env,
-               RPath:           args.RPath,
-               TTY:             args.TTY,
-               TTYGdbserverFix: args.TTYGdbserverFix,
-               ExitImmediate:   args.ExitImmediate,
-               CmdTimeout:      args.CmdTimeout,
+               ID:               args.ID,
+               SdkID:            args.SdkID,
+               CmdID:            args.CmdID,
+               Cmd:              args.Cmd,
+               Args:             args.Args,
+               Env:              args.Env,
+               RPath:            args.RPath,
+               TTY:              args.TTY,
+               TTYGdbserverFix:  args.TTYGdbserverFix,
+               LdLibPathNoReset: args.LdLibPathNoReset,
+               ExitImmediate:    args.ExitImmediate,
+               CmdTimeout:       args.CmdTimeout,
        }
        if err := svr.CommandExec(xsArgs, &res); err != nil {
                common.APIError(c, err.Error())
index d5f809f..0bd5315 100644 (file)
@@ -169,8 +169,6 @@ func (p *Projects) Add(newP xaapiv1.ProjectConfig, fromSid, requestURL string) (
                } else {
                        fd.WriteString("#export XDS_SDK_ID=???\n")
                }
-               fd.WriteString("\n# Only disable reset of LD_LIBRARY_PATH if you are absolutely know what you are doing!\n")
-               fd.WriteString("export LD_LIBRARY_PATH=''\n")
                fd.Close()
        }
 
index 4b089e7..c6870d9 100644 (file)
@@ -20,17 +20,18 @@ package xaapiv1
 type (
        // ExecArgs JSON parameters of /exec command
        ExecArgs struct {
-               ID              string   `json:"id" binding:"required"`
-               SdkID           string   `json:"sdkID"` // sdk ID to use for setting env
-               CmdID           string   `json:"cmdID"` // command unique ID
-               Cmd             string   `json:"cmd" binding:"required"`
-               Args            []string `json:"args"`
-               Env             []string `json:"env"`
-               RPath           string   `json:"rpath"`           // relative path into project
-               TTY             bool     `json:"tty"`             // Use a tty, specific to gdb --tty option
-               TTYGdbserverFix bool     `json:"ttyGdbserverFix"` // Set to true to activate gdbserver workaround about inferior output
-               ExitImmediate   bool     `json:"exitImmediate"`   // when true, exit event sent immediately when command exited (IOW, don't wait file synchronization)
-               CmdTimeout      int      `json:"timeout"`         // command completion timeout in Second
+               ID               string   `json:"id" binding:"required"`
+               SdkID            string   `json:"sdkID"` // sdk ID to use for setting env
+               CmdID            string   `json:"cmdID"` // command unique ID
+               Cmd              string   `json:"cmd" binding:"required"`
+               Args             []string `json:"args"`
+               Env              []string `json:"env"`
+               RPath            string   `json:"rpath"`            // relative path into project
+               TTY              bool     `json:"tty"`              // Use a tty, specific to gdb --tty option
+               TTYGdbserverFix  bool     `json:"ttyGdbserverFix"`  // Set to true to activate gdbserver workaround about inferior output
+               LdLibPathNoReset bool     `json:"ldLibPathNoReset"` // Set to true to not reset LD_LIBRARY_PATH when sourcing environment file
+               ExitImmediate    bool     `json:"exitImmediate"`    // when true, exit event sent immediately when command exited (IOW, don't wait file synchronization)
+               CmdTimeout       int      `json:"timeout"`          // command completion timeout in Second
        }
 
        // ExecResult JSON result of /exec command