Skip to content

Commit 29e8d4e

Browse files
author
Maciej Wilczyński
committed
Add architecture to requirements cache directory name
1 parent ea38234 commit 29e8d4e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

lib/pip.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,8 @@ function installRequirementsIfNeeded(
541541
const workingReqsFolder = getRequirementsWorkingPath(
542542
reqChecksum,
543543
requirementsTxtDirectory,
544-
options
544+
options,
545+
serverless
545546
);
546547

547548
// Check if our static cache is present and is valid

lib/shared.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,20 @@ function checkForAndDeleteMaxCacheVersions(options, serverless) {
5555
* @param {string} subfolder
5656
* @param {string} servicePath
5757
* @param {Object} options
58+
* @param {Object} serverless
5859
* @return {string}
5960
*/
6061
function getRequirementsWorkingPath(
6162
subfolder,
6263
requirementsTxtDirectory,
63-
options
64+
options,
65+
serverless,
6466
) {
6567
// If we want to use the static cache
6668
if (options && options.useStaticCache) {
6769
if (subfolder) {
68-
subfolder = subfolder + '_slspyc';
70+
const architecture = serverless.service.provider.architecture || 'x86_64';
71+
subfolder = `${subfolder}_${architecture}_slspyc`;
6972
}
7073
// If we have max number of cache items...
7174

0 commit comments

Comments
 (0)