mjcrouch / vscode-perforce

Perforce commands for Visual Studio Code
MIT License
63 stars 51 forks source link

VSC fails to find workspace. Multiple workspaces over a couple of years. Want to get to the bottom of it #239

Open clampy opened 2 years ago

clampy commented 2 years ago

Hey there!

First of all thank you very much for fixing up the plugin. When it works for me, it works insanely well.

My setup is (seemingly) always the same, but sometimes I have issues with this, and sometimes I do not. I cannot find any rhyme or reason as to what is different, and it would be nice to figure out what is going on.

Issue:

Its weird to me that setting the workspace to the same name fixes the issue especially as they are the same. The only thing that has an issue with the workspace is the plugin, so there must be some way I set it up that is causing it to not find it correctly.

Here is the initialization:

> file:///c%3A/Users/clamp/Documents/Unreal%20Projects/ClampyLaptop_Nassau/Project_Nassau/Script: Trying to initialise SCM Providers in this workspace.
    Note: the following overrides apply in this workspace:
        perforce.port: none (will not override)
        perforce.user: none (will not override)
        perforce.client:    (will not override)
        perforce.dir: none  (will not override)
    Explicit overrides may prevent auto-detection of other perforce client workspaces
Looking for a client root using the workspace root directory
c:\Users\clamp\Documents\Unreal Projects\ClampyLaptop_Nassau\Project_Nassau\Script: p4.exe 'info'
> file:///c%3A/Users/clamp/Documents/Unreal%20Projects/ClampyLaptop_Nassau/Project_Nassau/Script: NO CLIENT ROOT FOUND in workspace root directory
> file:///c%3A/Users/clamp/Documents/Unreal%20Projects/ClampyLaptop_Nassau/Project_Nassau/Script: Looking for perforce config files
c:\Users\clamp\Documents\Unreal Projects\ClampyLaptop_Nassau\Project_Nassau\Script: p4.exe 'set' '-q'
> file:///c%3A/Users/clamp/Documents/Unreal%20Projects/ClampyLaptop_Nassau/Project_Nassau/Script: Did NOT find a valid P4CONFIG setting.
!!! IMPORTANT !!!
Previously, if no P4CONFIG setting was found, the extension would look for files name .p4config and parse them.
This is no longer the case. If you use p4config files, Please set your P4CONFIG setting and restart,
Either via environment variables or p4 set, e.g.:
        p4 set P4CONFIG=.p4config
!!! IMPORTANT !!!

> file:///c%3A/Users/clamp/Documents/Unreal%20Projects/ClampyLaptop_Nassau/Project_Nassau/Script: Found 0 config file(s)
> file:///c%3A/Users/clamp/Documents/Unreal%20Projects/ClampyLaptop_Nassau/Project_Nassau/Script: Finding client roots using each file's directory
> file:///c%3A/Users/clamp/Documents/Unreal%20Projects/ClampyLaptop_Nassau/Project_Nassau/Script: Found the following roots from the location of 0 P4CONFIG file(s):`

> file:///c%3A/Users/clamp/Documents/Unreal%20Projects/ClampyLaptop_Nassau/Project_Nassau/Script: NO valid perforce clients found in this directory.
If you were expecting a valid client to be found:
  * Check if you can run perforce commands in this directory from the command line.
  * Look at the perforce commands above, see if they match your expectations and can be run in the directory shown.
  * Review your override settings in vscode, perforce.port, perforce.user, perforce.client, perforce.dir
    * you may need to set or unset them appropriately

Initialisation finished
==============================

P4 Info:

Client name: ClampyLaptop_Nassau
Client host: Clampy-Laptop
Client root: C:\Users\clamp\Documents\Unreal Projects\ClampyLaptop_Nassau
mjcrouch commented 2 years ago

Hi - it does seem mysterious that it would work sometimes and not others. Do you regularly change the shell in vs code at-all? (e.g. switching between them?) I think there's a separate execution shell setting as well. I'm not sure whether that's likely to be related anyway.

