Skip to content

Option to turn off binary file stripping when when using slim: true #326

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 2 commits into from
Mar 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,16 @@ custom:
This will remove all folders within the installed requirements that match
the names in `slimPatterns`

#### Option not to strip binaries

In some cases, stripping binaries leads to problems like "ELF load command address/offset not properly aligned", even when done in the Docker environment. You can still slim down the package without `*.so` files with
```yaml
custom:
pythonRequirements:
slim: true
strip: false
```

### Lamba Layer
Another method for dealing with large dependencies is to put them into a
[Lambda Layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html).
Expand Down
7 changes: 6 additions & 1 deletion lib/slim.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ const glob = require('glob-all');
const fse = require('fs-extra');

const getStripMode = options => {
if (options.slim === false || options.slim === 'false') {
if (
options.strip === false ||
options.strip === 'false' ||
options.slim === false ||
options.slim === 'false'
) {
return 'skip';
} else if (options.dockerizePip) {
return 'docker';
Expand Down