Skip to content

Commit 6d084f4

Browse files
Try setting cargo env var for cross compile (#79)
* Try setting cargo env var for cross compile * bump-version: Set release version 0.8.2-pre.2 * Don't run unit tests with cross-built binary * bump-version: Set release version 0.8.2-pre.3 * Make the rustc -vV parsing OS agnostic * bump-version: Set release version 0.8.2-pre.4 * Explain why we're skipping tests sometimes Co-authored-by: Leeroy Travis <[email protected]>
1 parent 9f83e42 commit 6d084f4

File tree

5 files changed

+16
-5
lines changed

5 files changed

+16
-5
lines changed

.github/workflows/publish.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ jobs:
4949
profile: minimal
5050
toolchain: stable
5151
target: ${{ matrix.system.target }}
52-
default: true
5352
override: true
5453
- name: Install modules
5554
run: yarn install --ignore-scripts
@@ -60,6 +59,7 @@ jobs:
6059
env:
6160
PRE_GYP_PLATFORM: ${{ matrix.system.pre_gyp_platform }}
6261
PRE_GYP_ARCH: ${{ matrix.system.pre_gyp_arch }}
62+
CARGO_BUILD_TARGET: ${{ matrix.system.target }}
6363
run: |
6464
node publish.js
6565
cd bin-package

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "recrypt-node-binding"
3-
version = "0.8.2-pre.1"
3+
version = "0.8.2-pre.4"
44
authors = ["IronCore Labs <[email protected]>"]
55
edition = "2021"
66
rust-version = "1.56.0"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ironcorelabs/recrypt-node-binding",
3-
"version": "0.8.2-pre.1",
3+
"version": "0.8.2-pre.4",
44
"description": "Bindings to allow the recrypt-rs library to work via NodeJS.",
55
"repository": {
66
"type": "git",

publish.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,18 @@ shell.exec("yarn install --ignore-scripts");
3232
shell.exec("yarn clean");
3333
shell.exec("yarn compile");
3434

35-
shell.exec("yarn test");
35+
// As long as rustc's output is consistent, this should be fine
36+
const host = shell
37+
.exec("rustc -vV")
38+
.toString()
39+
.split("\n")
40+
.find((line) => line.startsWith("host:"))
41+
.split(" ")[1];
42+
const cargoTarget = process.env.CARGO_BUILD_TARGET;
43+
// Skip running tests with a cross compiled binary, we know they'll fail to run
44+
if (host === cargoTarget || cargoTarget === "" || cargoTarget === undefined) {
45+
shell.exec("yarn test");
46+
}
3647
shell.mkdir("./dist");
3748

3849
shell.cp(["README.md", "package.json", "index.d.ts", "index.js", "LICENSE"], "./dist");

0 commit comments

Comments
 (0)