Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross-platform build openssl-sys v0.9.102 #76

Closed
davincios opened this issue May 8, 2024 · 3 comments
Closed

Cross-platform build openssl-sys v0.9.102 #76

davincios opened this issue May 8, 2024 · 3 comments
Labels
question Further information is requested

Comments

@davincios
Copy link

davincios commented May 8, 2024

The taiki-e upload action works great, I just have a small issue with Windows where I am getting a CI/CD build error that returns: openssl-sys v0.9.102

I tried out adding the openssl-sys crate and a lot of other things mentioned in the pull requests, but would greatly appreciate any help!

I have a public repository here:
https://github.com/davincios/tracer-cli

With the .github/workflow file here:
https://github.com/davincios/tracer-cli/blob/master/.github/workflows/cross-platform-release.yml

workflow file

name: Release

on:
  push:
    tags:
      - "v*"

jobs:
  create-release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: taiki-e/create-gh-release-action@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}

  upload-assets:
    needs: create-release
    strategy:
      matrix:
        include:
          - target: aarch64-apple-darwin
            os: macos-latest
          - target: x86_64-unknown-linux-gnu
            os: ubuntu-latest
          - target: x86_64-apple-darwin
            os: macos-latest
          - target: universal-apple-darwin
            os: macos-latest
          - target: x86_64-pc-windows-msvc
            os: windows-latest

    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v4
      - name: Install cross-compilation tools
        uses: taiki-e/setup-cross-toolchain-action@v1
        with:
          target: ${{ matrix.target }}
        if: startsWith(matrix.os, 'ubuntu')
      - uses: taiki-e/upload-rust-binary-action@v1
        with:
          # (required) Comma-separated list of binary names (non-extension portion of filename) to build and upload.
          # Note that glob pattern is not supported yet.
          bin: tracer
          # (optional) Target triple, default is host triple.
          target: ${{ matrix.target }}
          # (required) GitHub token for uploading assets to GitHub Releases.
          token: ${{ secrets.GITHUB_TOKEN }}


CI/CD Logs

   Compiling sha-1 v0.9.8
error: failed to run custom build command for `openssl-sys v0.9.102`

Caused by:
  process didn't exit successfully: `D:\a\tracer-cli\tracer-cli\target\release\build\openssl-sys-dc113c0004ef40cd\build-script-main` (exit code: 101)
  --- stdout
  cargo:rerun-if-env-changed=X86_64_PC_WINDOWS_MSVC_OPENSSL_NO_VENDOR
  X86_64_PC_WINDOWS_MSVC_OPENSSL_NO_VENDOR unset
  cargo:rerun-if-env-changed=OPENSSL_NO_VENDOR
  OPENSSL_NO_VENDOR unset
  running "perl" "./Configure" "--prefix=D:/a/tracer-cli/tracer-cli/target/x86_64-pc-windows-msvc/release/build/openssl-sys-300e6fa545b3bf6c/out/openssl-build/install" "--openssldir=SYS$MANAGER:[OPENSSL]" "no-dso" "no-shared" "no-ssl3" "no-tests" "no-comp" "no-zlib" "no-zlib-dynamic" "--libdir=lib" "no-md2" "no-rc5" "no-weak-ssl-ciphers" "no-camellia" "no-idea" "no-seed" "no-capieng" "no-asm" "VC-WIN64A"

  --- stderr
  Can't locate Locale/Maketext/Simple.pm in @INC (you may need to install the Locale::Maketext::Simple module) (@INC entries checked: /d/a/tracer-cli/tracer-cli/target/x86_64-pc-windows-msvc/release/build/openssl-sys-300e6fa545b3bf6c/out/openssl-build/build/src/util/perl /usr/lib/perl5/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl /d/a/tracer-cli/tracer-cli/target/x86_64-pc-windows-msvc/release/build/openssl-sys-300e6fa545b3bf6c/out/openssl-build/build/src/external/perl/Text-Template-1.56/lib) at /usr/share/perl5/core_perl/Params/Check.pm line 6.
  BEGIN failed--compilation aborted at /usr/share/perl5/core_perl/Params/Check.pm line 6.
  Compilation failed in require at /usr/share/perl5/core_perl/IPC/Cmd.pm line 59.
  BEGIN failed--compilation aborted at /usr/share/perl5/core_perl/IPC/Cmd.pm line 59.
  Compilation failed in require at /d/a/tracer-cli/tracer-cli/target/x86_64-pc-windows-msvc/release/build/openssl-sys-300e6fa545b3bf6c/out/openssl-build/build/src/util/perl/OpenSSL/config.pm line 19.
  BEGIN failed--compilation aborted at /d/a/tracer-cli/tracer-cli/target/x86_64-pc-windows-msvc/release/build/openssl-sys-300e6fa545b3bf6c/out/openssl-build/build/src/util/perl/OpenSSL/config.pm line 19.
  Compilation failed in require at ./Configure line 23.
  BEGIN failed--compilation aborted at ./Configure line 23.
  thread 'main' panicked at C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\openssl-src-300.2.3+3.2.1\src\lib.rs:611:9:
@davincios
Copy link
Author

I have also added the open-ssl dependency in cargo.toml but cannot get it to work:

Required for cross-compilation in our CI release pipeline

[dependencies.openssl]
version = "0.10.59"
features = ["vendored"]

@taiki-e
Copy link
Owner

taiki-e commented May 8, 2024

 Can't locate Locale/Maketext/Simple.pm in @INC (you may need to install the Locale::Maketext::Simple module)

It seems to be the same issue as sfackler/rust-openssl#2149.

@taiki-e taiki-e added the question Further information is requested label May 8, 2024
@davincios
Copy link
Author

@taiki-e thank you so much for your quick response. I just compiled it and it works!!! I am so happy.

For reference this is what worked for me:


name: Release

on:
  push:
    tags:
      - "v*"

jobs:
  create-release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: taiki-e/create-gh-release-action@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}

  upload-assets:
    needs: create-release
    strategy:
      matrix:
        include:
          - target: aarch64-apple-darwin
            os: macos-latest
          - target: x86_64-unknown-linux-gnu
            os: ubuntu-latest
          - target: x86_64-apple-darwin
            os: macos-latest
          - target: universal-apple-darwin
            os: macos-latest
          - target: x86_64-pc-windows-msvc
            os: windows-latest

    runs-on: ${{ matrix.os }}
    steps:
      - name: Set Perl environment variables
        if: runner.os == 'Windows'
        run: |
          echo "PERL=$((where.exe perl)[0])" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
          echo "OPENSSL_SRC_PERL=$((where.exe perl)[0])" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
      - uses: actions/checkout@v4
      - name: Install cross-compilation tools
        uses: taiki-e/setup-cross-toolchain-action@v1
        with:
          target: ${{ matrix.target }}

        if: startsWith(matrix.os, 'ubuntu')
      - uses: taiki-e/upload-rust-binary-action@v1
        with:
          # (required) Comma-separated list of binary names (non-extension portion of filename) to build and upload.
          # Note that glob pattern is not supported yet.
          bin: tracer
          # (optional) Target triple, default is host triple.
          target: ${{ matrix.target }}
          # (required) GitHub token for uploading assets to GitHub Releases.
          token: ${{ secrets.GITHUB_TOKEN }}

@taiki-e taiki-e closed this as completed May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants