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

Remove Readonly Slice Directory Step from Packaging Process #32

Closed
InsertCreativityHere opened this issue Jan 16, 2024 · 3 comments
Closed

Comments

@InsertCreativityHere
Copy link
Member

Currently, when we package the extension, one of the steps we run is:

"make-readonly": "echo \"Making /slice readonly for distribution\" && chmod -R a-w ./slice"

This command causes the packaging script to fail on Windows, where chmod isn't a thing.
This is the only thing preventing the script from working on Windows.
So, I propose removing it, to make it possible to package and test on any platform.

Additionally, I don't think it's useful.
Most users wouldn't edit these files anyways, and if for some reason someone actually wants to edit them, this is going to do very little to stop them. More importantly, why should we care? In VSCode, you can "Jump to Definition" into the Rust source and edit that just fine.

@ReeceHumphreys
Copy link
Contributor

Additionally, I don't think it's useful. Most users wouldn't edit these files anyways, and if for some reason someone actually wants to edit them, this is going to do very little to stop them. More importantly, why should we care? In VSCode, you can "Jump to Definition" into the Rust source and edit that just fine.

I just did some testing; they are doing the same defense as us. If you open a rust source code file for, say, format! and introduce a bunch of syntax errors, somehow nothing propagates to the user's project, and the building works just fine. The opened file may be a special preview, a temporary file, or something that cannot be edited. This is what we want at the end of the day.

Changing the files to read-only is another way to achieve the same result as Rust Analyzer. This was just a temporary hack solution to achieve the goal. I definitely would be open to a better solution, though!

@InsertCreativityHere
Copy link
Member Author

I don't actually have a problem with making them readonly, my real gripe was that the packaging script just fails on Windows.

So, instead of actually removing this step, I updated our packaging scripts to be cross-platform.
See #52. If everyone is okay with that PR, I'll just close this issue.

@InsertCreativityHere
Copy link
Member Author

This was 'fixed' in #52.

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

2 participants