This repository was archived by the owner on Dec 18, 2018. It is now read-only.
WIP: Create a cargo lambda
command to ease building #29
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Disclaimer: This is ugly code but figured I'd get feedback on the idea and direction before cleaning it up / making it work better
This PR creates a cargo binary (currently invoked with
cargo lambda
) that runs cargo commands in a docker container, essentially automating the manual lambda docker steps in the repo. Users of the tool can choose dynamic or static (musl) linking and the appropriate docker container with their current version of Rust is used.Right now there are two commands:
cargo lambda build
- Runscargo build
in a docker container.cargo lambda raw
- Runs a command verbatim in a docker container.I'm not sure this is the implementation we want, but something like this would be good to have for the average / simple case. We could even eventually add commands like
cargo lambda package
to make that step easier as well.There is an open question on how "magical" we want to be and what default assumptions the tool should make. For example, when invoked it will currently set
--release
unless--dev
is already set on the command line. This may be unexpected and undesirable, though we might assume that the average case will be building for prod and should have that set.Note that docker is an implementation detail and could be swapped out if something better comes up (like https://github.com/srijs/cargo-cross ?).