Could not find openssl in backend - server

Error I get:
error[E0433]: failed to resolve: could not find `openssl` in `backend`
--> ...\src\...\swagger-0.12.1\src\connector.rs:41:34
|
41 | native_tls::backend::openssl::TlsConnectorBuilderExt::from_openssl(ssl);
| ^^^^^^^ could not find `openssl` in `backend`
error[E0433]: failed to resolve: could not find `openssl` in `backend`
--> ...\swagger-0.12.1\src\connector.rs:85:34
|
85 | native_tls::backend::openssl::TlsConnectorBuilderExt::from_openssl(ssl);
| ^^^^^^^ could not find `openssl` in `backend`
Compiling hyper v0.2.1
error: expected identifier, found `"rustc-serialize"`
--> ...\hyper-0.2.1\src\lib.rs:129:14
|
129 | extern crate "rustc-serialize" as serialize;
| ^^^^^^^^^^^^^^^^^ expected identifier
Generated a server stub user swagger. Ran into issues where cargo couldn't find openssl, giving an error like 'custom build something openssl-sys 0.9.24'. This was a known issue and I overcame it by downloading vcpkg, and using vcpkg to download openssl. Then using environment variables to point to the download folder so cargo could use openssl. But now the error seems to be that openssl doesn't exist in backend?
It also seems to specific to windows, any ideas?
Tried changing the version of native-tls to the most up to date version but it doesn't seem to have an affect at all. It looks like swagger's dependencies need updating but I literally just generated this stub...

You've landed on a flaw from the Rust documentation tools; it picks up what is in a package, but doesn't show the limits.
The backend module definition is defined as:
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub mod security_framework;
#[cfg(target_os = "windows")]
pub mod schannel;
#[cfg(not(any(target_os = "macos", target_os = "windows", target_os = "ios")))]
pub mod openssl;
In other words, the situation is the following:
If you are on linux (i.e. not macOS, not windows, not iOS), then openssl is available
If you are on windows, then schannel is available
If you are on MacOS or iOS security_framework is available
You should, however, not be trying to target a specific backend, as this defeats the purpose of the library. Instead of importing native_tls::backend::openssl::TlsConnectorBuilderExt, import native_tls::TlsConnectorBuilder and let it decide what backend you need.
This may be easier said than done, however, since by the looks of your error this is caused by a third-party library, which indicates that it was only tested on Linux.

Related

vue-chartjs: You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file

I added vue-chartjs as per instruction (https://vue-chartjs.org/ja/guide/).
% yarn add vue-chartjs chart.js#2.9.4
Then ran % yarn dev.
Now I see this error on console.
Loading...
ERROR in ./node_modules/vue-chartjs/dist/index.js 198:37
Module parse failed: Unexpected token (198:37)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| const ref = shallowRef(null);
| const reforwardRef = (chartRef)=>{
> ref.value = chartRef?.chart;
| };
| expose({
Reproduction
I can give an access to the repository if needed.
chart.js version
2.9.4
vue-chartjs version
^5.2.0
Possible solution
I did try installing style-loader css-loader, but it caused another error.
in ./.nuxt/components/nuxt-error.vue?vue&type=style&index=0&id=74e3df5b&lang=css& (./node_modules/css-loader/dist/cjs.js??ref--3-oneOf-1-1!./node_modules/#nuxt/webpack/node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--3-oneOf-1-2!./node_modules/#nuxt/webpack/node_modules/vue-loader/lib??vue-loader-options!./.nuxt/components/nuxt-error.vue?vue&type=style&index=0&id=74e3df5b&lang=css&)
Module build failed (from ./node_modules/css-loader/dist/cjs.js):
TypeError: this.getOptions is not a function
at Object.loader (/Users/tenna/Desktop/Henshin-Bike-Tomo/manageWeb/hajimenavi_manage/node_modules/css-loader/dist/index.js:22:27)
% yarn add vue-chartjs chart.js#2.9.4
% yarn dev

How to add Babel support for nullishCoalescingOperator to vue project?

In my Vue-CLI project, when I tried using the ?? operator, I got this error:
Syntax Error: SyntaxError: /Users/stevebennett/odev/freelancing/v-map/src/components/Map.vue: >Support for the experimental syntax 'nullishCoalescingOperator' isn't currently enabled (30:29):
...
Add #babel/plugin-proposal-nullish-coalescing-operator (https://git.io/vb4Se) to the 'plugins' section of your Babel config to enable transformation.
I installed #babel/plugin-syntax-nullish-coalescing-operator (its name seems to have changed), added it to my babel.config.js:
module.exports = {
presets: ['#vue/app'],
plugins: ['#babel/plugin-syntax-nullish-coalescing-operator'],
};
Now the error message seems to have gone backwards, no reference to the operator name at all:
Module parse failed: Unexpected token (39:35)
You may need an appropriate loader to handle this file type.
| case 8:
| points = _context.sent;
console.log(sheetID ?? 37);
What am I doing wrong?
For me, the #babel/plugin-syntax-nullish-coalescing-operator plugin would not work, which is the one you are using.
I had to use the #babel/plugin-proposal-nullish-coalescing-operator plugin which is the one that the error message suggests you use.
Additionally, I noticed this on the page for the #babel/plugin-syntax-nullish-coalescing-operator plugin:
I can't say for sure if this will fix your problem, but it certainly fixed mine

Error with static compilation Qt with postgresql driver

I have installed through Mainteinance Tool Qt 5.12.5 and the sources. I have the next directories:
C:\Qt\5.12.5\Src
C:\Qt\Tools\mingw730_32\
C:\Qt\Tools\mingw730_64\
On the other hand, I have read that downloable Postgres version is compiled with MSVC, and I must to compile my own version. I have do it following link, and now I have a postgresql version in c:\pgsql
Finally I have added c:\pgsql to user Path
Next step, I have opened PowerShell in Admin mode and I´ve gone to C:\Qt\5.12.5\Src\.
Next, set the env path for this PowerShell session:
$env:Path += ";C:\Qt\Tools\mingw730_64\bin\;C:\Qt\5.12.5\Src;C:\pgsql\include\;C:\pgsql\lib\;C:\pgsql\bin\" (setting the pgsql path again....)
After that, I execute configure.bat like that:
configure -v -static -release -static-runtime -platform win32-g++ -prefix C:\Qt\5.12.5\Estatico\ -opensource -confirm-license -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -no-openssl -opensource -confirm-license -skip webengine -make libs -nomake tools -nomake examples -nomake tests -sql-psql
But I have get this error:
ERROR: Feature 'sql-psql' was enabled, but the pre-condition 'libs.psql' failed.
Searching in config.log I can read those lines:
loaded result for library config.qtbase_sqldrivers.libraries.psql
Trying source 0 (type pkgConfig) of library psql ...
pkg-config use disabled globally.
=> source produced no result.
Trying source 1 (type psqlConfig) of library psql ...
pg_config not found.
=> source produced no result.
Trying source 2 (type psqlEnv) of library psql ...
None of [liblibpq.dll.a liblibpq.a libpq.dll.a libpq.a libpq.lib] found in [] and global paths.
=> source produced no result.
Trying source 3 (type psqlEnv) of library psql ...
=> source failed condition '!config.win32'.
test config.qtbase_sqldrivers.libraries.psql FAILED
What can I do or what is the properly way to do that?
Thank you in advance.
UPDATE
There are similar question here but it hasn´t been solved, and those question ask about Visual Studio.
I want to compile it under mingw.
The solution suggested by #Soheil Armin doesn´t work too
The solution suggested by #Soheil Armin works fine, but I need to delete the entire source tree and reinstall it as he suggested. If not, a new configure won't work.
Also, the ^ character can be saved:
configure <your parameters>
PSQL_LIBS="C:\pgsql\lib\libpq.a"
-I "C:\pgsql\include"
-L "C:\pgsql\lib"
You need to explicitly define library paths of Postgres.
configure <your parameters> ^
PSQL_LIBS="C:\pgsql\lib\libpq.a" ^
-I "C:\pgsql\include" ^
-L "C:\pgsql\lib"

Rust `unresolved import` on third party library

I want to compile a simple rust program using a third party library named warp:
[package]
name = "hello-world-warp"
version = "0.1.0"
[dependencies]
warp = "0.1.18"
In src/main.rs:
use warp::{self, path, Filter};
fn main() {
// GET /hello/warp => 200 OK with body "Hello, warp!"
let hello = warp::path!("hello" / String)
.map(|name| format!("Hello, {}!", name));
warp::serve(hello)
.run(([127, 0, 0, 1], 3030));
}
When I run cargo build I see it download warp and lots of transitive dependencies, then I get the errors:
Compiling hello-world-warp v0.1.0 (<path>) error[E0432]: unresolved import `warp`
--> src/main.rs:3:12
|
3 | use warp::{self, path, Filter};
| ^^^^ no `warp` in the root
error: cannot find macro `path!` in this scope
I've gone through various docs on modules and crates. What am I doing wrong in this simple scenario?
The example you copied uses a syntax that works in the most recent edition of Rust, but you've accidentally set your Rust to emulate an old "2015" version of the language.
You must add:
edition = "2018"
to your Cargo.toml's [package] section.
When starting new projects, always use cargo new. It will ensure the latest edition flag is set correctly.

Doing git pull in Engine Yard

I am deploying my rails app to Engine Yard.
What i had so far:
1. created SSH hey
2. Install public key to Engine Yard app.
3. ssh deploy#my.server.ip.address
I was put at home/deploy, which is not a right place to perform git pull.
The reason I need to deploy in this way, is because my app is using nmatrix gem, which need to be installed manually using c++ compiler. The automatic bundler got an error while fetching that gem, and stopped.
Update:
I guess my question should be, how to install nmatrix to EngineYard. This is the error message I got from calling gem install nmatrix:
Building native extensions. This could take a while...
ERROR: Error installing nmatrix:
ERROR: Failed to build gem native extension.
/usr/bin/ruby21 extconf.rb
checking for main() in -llapack... no
checking for main() in -lcblas... yes
checking for main() in -latlas... no
checking for clapack.h... no
checking for cblas.h... yes
checking for cblas.h... yes
checking for clapack_dgetrf() in cblas.h,clapack.h... no
checking for clapack_dgetri() in cblas.h,clapack.h... no
checking for dgesvd_() in clapack.h... no
checking for cblas_dgemm() in cblas.h... yes
using C++ standard... c++0x
g++ reports version... Hardened
creating nmatrix_config.h
creating Makefile
make "DESTDIR="
compiling nmatrix.cpp
In file included from nmatrix.cpp:331:0:
ruby_nmatrix.c: In function ‘VALUE nm_mset(int, VALUE*, VALUE)’:
ruby_nmatrix.c:1378:108: warning: format ‘%u’ expects type ‘unsigned int’, but argument 4 has type ‘size_t’
ruby_nmatrix.c: In function ‘VALUE nm_xslice(int, VALUE*, void* (*)(const STORAGE*, SLICE*), void (*)(NMATRIX*), VALUE)’:
ruby_nmatrix.c:1556:91: warning: format ‘%u’ expects type ‘unsigned int’, but argument 4 has type ‘size_t’
ruby_nmatrix.c: In function ‘SLICE* get_slice(size_t, int, VALUE*, size_t*)’:
ruby_nmatrix.c:1903:104: warning: format ‘%u’ expects type ‘unsigned int’, but argument 3 has type ‘size_t’
ruby_nmatrix.c:1903:104: warning: format ‘%u’ expects type ‘unsigned int’, but argument 4 has type ‘size_t’
compiling ruby_constants.cpp
compiling data/data.cpp
compiling util/io.cpp
compiling math.cpp
In file included from math.cpp:140:0:
math/rot.h: In function ‘void nm::math::rot(int, DType*, int, DType*, int, CSDType, CSDType) [with DType = nm::Complex<float>, CSDType = float]’:
math/rot.h:123:40: error: ‘cblas_csrot’ was not declared in this scope
math/rot.h: In function ‘void nm::math::rot(int, DType*, int, DType*, int, CSDType, CSDType) [with DType = nm::Complex<double>, CSDType = double]’:
math/rot.h:128:40: error: ‘cblas_zdrot’ was not declared in this scope
In file included from math.cpp:141:0:
math/rotg.h: In function ‘void nm::math::rotg(DType*, DType*, DType*, DType*) [with DType = nm::Complex<float>]’:
math/rotg.h:99:125: error: ‘cblas_crotg’ was not declared in this scope
math/rotg.h: In function ‘void nm::math::rotg(DType*, DType*, DType*, DType*) [with DType = nm::Complex<double>]’:
math/rotg.h:104:125: error: ‘cblas_zrotg’ was not declared in this scope
make: *** [math.o] Error 1
Gem files will remain installed in /home/deploy/.gem/ruby/2.1.0/gems/nmatrix-0.0.9 for inspection.
Results logged to /home/deploy/.gem/ruby/2.1.0/gems/nmatrix-0.0.9/ext/nmatrix/gem_make.out
One of the prerequisite to install nmatrix is to have gcc > v4.7, but EngineYard is having v4.5.4 only. Anyone know how to upgrade gcc? I think I am running Gentoo.
The question actually should include what you want to git pull.
When you ssh in, you are put into /home/deploy which is your home directory.
The Git copy of your app is located in /data/APPNAME/shared/cache-copy/ on the App Master
You can have multiple apps on one instance and each one can have a different deploy key so you use a GIT_SSH wrapper
GIT_SSH=/data/APPNAME/shared/config/pulse-ssh-wrapper git pull
(in all the above commands remember to replace APPNAME with the name used for the app)
If you want to find the actual location for a bundled gem, you can look in
/data/APPNAME/shared/bundled_gems/ruby/2.0.0/gems (version will depend on Ruby ABI)
if your Gemfile uses a :git remember that only a single deploy key can be used for both the app clone and bundle phase, you cannot select different keys per gem.
Most likely the issue with installing the nmatrix gem is that the ATLAS libraries are not installed yet and those would be installed with the system's package manager (Portage for Gentoo and Apt-get for Ubuntu). You can add them via "Edit Unix Packages" on the UI, just select sci-libs/blas-atlas and sci-libs/lapack-atlas. Currently this will fail because the EC2 instances are Xeon processors and the libraries do not build on these yet.
http://sourceforge.net/p/math-atlas/support-requests/614/
https://bugzilla.kernel.org/show_bug.cgi?id=13794
You can see the CPU type on your Linux instance with "cat /proc/cpuinfo" and will see something like
model name :Intel(R) Xeon(R) CPU E5-2650 0 # 2.00GHz