Skip to content

Allow 'strip' to be run via docker #292

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

Merged
merged 3 commits into from
Nov 29, 2018
Merged

Conversation

bsamuel-ui
Copy link
Contributor

This will check the best way to run strip, and run it either in the outside environment or in docker.

Since Mac OS X's strip can't process ELF objects, it has simply been failing. You can use the version of strip from GNU binutils, but that would require passing the path to your strip.

So since we have strip installed in lambci, it seems easiest to use that. This PR disables using strip on darwin and windows, but it will always use strip in docker mode. (Maybe the canonical way would be to pass a minimal ELF object to strip to see if it succeeds?)

This also cleans up how we're quoting arguments and building the commands. Basically, I take a "command" to be an "array of unqouted strings" and defer the responsibility of quoting. Hopefully the logic to build the commands is a bit more straightforward and extensible.

I'm not sure of a great way to test that strip runs in docker; any suggestions are welcome.

…alled correctly.

- Make sure we're consistently quoting arguments.
- Add mergeCommands function to construct a script for docker to run when needed.
- Add getStripMode to run strip correctly for the platform and docker.
@bsamuel-ui bsamuel-ui mentioned this pull request Nov 27, 2018
@bsamuel-ui bsamuel-ui requested a review from dschep November 27, 2018 19:13
@bsamuel-ui bsamuel-ui merged commit f6434f1 into serverless:master Nov 29, 2018
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 this pull request may close these issues.

4 participants