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

Error out early if building on OneDrive #677

Closed
PeterJohnson opened this issue Oct 13, 2023 · 5 comments · Fixed by #680
Closed

Error out early if building on OneDrive #677

PeterJohnson opened this issue Oct 13, 2023 · 5 comments · Fixed by #680

Comments

@PeterJohnson
Copy link
Member

PeterJohnson commented Oct 13, 2023

OneDrive breaks caching (and almost certainly other things too, like native extraction), so we should check early if the project is on OneDrive and error out if it is.

@spacey-sooty
Copy link
Contributor

Hey @PeterJohnson I can try and implement this, I am currently thinking to take the full directory of the project and check if OneDrive is a string within it. Does this seem good or is there a different implementation that you had in mind?

@PeterJohnson
Copy link
Member Author

That's pretty much exactly what I was thinking. It's unlikely that will hit false positives (e.g. someone names their user or project "OneDrive" feels unlikely).

@spacey-sooty
Copy link
Contributor

Hey @PeterJohnson I thought something like that was unlikely as well but we might want to add a note somewhere in the documentation about not creating projects in OneDrive. Not 100% sure where we would put that but I'm more than happy to add a note to the docs if you tell me where to

@PeterJohnson
Copy link
Member Author

That’s why there’s also a companion issue to this one on vscode-wpilib. If we do the same detection there it can warn when opening or prevent creation of a project, which should cover most users.

@spacey-sooty
Copy link
Contributor

@PeterJohnson that sounds good I hadnt seen that, I would guess most people not creating their project using the vscode creator would be keeping track of issues here

sciencewhiz added a commit to sciencewhiz/vscode-wpilib that referenced this issue Oct 30, 2023
This provides an even earlier detection point compared to gradlerio. wpilibsuite/GradleRIO#677
It should still be done in GradleRIO to catch things like moved and
cloned projects
ThadHouse pushed a commit that referenced this issue Nov 3, 2023
* search project initialised directory for onedrive in execute function

* apply changes from review

* fix error being supressed

* use runtime exception in onedrive error

* add print in error and make check case insensitive

* use Paths.get instead of user.dir

* move check to apply method and use gradle method instead of java method

* remove unnecessary imports from previous commit

* remove another unnecessary import

* fix printed directory

* catch and print error instead of throwing it

* try catch check only throw if try catch succeeds

* fix items from review
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

Successfully merging a pull request may close this issue.

2 participants