Another random thought might be case sensitivity - e.g. p4 server is case sensitive and windows is not - are you always opening the folder with the same case?

Probably I should probably add some more debug output as an extra option - i.e. print the output of all the commands it's running so that we can see what p4 is saying. That might help us to work out what's wrong

clampy commented 2 years ago

Hello!

it does seem mysterious that it would work sometimes and not others.

I should be super clear. For workspaces that it works, it always works, and for workspaces that it doesn't work with, it doesn't work. There is never a situation (that I can recall) that the plugin fails to find the workspace after it had previously found it.

But yeah, that is one reason why I can't find a rhyme or reason for it. We had a ~20 or so developers using the plugin (for exactly the same depot), where some had no issues at all, others had to add one setting, others had to adjust another. With this in mind, it is likely to be to do with how the workspace is created; the directory name, drive name, workspace character symbols etc. When you are working on one depot its easy just to adjust the settings you need to get it working, then forget it. But now that I am using it from home, and might have a handful of small projects I swap between/devices I use, it becomes a bit more cumbersome to constantly do all of these small tweaks.

Do you regularly change the shell in vs code at-all? (e.g. switching between them?) I think there's a separate execution shell setting as well. I'm not sure whether that's likely to be related anyway.

I am not sure what you meant by the shell comment, sorry. I typically only do:

Once the connection has been made, I don't touch it again or really fiddle with any other settings. For the workspaces where the connection works, I can change folder to swap between the different projects seamlessly, my only issue is getting the initial connection to work.

It should be noted that the Client/User/Port settings that we override are just adding identical information to what is already in the workspace params.

Another random thought might be case sensitivity - e.g. p4 server is case sensitive and windows is not - are you always opening the folder with the same case?

I open the folder through the prompt, so I never manually type in the directory. The connection logs' case all seems to match the actual workspaces/username/port in Perforce. Only other case sensitivity I can think of is the User. I have a couple where I am using PascalCase and others where I am all lower case. However, the fix for these workspaces is to override the Client name, not the User. Also, the connection issue doesn't match the case used.

I can work around it by swapping the client string (or setting it under workspace, as its basically only me using it on my personal projects anyway), but if there is a way to debug why this is happening, that would be super nice.

If you have the time (and want to put extra effort into it) it would be very nice to debug and see what the hell is going on. I know people that use the plugin for their personal projects that have experienced this issue, so you wouldn't be only fixing it for me.

Either way, it is technically a fixable problem on my end by overriding settings, so this doesn't completely stop my ability to use the plugin. I am happy to keep using these workarounds as small tweaking vastly outweighs the benefit of the plugin once it works (so thank you for that). If you had heard of these issues and had a silver bullet, then I would take it and be happy, but I wasn't expecting you to put a lot of extra work into debugging this with me.

Anyway, thank you for getting back to me. If it's quick to add some debugging options, that would be lovely. I will test as much as I can. Maybe you find a gremlin you didn't know you had.

mjcrouch commented 2 years ago

For workspaces that it works, it always works, and for workspaces that it doesn't work with, it doesn't work. There is never a situation (that I can recall) that the plugin fails to find the workspace after it had previously found it.

Ah - I was misreading it as working at different times for the same workspace

In that case the shell think is unlikely to be it - the idea was if you switch between powershell, bash etc. the environment might be different leading to missing env variables etc.

A new version is publishing now with the debug logging. If you enable the perforce.debugP4Commands setting, restart vs code, then it will start logging to the js console. You can access it with the 'Toggle developer tools' command.

Once that's open you should see on startup the p4 info and p4 set commands that you can match up to the output log you pasted earlier.

Each command should have two log messages with the same id, one with [P4 RUN] <id> which shows the command being run, including all the env variables, working directory etc. The next with [P4 RES] <id> which will include the stdout and stderr from the p4 command

image

