From d2bc2dcbb2bc4b7775ed4d81e6419663c7642c67 Mon Sep 17 00:00:00 2001 From: Reilly Wood <26268125+rgwood@users.noreply.github.com> Date: Thu, 28 Apr 2022 04:33:17 -0700 Subject: [PATCH] Openssl feature (#5352) * Move statically linked OpenSSL behind a feature * Re-add README.txt for releases --- .github/workflows/release.yml | 16 ++++++---------- Cargo.toml | 4 +++- README.release.txt | 3 +++ 3 files changed, 12 insertions(+), 11 deletions(-) create mode 100644 README.release.txt diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7cd0c5dd0e..fba8e9fb39 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,7 +27,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: build - args: --release --all --features=extra + args: --release --all --features=extra,static-link-openssl # - name: Strip binaries (nu) # run: strip target/release/nu @@ -89,14 +89,10 @@ jobs: - name: Copy files to output run: | cp target/release/nu target/release/nu_plugin_* output/ - cp README.build.txt output/README.txt + cp README.release.txt output/README.txt cp LICENSE output/LICENSE rm output/*.d - # Note: If OpenSSL changes, this path will need to be updated - - name: Copy OpenSSL to output - run: cp /usr/lib/x86_64-linux-gnu/libssl.so.1.1 output/ - - name: Upload artifact uses: actions/upload-artifact@v2 with: @@ -121,7 +117,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: build - args: --release --all --features=extra + args: --release --all --features=extra,static-link-openssl # - name: Strip binaries (nu) # run: strip target/release/nu @@ -183,7 +179,7 @@ jobs: - name: Copy files to output run: | cp target/release/nu target/release/nu_plugin_* output/ - cp README.build.txt output/README.txt + cp README.release.txt output/README.txt cp LICENSE output/LICENSE rm output/*.d @@ -217,7 +213,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: build - args: --release --all --features=extra + args: --release --all --features=extra,static-link-openssl # - name: Strip binaries (nu.exe) # run: strip target/release/nu.exe @@ -288,7 +284,7 @@ jobs: cp LICENSE output\ cp target\release\LICENSE-for-less.txt output\ cp target\release\nu_plugin_*.exe output\ - cp README.build.txt output\README.txt + cp README.release.txt output\README.txt cp target\release\less.exe output\ # Note: If the version of `less.exe` needs to be changed, update this URL # Similarly, if `less.exe` is checked into the repo, copy from the local path here diff --git a/Cargo.toml b/Cargo.toml index aaf5b076ff..0259035790 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -51,7 +51,7 @@ nu-protocol = { path = "./crates/nu-protocol", version = "0.61.1" } nu-system = { path = "./crates/nu-system", version = "0.61.1" } nu-table = { path = "./crates/nu-table", version = "0.61.1" } nu-term-grid = { path = "./crates/nu-term-grid", version = "0.61.1" } -openssl = { version = "0.10.38", features = ["vendored"] } # Force subdependencies to statically link OpenSSL +openssl = { version = "0.10.38", features = ["vendored"], optional = true } pretty_env_logger = "0.4.0" rayon = "1.5.1" reedline = { git = "https://github.com/nushell/reedline", branch = "main", features = ["bashisms"]} @@ -76,6 +76,8 @@ default = ["plugin", "which-support", "trash-support"] stable = ["default"] extra = ["default", "dataframe", "database"] wasi = [] +# Enable to statically link OpenSSL; otherwise the system version will be used. Not enabled by default because it takes a while to build +static-link-openssl = ["dep:openssl"] # Stable (Default) which-support = ["nu-command/which-support"] diff --git a/README.release.txt b/README.release.txt new file mode 100644 index 0000000000..2329c5f30f --- /dev/null +++ b/README.release.txt @@ -0,0 +1,3 @@ +To use Nu plugins, use the register command to tell Nu where to find the plugin. For example: + +> register -e json ./nu_plugin_query