Skip to content

Commit 1e14525

Browse files
authored
Merge pull request #326 from sergeyk/master
Option to turn off binary file stripping when when using `slim: true`
2 parents 49ea2d0 + 6960cd9 commit 1e14525

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,16 @@ custom:
164164
This will remove all folders within the installed requirements that match
165165
the names in `slimPatterns`
166166

167+
#### Option not to strip binaries
168+
169+
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
170+
```yaml
171+
custom:
172+
pythonRequirements:
173+
slim: true
174+
strip: false
175+
```
176+
167177
### Lamba Layer
168178
Another method for dealing with large dependencies is to put them into a
169179
[Lambda Layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html).

lib/slim.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ const glob = require('glob-all');
33
const fse = require('fs-extra');
44

55
const getStripMode = options => {
6-
if (options.slim === false || options.slim === 'false') {
6+
if (
7+
options.strip === false ||
8+
options.strip === 'false' ||
9+
options.slim === false ||
10+
options.slim === 'false'
11+
) {
712
return 'skip';
813
} else if (options.dockerizePip) {
914
return 'docker';

0 commit comments

Comments
 (0)