Skip to content

Commit 9ee90c7

Browse files
committed
fix: prevent conflict between binaries
1 parent 098cf3a commit 9ee90c7

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ on:
33
push:
44
branches:
55
- master
6+
- backport/*
67
pull_request:
78

89
jobs:

src/main.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,18 @@ async function main(): Promise<void> {
7373
console.log("[ DONE ]")
7474

7575
process.stdout.write("> Building directories... ")
76-
const stagingDir = resolve(
77-
join(configs.stagingDirectory, config.os, config.arch, config.runtime, `${dist.abi()}`, config.addonSubdirectory),
78-
)
79-
const targetDir = resolve(
80-
join(configs.targetDirectory, config.os, config.arch, config.runtime, `${dist.abi()}`, config.addonSubdirectory),
76+
77+
const subDirectory = join(
78+
config.os,
79+
config.arch,
80+
config.runtime,
81+
`${config.libc}-${dist.abi()}-${configs.buildType}`,
82+
config.addonSubdirectory,
8183
)
84+
85+
const stagingDir = resolve(join(configs.stagingDirectory, subDirectory))
86+
const targetDir = resolve(join(configs.targetDirectory, subDirectory))
87+
8288
console.log("[ DONE ]")
8389

8490
process.stdout.write("> Applying overrides... ")

test/zeromq.test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ suite("zeromq", { timeout: 300_000 }, (tests) => {
4747
cwd: zeromqPath,
4848
})
4949

50-
const addonPath = `${process.platform}/${process.arch}/node/131/addon.node`
51-
5250
// check manifest file
5351
const manifestPath = join(zeromqPath, "build/manifest.json")
5452
expect(existsSync(manifestPath), `Manifest file ${manifestPath} does not exist`).toBe(true)
@@ -71,6 +69,14 @@ suite("zeromq", { timeout: 300_000 }, (tests) => {
7169
libc: configKey.libc,
7270
}
7371

72+
const addonPath = join(
73+
process.platform,
74+
process.arch,
75+
"node",
76+
`${configKey.libc}-${configKey.abi}`,
77+
"addon.node",
78+
)
79+
7480
expect(manifest).toEqual({
7581
[JSON.stringify(expectedConfig)]: addonPath,
7682
})

0 commit comments

Comments
 (0)