-
Notifications
You must be signed in to change notification settings - Fork 0
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
Move from firejail to docker for building docs #9
Comments
It would be beneficial as well to be able to run all the crystaldoc programs via docker with one command - if that's feasible. |
Alternative: Make everything uper simple and build docs directly in the host environment. Installing multiple Crystal versions in parallel should be no issue. I believe this could be a very feasible alternative to building more and more complexity for the relatively simple task of extracting comments from the source code and turning it into HTML. |
I'm not sure how this could be accomplished without disabling macro file access altogether, which may limit some documentation generation. Not that I'm opposed to a compiler flag to disable some of these things, I just don't think it's possible to completely eliminate risk while keeping Crystal's macro system intact.
I don't think this is a simple task though. It requires parsing all of the shard and stdlib code and doing a top-level semantic. If it weren't for Crystal's macro system it could potentially be a lot simpler. I do like the macro system, but the way it's currently implemented puts a large hamper on what can be done here, and for tooling support, plus requires doing parsing all the way up to the final stages of semantic analysis. I think it may be interesting to explore a more structured macro system for 2.0, but that's neither here nor there. |
Accessing files should generally be fine, as long as the executing user doesn't have access to any sensitive information. Which it shouldn't anyway.
The vast majority of macros are self-contained within the source code. There are only a few features which break out from that, and they are used relatively rarely. And I'd argue that most of the time when they're used, they are more of a crook than an ideal solution. We should offer better alternatives for these use cases. |
If this could be added that would be much appreciated. That's one of the features of firejail and why I reached for it (along with restricting network access and restricting how much disk space / memory docs gen could take up).
I agree. |
Docker is what docs.rs uses, and it would give a lot more flexibility towards the environment docs are generated in, allowing for using older versions of the docs generator, adding custom libs, better security, and easier setup.
docs.rs uses rustwide, a secure execution environment built on Docker. A similar shard should be developed for Crystal for safe execution.
The text was updated successfully, but these errors were encountered: