Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple versions can't coexist when installing please via Homebrew #1175

Closed
sagikazarmark opened this issue Sep 4, 2020 · 11 comments
Closed

Comments

@sagikazarmark
Copy link
Contributor

When please is installed with Homebrew and there different Please versions in use, Please always downloads a new copy differing from the current version.

I guess it's related to Homebrew.

@peterebden
Copy link
Member

Are these updates happening because you have a version set in .plzconfig? If you want to manage the version with Homebrew you should probably leave that out of the config.

@sagikazarmark
Copy link
Contributor Author

Are these updates happening because you have a version set in .plzconfig?

Yes. I like that there is a script in the repo that I can use, but I also prefer using plz instead of ./pleasew.

So what's the solution then?

I found a ~/.please directory in the mean time, I could add that to my $PATH. Would it make sense to add this to the installation instructions?

@peterebden
Copy link
Member

Can you not just remove the version = <whatever> line from plzconfig? That's orthogonal to pleasew etc; if it's not set plz won't try to update itself unless you do an explicit plz update.

@sagikazarmark
Copy link
Contributor Author

I want to make sure that the same version of please is used locally and in CI. Not using the same versions is what usually leads to weird issues and hours of debugging.

I thought that the version config was there to ensure that.

@peterebden
Copy link
Member

OK, that makes sense - I'm slightly confused as to the original issue though, is it that you're pinning a version but Homebrew is installing a newer version if available? And hence whenever you run plz it will always say it's downgrading itself as it swaps to the version in ~/.please.

You can definitely add ~/.please to your PATH, that will work and is what we used to do internally - we now put the pleasew script as /usr/local/bin/plz which is a bit easier for us to manage.

@sagikazarmark
Copy link
Contributor Author

is it that you're pinning a version but Homebrew is installing a newer version if available?

No, it's actually please that gets confused.

  1. Let's say I installed Please 15.1.0 with Homebrew.
  2. Then I run plz in a project which is pinned to a different version (eg. 15.0.0). It will download that version and use it.
  3. When I run plz in a second project, that's pinned to 15.1.0, it will download 15.1.0 (again).
  4. When I go back to the first project, plz downloads 15.0.0 again

Every time I switch to a project that is pinned to a different (but in theory, already downloaded) version, plz downloads it again. I guess it's Homebrew related. It's either a bug that can be fixed somewhere, or version pinning is just not compatible with Homebrew.

@peterebden
Copy link
Member

Ah, I see. Sorry, having a bit of a slow day 😃

Agreed that doesn't seem right. I'll dig out my macbook and try to see what it's up to.

@peterebden
Copy link
Member

Right - looks like it is downloading into /usr/local/Cellar which, to me at least, seems to be clearly the wrong thing.

Currently we have one concept of "install directory" which can be set in the config; if it's not we assume it's wherever the plz binary lives. That facilitates running it directly from Homebrew and finding the tools from that (it would be a bit simplified by #1145 ). However it's also using that to download into.
I think we need to have a separate concept of "download directory" for when it needs to fetch a new version which defaults to ~/.please. That would fix the repeated downloads, although you'd still get messages saying it was changing versions for repos that didn't match the brewed version - but I think that is probably inevitable in that setup.

@sagikazarmark
Copy link
Contributor Author

Actually, version diff from the brew version is not a problem. If I installed 15.0.0 with brew and pinned 15.2.0 everywhere, it works just fine.

@Tatskaari
Copy link
Member

I think what we do internally on our workers is kinda similar to how rust manages their toochain. When you install rust you actually install rustup that is responsible for managing the active toolchain version.

I'm thinking it might make sense if we do what we do internally in the general case i.e. when you install please, we actually just install .pleasew in /usr/bin/plz (or where ever) and that then installs the correct version of please in ~/.please.

@Tatskaari
Copy link
Member

Will address this in #1192

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants