0

I downloaded HELIX P4V for OSX here. I followed the setup-instructions from Assambla.com. I did this:

echo "export P4CONFIG=p4config.txt" >> ~/.bashrc
source ~/.bashrc
cd /path/to/project
echo "P4PORT=ssl:perforce.assembla.com:1667" >> p4config.txt
echo "P4HOST=myappname" >> p4config.txt
echo "P4USER=MyUsername" >> p4config.txt
echo "P4CHARSET=utf8" >> p4config.txt
echo "P4CLIENT=workspacename" >> p4config.txt
export P4HOST=MyHost
open /Applications/p4v.app

When i start my p4v.app, it says

Unable to find destination depot

You must set P4HOST variable according to the rules from your Perforce Tool information page

I assume these are two seperate errors, and the first is causing the second. Because my P4HOST is set. I can echo it in the terminal and i also can see it when i run p4 set.

Samwise
  • 68,105
  • 3
  • 30
  • 44
DerZyklop
  • 3,672
  • 2
  • 19
  • 27
  • 1
    You've got two settings of P4HOST there, and they don't look identical. Why? Also, modify your script so that, just before the last line, do `p4 set` and look closely through the output to see if you're getting the behavior you expect. Perhaps your `.bashrc` isn't setting up the P4CONFIG as you anticipate? I suspect the most likely issue is that P4V isn't finding your P4CONFIG. – Bryan Pendleton Jan 10 '17 at 13:17
  • 1
    Thanks @BryanPendleton. It seems to be solved, although i don't understand why. The output of `p4 set` was ok. P4CONFIG was set in .bashrc and when i put `echo 'foo'` into .bashrc then i can see that its loaded. But now, that i moved it to another of my dotfiles (.profile) it works. I moved it back to .bashrc and it still works. Yes, i opened a new Terminal tab everytime. I'm very confused now – but it works. ✌ – DerZyklop Jan 10 '17 at 13:56
  • 1
    I'm glad you got it figured out. Sounds like something was caching a stale configuration setting, and after enough nudges you got it reloaded. – Bryan Pendleton Jan 11 '17 at 04:53

1 Answers1

2

There's an order of precedence Perforce uses when there are multiple sources for the values of those variables. From highest to lowest it's:

  1. Given on the command line.
  2. Found in the file specified by P4CONFIG.
  3. Set in environment variables.

You can see which one it's using with the 'p4 set' command. Values coming from your config file will say 'config' and the path of the file(s) being used in parentheses.

Drew Marold
  • 175
  • 6