Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Add -gopath flag to init #496

Closed
darkowlzz opened this issue May 1, 2017 · 2 comments
Closed

Add -gopath flag to init #496

darkowlzz opened this issue May 1, 2017 · 2 comments

Comments

@darkowlzz
Copy link
Collaborator

Once #470 gets merged, -gopath flag should be added to init to enable different modes of operations.

By default, init should operate in network mode. Passing -gopath should run init in existing mode (current behavior), scan through current GOPATH for on-disk projects. More details in the spec.

@darkowlzz
Copy link
Collaborator Author

darkowlzz commented May 1, 2017

Spent some time pondering and implementing and came up with 2 solutions. Need feedback on them.

  • In init, after getProjectData is run, if -gopath is not passed (Network mode), empty pd.constraints, move pd.ondisk elements to pd.notondisk and empty pd.ondisk. This approach is simple, but it contains fetching projectData, which does a lot of things.

  • Other approach would be to not fetch projectData and initialize empty manifest and lock. Run solver and populate manifest and lock from the solution. This approach requires some extra conditional code but less execution overhead.

I have tried both of them and results seem to be the same. I would like to know if not relying on projectData from getProjectData could have any side effects that I have overlooked.

@sdboyer
Copy link
Member

sdboyer commented May 1, 2017

Other approach would be to not fetch projectData and initialize empty manifest and lock. Run solver and populate manifest and lock from the solution.

This would be my expected approach - absent any lock or manifest, the solver effectively is in "network mode."

This approach requires some extra conditional code but less execution overhead.

What sort of extra conditionals are you imagining?

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

No branches or pull requests

3 participants