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

libsql-sys-0.8.0 compilation seems to fail for windows. #1763

Open
sjunepark opened this issue Oct 1, 2024 · 0 comments
Open

libsql-sys-0.8.0 compilation seems to fail for windows. #1763

sjunepark opened this issue Oct 1, 2024 · 0 comments

Comments

@sjunepark
Copy link

Issue

When running test --locked --all-features --all-targets for Windows, it throws the error below.

Run cargo test --locked --all-features --all-targets
  cargo test --locked --all-features --all-targets
  shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
  env:
    CARGO_HOME: C:\Users\runneradmin/.cargo
    CARGO_INCREMENTAL: 0
    CARGO_TERM_COLOR: always
    Updating crates.io index
 Downloading crates ...
  Downloaded cexpr v0.[6](https://github.com/sjunepark/bspl/actions/runs/11120249280/job/30896887671#step:5:6).0

// Omitted

error[E0433]: failed to resolve: could not find `unix` in `os`
   --> C:\Users\runneradmin/.cargo\registry\src\index.crates.io-6f17d22bba15001f\libsql-sys-0.8.0\src\connection.rs:276:26
    |
276 |             use std::os::unix::ffi::OsStrExt;
    |                          ^^^^ could not find `unix` in `os`
    |
note: found an item that was configured out
   --> /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c\library\std\src\os\mod.rs:27:9
note: the item is gated here
   --> /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c\library\std\src\os\mod.rs:19:1
note: found an item that was configured out
   --> /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c\library\std\src\os\mod.rs:65:9
note: the item is gated here
   --> /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c\library\std\src\os\mod.rs:64:1

error[E0599]: no method named `as_bytes` found for reference `&OsStr` in the current scope
   --> C:\Users\runneradmin/.cargo\registry\src\index.crates.io-6f17d22bba15001f\libsql-sys-0.8.0\src\connection.rs:277:73
    |
277 |             let path = std::ffi::CString::new(path.as_ref().as_os_str().as_bytes())
    |                                                                         ^^^^^^^^
    |
help: there is a method `as_encoded_bytes` with a similar name
    |
277 |             let path = std::ffi::CString::new(path.as_ref().as_os_str().as_encoded_bytes())
    |                                                                         ~~~~~~~~~~~~~~~~

Some errors have detailed explanations: E0433, E0599.
For more information about an error, try `rustc --explain E0433`.
error: could not compile `libsql-sys` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
Error: Process completed with exit code 1.

Context

Got the error above during github actions. Below is the github action jobs script which I ran.

  os-check:
    # run cargo test on mac and windows
    runs-on: ${{ matrix.os }}
    name: ${{ matrix.os }} / stable
    strategy:
      fail-fast: false
      matrix:
        # todo: Add "windows-latest". Currently doesn't work due to `libsql-sys`.  
        os: [ windows-latest ]
    steps:
      # if your project needs OpenSSL, uncomment this to fix Windows builds.
      # it's commented out by default as the install command takes 5-10m.
      # - run: echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
      #   if: runner.os == 'Windows'
      # - run: vcpkg install openssl:x64-windows-static-md
      #   if: runner.os == 'Windows'
      - uses: actions/checkout@v4
        with:
          submodules: true
      - name: Install stable
        uses: dtolnay/rust-toolchain@stable
      - name: cargo generate-lockfile
        if: hashFiles('Cargo.lock') == ''
        run: cargo generate-lockfile
      - name: cargo test
        run: cargo test --locked --all-features --all-targets
@sjunepark sjunepark changed the title libsql-sys-0.8.0 compilation fails for windows. libsql-sys-0.8.0 compilation seems to fail for windows. Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant