I think this is a relatively simple question, and I think I already know the answer but thought it might be worth asking anyway to get a more in depth understanding (which I don’t currently have) or have someone correct me if I’m completely wrong.
What does
pkg> activate .
actually do?
- I know that it activates the current environment, if an environment exists in the current working directory.
- My understanding is that this command searches for a
Project.toml
file in the current directory. I think this is the important point? - It doesn’t seem to matter if a
Project.toml
file does not exist in the current working directory, because the pkg REPL just reports that it has activated an environment with the current working directory name. (But no files are changed on disk.) - If
Project.toml
does not exist in the current working directory, then a new environment is created in the current working directory. This doesn’t actually do anything unless apkg> add PACKAGE
is run, which will create theProject.toml
file, because it does not exist.
Consider the following, possibly surprising behavior.
- Create a new Package with
pkg> generate MYPACKAGE
- This creates a subdirectory called
MYPACKAGE/src
cd
tosrc
- Run the Julia REPL,
]
to change to thepkg
REPL, then runactivate .
- Rather than activating the environment in the parent directory, this creates a new environment in the
src
directory. Is that a bit odd?