From the 'info' output it's mainly looking for the 'Client root:' comparing it against the open folder, applying some normalisation (which includes checking the server's case insensitivity) and checking if one is a substring of the other. So, if p4 info is returning a sensible path, then this normalisation / comparison is probably where it's falling down. In fact I should probably have added some more logging showing the two paths we're comparing to make it more obvious if this is the case!

Well - hopefully this is enough to progress for now, and if not I'll add some more initialisation logging

clampy commented 2 years ago

Straight off the bat I am getting something interesting.

[Extension Host] [P4 RES] 1 Stdout: User name: clampy Client name: Clampy_Laptop Client host: Clampy-Laptop Client unknown. Current directory: c:\Users\clamp\Documents\Unreal Projects\ClampyLaptop_Nassau\Project_Nassau\Script Peer address: Client address: Server address: Server root: C:\Program Files\Perforce\Server Server date: 2022/08/14 21:01:38 +0200 W. Europe Daylight Time Server uptime: 45:39:42 Server version: P4D/NTX64/2016.2/1612602 (2018/01/24) Server license: none Case Handling: insensitive

============================ Stderr:

Any idea why that might be incorrect? It swaps when I change folder (to another workspace), so I assume it is the plugin fetching this information right? Is this something I am setting up incorrectly on my end? Or is it an error in how the plugin finds the Client name?

Have I been using the plugin wrong this entire time? I assumed selecting the folder would search for the client information at the folder, as if you would check for the perforce workspace, but it seems to be doing it at the user folder, regardless of what folder is selected.

C:\Users\clamp>p4 info User name: clampy Client name: Clampy_Laptop Client host: Clampy-Laptop Client unknown. Current directory: c:\Users\clamp

c:\Users\clamp\Documents\Unreal Projects\ClampyLaptop_Nassau>p4 info User name: clampy Client name: ClampyLaptop_Nassau Client host: Clampy-Laptop Client root: C:\Users\clamp\Documents\Unreal Projects\ClampyLaptop_Nassau Current directory: c:\Users\clamp\Documents\Unreal Projects\ClampyLaptop_Nassau

So the first would rightly be wrong. If this is some setup that I have done incorrectly this entire time, then I apologise for wasting your time...

mjcrouch commented 2 years ago

"Client name", which is meant to be the workspace name right?

