Skip to content
Draft
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
cache: false
min-node-version: 18
rust: true
only: darwin-arm64,darwin-x64,linux-arm64,linux-x64
only: darwin-arm64,darwin-x64,linux-arm64,linux-x64,windows-x64
# Need this, now that libdatadog packages libunwind as a submodule
prebuild: '(command -v apk >/dev/null && apk add autoconf automake libtool) || (command -v apt-get >/dev/null && apt-get update && apt-get install -y autoconf automake libtool) || true'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
cache: false
min-node-version: 18
rust: true
only: darwin-arm64,darwin-x64,linux-arm64,linux-x64
only: darwin-arm64,darwin-x64,linux-arm64,linux-x64,windows-x64

publish:
runs-on: ubuntu-latest
Expand Down
5 changes: 3 additions & 2 deletions load.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const PLATFORM = os.platform()
const ARCH = process.arch
const LIBC = PLATFORM === 'linux' ? (existsSync('/etc/alpine-release') ? 'musl' : 'glibc') : ''
const ABI = process.versions.modules
const EXE_SUFFIX = PLATFORM === 'win32' ? '.exe' : ''

const inWebpack = typeof __webpack_require__ === 'function'
const runtimeRequire = inWebpack ? __non_webpack_require__ : require
Expand Down Expand Up @@ -52,7 +53,7 @@ function find (name, binary = false) {
// Only apply hyphen-to-underscore conversion for .node libraries, not binaries
const transformedName = binary ? name : name.replaceAll('-', '_')

const filename = binary ? transformedName : `${transformedName}.node`
const filename = binary ? `${transformedName}${EXE_SUFFIX}` : `${transformedName}.node`
const build = `${root}/build/Release/${filename}`

if (existsSync(build)) return build
Expand Down Expand Up @@ -84,7 +85,7 @@ function findFolder (root) {
function findFile (root, name, binary = false) {
const files = readdirSync(root)

if (binary) return files.find(f => f === name)
if (binary) return files.find(f => f === `${name}${EXE_SUFFIX}`)

return files.find(f => f === `${name}-${ABI}.node`)
|| files.find(f => f === `${name}-napi.node`)
Expand Down
4 changes: 3 additions & 1 deletion scripts/copy-artifacts.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ const lineReader = readline.createInterface({
input: fs.createReadStream(outPath),
})

const exeSuffix = process.platform === 'win32' ? '.exe' : ''

lineReader.on('line', function (line) {
const { filenames, reason, target } = JSON.parse(line)

if (reason !== 'compiler-artifact') return
if (!target.src_path.startsWith(cratesPath)) return

const filename = target.kind[0] === 'bin' ? target.name : `${target.name}.node`
const filename = target.kind[0] === 'bin' ? `${target.name}${exeSuffix}` : `${target.name}.node`
const filePath = path.join(buildPath, filename)

fs.mkdirSync(buildPath, { recursive: true })
Expand Down
Loading