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

Add post-sync build directive for modules #172

Closed
MatthewEppelsheimer opened this issue Mar 1, 2017 · 3 comments
Closed

Add post-sync build directive for modules #172

MatthewEppelsheimer opened this issue Mar 1, 2017 · 3 comments

Comments

@MatthewEppelsheimer
Copy link

Currently if a module's source requires a build process to compile after syncing that's more involved than picking or dropping certain files, said process needs to be run after a peru sync.

The feature would be specifying in peru.yaml a script within the module to execute after a peru sync. Perhaps use keyword build.

It's possible to script this in a watcher that wraps peru sync operations, so maybe this is out of scope for the project, similar to peru override watch #163. (?)

@olson-sean-k
Copy link
Member

Some time ago, we actually had a build field but decided to remove it. Rather than having peru orchestrate builds, we think it's generally better to have build tools invoke peru. See #39. Scripting this outside of peru is probably the way to go. Thoughts, @oconnor663?

@oconnor663
Copy link
Member

Yep, that issue is a little confusing to read, because it refers to other parts of the design that we got rid of early on, but the two main points are:

  • Supporting a build step means that a ton of information needs to pass through peru that didn't before, like multiple targets (tests, docs, etc.) and modes (debug, release, profiling, etc.) -- whatever knobs your build system might support. Peru wouldn't have any concept of what these things mean, but the command line syntax (and maybe the peru.yaml format) would need to expose all of it somehow. This feels easy when you have a small project that only builds one way, but Makefiles get very complicated as projects grow.
  • There are security issues around recursive modules and build steps. We consider our security requirements the same as git's: Even if you're fetching from an evil remote, all they can do is give you files that go under your sync directory. They can't put files anywhere else on your system, and they especially can't make you run arbitrary code. That would change if recursive modules supported build commands.

Have you gotten a chance to read https://github.com/buildinspace/peru/tree/master/docs/make_examples?

@oconnor663
Copy link
Member

I'll close this for now, but feel free to ask more questions here. I'm especially interested in feedback on that make_examples doc.

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