yes client = p4 workspace here (I normally use client to avoid confusing it with vs code workspaces, and it's how the cli / env vars etc. refer to it)

Have I been using the plugin wrong this entire time? I assumed selecting the folder would search for the client information at the folder, as if you would check for the perforce workspace, but it seems to be doing it at the user folder, regardless of what folder is selected.

I don't think you're using it wrong - it does search in the folder that you open - as you can see by the 'current directory' in the [P4 RES] output. It's just not finding the right client

Any idea why that might be incorrect? It swaps when I change folder (to another workspace), so I assume it is the plugin fetching this information right?

Well it's simply the extension running p4 info within that directory and looking for the client root. I'm assuming that the p4 info you pasted in to the first post is the output from running p4 info inside the same directory?

Which means there is some difference between the environment that is running the p4 commands, and the shell environment when you use the terminal normally. If you look at the [P4 RUN] line for the p4 info command and expand the env block then it might give you some clues if there's something obviously wrong. Even maybe the output of p4 set which should be below p4 info (not sure if it will say anything useful)

To be specific we're using cross-spawn to spawn the child p4 process, and passing in all the env variables that vs code provides us. But I'm not totally sure where that comes from. I think if you compare the env vars you might find some important difference - I'm just not sure why it's different to your normal environment

clampy commented 2 years ago

it does search in the folder that you open - as you can see by the 'current directory' in the [P4 RES] output. It's just not finding the right client

Ah yeah my bad. I was staring at the result and making an incorrect assumption. Yay me.

Thank you. I'll do my best to do some comparisons and see what is wrong, and where - but honestly a lot of these properties are a bit unknown to me and I don't exactly know what I am looking for.

I'll reply again if I find anything suspicious! Thanks again.

I doubt you want to, but if you are curious and want to dig, you are welcome to RDP and do some digging yourself. I know from history how much faster it can be when you know what you are looking for.

clampy commented 2 years ago

Ok so I seem to have got it working, but the fix is kind of weird, and I am not sure it should matter?

I was looking through the logs and basically didn't see anything that was incorrect. All of the directories and names were correct, except for when the reply came back and p4 info was showing the wrong root.

I was searching around for the error it was giving to see if that would give any information. Basically, the client root shouldn't matter if you are outside of a workspace, but it should be correct when you are viewing inside of the workspace directory (like how doing "P4 Info" inside the workspace directory returns the correct workspace & root, but doing it from C:\ didn't.

I tried to just do some digging to see what the information actually was to see if that could be causing something. On my laptop, I ran "P4 Client". A notepad file opened. I barely looked at it and closed it (I didn't change anything, so that shouldn't have done anything). Output logged that it had "Saved Client", weird but okay.

What I had accidentally done is fixed an error where my default root was null, which is why I wasn't finding any workspaces outside of running P4 Info within the directory. What it did was set it to the user folder. Now when I write "P4 Info" I don't get the "Client Unknown" error anymore.

I didn't know I did all of this, but out of the blue the plugin started to connect with all of my workspaces without overriding any files. Fantastic, now what on earth did I do, and how can I replicate it on my PC?

After retracing my steps and realizing that I had set the client root to something more sensible, I did the same thing for my PC. Updated the root to the folder that houses all of my workspaces. And what do you know, it starts working on my PC as well.

Now, perhaps all of this is on me to start with, and I should always have a sensible default client root, but this also feels a bit.... wrong? Like, what if I have half of my projects on H:\ and the other half on D:\? I will still get the error on one of the drives as the default root is only set for one of them.

Anyway, that was the issue - the directory that the plugin was searching for was not inside the default client root. I don't know if this is a limitation that has to be there, or if there's some logic in the plugin that uses the default root to search from.

Is there any way for the plugin to sorta override the client root for the search? Or is this just how perforce works and I have to live with it?

Thank you so much for your help. At least I am a bit wiser now.

mjcrouch commented 2 years ago

Well, I can't say I understand it, but it's some kind of progress :)

Anyway, that was the issue - the directory that the plugin was searching for was not inside the default client root. I don't know if this is a limitation that has to be there, or if there's some logic in the plugin that uses the default root to search from.

The 'default' client root really shouldn't matter because it should be picking up the correct client, the same one as if you ran p4 info on the command line. There is really very little logic in the extension for this and unless you explicitly override the config, we rely on p4 to tell us which client to use and where it is - we don't do anything to adjust where p4 is 'searching' for clients - this is generally all defined in your environment using either p4 set or environment variables P4CLIENT / P4CONFIG etc.

This is why I was interested in the difference between your environment variables in and out of vs code - whether there are any P4 environment variables missing / present in one but not the other. Particularly on windows e.g. P4ENVIRO can determine whether p4 set uses the registry or a separate file.

I think what would help is the output of both p4 info and p4 set in both the command line where it normally works fine, and within the extension from the js debug. Comparing particularly p4 set we should be able to see the specific source of each variable.

clampy commented 2 years ago
  • which would probably just map to the whole depot

Yeah indeed. The name doesn't change from the default client, so each time I call the "P4 Client" it seems to edit the default client (uses the same name). Both of these on my PC and Laptop are in some way linked to the name of the computer, so I am pretty sure these are created when you first connect to the depot or something.

I can easily break it (and refix it) again by just setting the root to a directory that isn't in the same hierarchy as the workspace I am trying to connect to. Either way, this is the part that is failing. I think I'll just share the parts you mentioned and see if I missed anything.

C:\AbsolutelyNotTheRightFolder is the default root (If it's wrong, you'll see this) C:\Users\clamp\Documents\Unreal Projects\ClampyLaptop_Nassau\Project_Nassau\Script is the selected folder

P4 Info from CMD in workspace root:

c:\Users\clamp\Documents\Unreal Projects\ClampyLaptop_Nassau\Project_Nassau\Script>p4 info User name: clampy Client name: ClampyLaptop_Nassau Client host: Clampy-Laptop Client root: C:\Users\clamp\Documents\Unreal Projects\ClampyLaptop_Nassau Current directory: c:\Users\clamp\Documents\Unreal Projects\ClampyLaptop_Nassau\Project_Nassau\Script Peer address: 192.168.1.6:56903 Client address: 192.168.1.6 Server address: Media-Centre.localdomain:1666 Server root: C:\Program Files\Perforce\Server Server date: 2022/08/15 23:46:30 +0200 W. Europe Daylight Time Server uptime: 72:24:34 Server version: P4D/NTX64/2016.2/1612602 (2018/01/24) Server license: none Case Handling: insensitive

P4 Set from CMD in workspace root:

c:\Users\clamp\Documents\Unreal Projects\ClampyLaptop_Nassau\Project_Nassau\Script>p4 set P4CLIENT=ClampyLaptop_Nassau P4EDITOR=C:\Windows\system32\Notepad.exe (set) P4IGNORE=p4ignore.txt (set) P4PORT=media-centre:1666 P4USER=clampy P4_media-centre:1666_CHARSET=none (set)

P4 Info [RUN]:

[Extension Host] [P4 RUN] 1 p4.exe ['info']

{cwd: 'c:\Users\clamp\Documents\Unreal Projects\ClampyLaptop_Nassau\Project_Nassau\Script', env: {…}} cwd: "c:\Users\clamp\Documents\Unreal Projects\ClampyLaptop_Nassau\Project_Nassau\Script" env: ALLUSERSPROFILE: "C:\ProgramData" APPDATA: "C:\Users\clamp\AppData\Roaming" CHROME_CRASHPAD_PIPE_NAME: "\\.\pipe\crashpad_12344_XWCWPRVILWIBKYKY" COMPUTERNAME: "CLAMPY-LAPTOP" ComSpec: "C:\Windows\system32\cmd.exe" CommonProgramFiles: "C:\Program Files\Common Files" CommonProgramFiles(x86): "C:\Program Files (x86)\Common Files" CommonProgramW6432: "C:\Program Files\Common Files" DriverData: "C:\Windows\System32\Drivers\DriverData" ELECTRON_RUN_AS_NODE: "1" FPS_BROWSER_APP_PROFILE_STRING: "Internet Explorer" FPS_BROWSER_USER_PROFILE_STRING: "Default" HOMEDRIVE: "C:" HOMEPATH: "\Users\clamp" LOCALAPPDATA: "C:\Users\clamp\AppData\Local" LOGONSERVER: "\\CLAMPY-LAPTOP" NUMBER_OF_PROCESSORS: "20" ORIGINAL_XDG_CURRENT_DESKTOP: "undefined" OS: "Windows_NT" OneDrive: "C:\Users\clamp\OneDrive" OneDriveConsumer: "C:\Users\clamp\OneDrive" PATHEXT: ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC" PROCESSOR_ARCHITECTURE: "AMD64" PROCESSOR_IDENTIFIER: "Intel64 Family 6 Model 154 Stepping 3, GenuineIntel" PROCESSOR_LEVEL: "6" PROCESSOR_REVISION: "9a03" PSModulePath: "C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules" PUBLIC: "C:\Users\Public" PWD: "c:\Users\clamp\Documents\Unreal Projects\ClampyLaptop_Nassau\Project_Nassau\Script" Path: "C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Perforce\;C:\Users\clamp\AppData\Local\Microsoft\WindowsApps;;C:\Users\clamp\AppData\Local\Programs\Microsoft VS Code\bin" ProgramData: "C:\ProgramData" ProgramFiles: "C:\Program Files" ProgramFiles(x86): "C:\Program Files (x86)" ProgramW6432: "C:\Program Files" SESSIONNAME: "Console" SystemDrive: "C:" SystemRoot: "C:\Windows" TEMP: "C:\Users\clamp\AppData\Local\Temp" TMP: "C:\Users\clamp\AppData\Local\Temp" USERDOMAIN: "CLAMPY-LAPTOP" USERDOMAIN_ROAMINGPROFILE: "CLAMPY-LAPTOP" USERNAME: "clamp" USERPROFILE: "C:\Users\clamp" VSCODE_AMD_ENTRYPOINT: "vs/workbench/api/node/extensionHostProcess" VSCODE_CODE_CACHE_PATH: "C:\Users\clamp\AppData\Roaming\Code\CachedData\6d9b74a70ca9c7733b29f0456fd8195364076dda" VSCODE_CWD: "C:\Users\clamp\AppData\Local\Programs\Microsoft VS Code" VSCODE_HANDLES_UNCAUGHT_ERRORS: "true" VSCODE_IPC_HOOK: "\\.\pipe\c3abcc8e1977ab1575394efdb834b1d6-1.70.1-main-sock" VSCODE_NLS_CONFIG: "{\"locale\":\"en-gb\",\"availableLanguages\":{},\"_languagePackSupport\":true}" VSCODE_PID: "12344" ZES_ENABLE_SYSMAN: "1" windir: "C:\Windows"

P4 Info [RES]:

[Extension Host] [P4 RES] 1 Stdout: User name: clampy Client name: Clampy_Laptop Client host: Clampy-Laptop Client root: c:\AbsolutelyNotTheRightFolder Current directory: c:\Users\clamp\Documents\Unreal Projects\ClampyLaptop_Nassau\Project_Nassau\Script Peer address: 192.168.1.6:56762 Client address: 192.168.1.6 Server address: Media-Centre.localdomain:1666 Server root: C:\Program Files\Perforce\Server Server date: 2022/08/15 23:41:49 +0200 W. Europe Daylight Time Server uptime: 72:19:53 Server version: P4D/NTX64/2016.2/1612602 (2018/01/24) Server license: none Case Handling: insensitive

============================ Stderr:

P4 Set [RUN]:

[Extension Host] [P4 RUN] 2 p4.exe (2) ['set', '-q']

{cwd: 'c:\Users\clamp\Documents\Unreal Projects\ClampyLaptop_Nassau\Project_Nassau\Script', env: {…}} cwd: "c:\Users\clamp\Documents\Unreal Projects\ClampyLaptop_Nassau\Project_Nassau\Script" env: ALLUSERSPROFILE: "C:\ProgramData" APPDATA: "C:\Users\clamp\AppData\Roaming" CHROME_CRASHPAD_PIPE_NAME: "\\.\pipe\crashpad_12344_XWCWPRVILWIBKYKY" COMPUTERNAME: "CLAMPY-LAPTOP" ComSpec: "C:\Windows\system32\cmd.exe" CommonProgramFiles: "C:\Program Files\Common Files" CommonProgramFiles(x86): "C:\Program Files (x86)\Common Files" CommonProgramW6432: "C:\Program Files\Common Files" DriverData: "C:\Windows\System32\Drivers\DriverData" ELECTRON_RUN_AS_NODE: "1" FPS_BROWSER_APP_PROFILE_STRING: "Internet Explorer" FPS_BROWSER_USER_PROFILE_STRING: "Default" HOMEDRIVE: "C:" HOMEPATH: "\Users\clamp" LOCALAPPDATA: "C:\Users\clamp\AppData\Local" LOGONSERVER: "\\CLAMPY-LAPTOP" NUMBER_OF_PROCESSORS: "20" ORIGINAL_XDG_CURRENT_DESKTOP: "undefined" OS: "Windows_NT" OneDrive: "C:\Users\clamp\OneDrive" OneDriveConsumer: "C:\Users\clamp\OneDrive" PATHEXT: ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC" PROCESSOR_ARCHITECTURE: "AMD64" PROCESSOR_IDENTIFIER: "Intel64 Family 6 Model 154 Stepping 3, GenuineIntel" PROCESSOR_LEVEL: "6" PROCESSOR_REVISION: "9a03" PSModulePath: "C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules" PUBLIC: "C:\Users\Public" PWD: "c:\Users\clamp\Documents\Unreal Projects\ClampyLaptop_Nassau\Project_Nassau\Script" Path: "C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Perforce\;C:\Users\clamp\AppData\Local\Microsoft\WindowsApps;;C:\Users\clamp\AppData\Local\Programs\Microsoft VS Code\bin" ProgramData: "C:\ProgramData" ProgramFiles: "C:\Program Files" ProgramFiles(x86): "C:\Program Files (x86)" ProgramW6432: "C:\Program Files" SESSIONNAME: "Console" SystemDrive: "C:" SystemRoot: "C:\Windows" TEMP: "C:\Users\clamp\AppData\Local\Temp" TMP: "C:\Users\clamp\AppData\Local\Temp" USERDOMAIN: "CLAMPY-LAPTOP" USERDOMAIN_ROAMINGPROFILE: "CLAMPY-LAPTOP" USERNAME: "clamp" USERPROFILE: "C:\Users\clamp" VSCODE_AMD_ENTRYPOINT: "vs/workbench/api/node/extensionHostProcess" VSCODE_CODE_CACHE_PATH: "C:\Users\clamp\AppData\Roaming\Code\CachedData\6d9b74a70ca9c7733b29f0456fd8195364076dda" VSCODE_CWD: "C:\Users\clamp\AppData\Local\Programs\Microsoft VS Code" VSCODE_HANDLES_UNCAUGHT_ERRORS: "true" VSCODE_IPC_HOOK: "\\.\pipe\c3abcc8e1977ab1575394efdb834b1d6-1.70.1-main-sock" VSCODE_NLS_CONFIG: "{\"locale\":\"en-gb\",\"availableLanguages\":{},\"_languagePackSupport\":true}" VSCODE_PID: "12344" ZES_ENABLE_SYSMAN: "1" windir: "C:\Windows"

P4 Set [RES]:

[Extension Host] [P4 RES] 2 Stdout: P4CLIENT=Clampy_Laptop P4EDITOR=C:\Windows\system32\Notepad.exe P4IGNORE=p4ignore.txt P4PORT=media-centre:1666 P4USER=clampy P4_media-centre:1666_CHARSET=none

============================ Stderr:

Info and Set RUNs are identical.

I hope this is what you were looking for!

mjcrouch commented 2 years ago

I forgot we use p4 set -q which suppresses the sources. Oh well, I think we can infer where that client is coming from anyway.

Nevertheless this line from cmd:

P4CLIENT=ClampyLaptop_Nassau

doesn't have any brackets after it, which suggests you have this value set in an environment variable (I think?) - Is that how you have the p4 client set? - i.e. if you run 'set' in cmd, you would see the line P4CLIENT=ClampyLaptop_Nassau somewhere?

If so, this isn't present in the environment that vs code is running in, which would be a significant difference... (if not, then I don't know.)

clampy commented 2 years ago

Hmm, I'm honestly not sure what an environmental variable is or how I would set it. I did some googling and it looks like if "Use current settings for environment settings" is checked in my Environment Settings then this will be saved to environmental variables? Looks like mine is checked for all of my workspaces, probably by default? Perhaps there is some setup quirk that sets it to true (maybe if you skip the perforce startup prompt or something?).

mjcrouch commented 2 years ago

thanks, that seems potentially relevant - it's not a setting I've seen in p4v before but I'll have a look and see if I can work anything out

clampy commented 2 years ago

Glad I could help, even slightly. I am not programmer savvy, nor Perforce savvy (honestly every topic on perforce I read seems like it was specifically designed to be as confusing as possible).

Let me know if there is anything more I can help out with.