RUST on windows : getting LINK : fatal error LNK1181 error - windows

I am a complete beginner (following this course actually) regarding Rust language and i was wondering if it was possible to create an app for Windows involving a mqtt client.
I created my project using cargo new testmqtt --bin,
my toml file is
[package]
name = "testmqtt"
version = "0.1.0"
authors = ["Pierre"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
mosquitto-client = "0.1.5"
Main.rs file is exactly the first one found here.
extern crate mosquitto_client as mosq;
use mosq::Mosquitto;
fn main() {
let m = Mosquitto::new("test");
m.will_set("test/will",b"finished!",0,false).expect("can't set will");
m.connect("localhost",1883).expect("can't connect");
let bonzo = m.subscribe("bonzo/#",0).expect("can't subscribe to bonzo");
let frodo = m.subscribe("frodo/#",0).expect("can't subscribe to frodo");
// not interested in any retained messages!
let mut mc = m.callbacks(());
mc.on_message(|_,msg| {
if ! msg.retained() {
if bonzo.matches(&msg) {
println!("bonzo {:?}",msg);
} else
if frodo.matches(&msg) {
println!("frodo {:?}",msg);
m.disconnect().unwrap();
}
}
});
m.loop_forever(200).expect("broken loop");
}
When doing cargo run, i do have an error saying more or less that i have to include mosquitto.lib file.
Compiling testmqtt v0.1.0 (C:\Users\Pierre\rust\testmqtt)
Finished dev [unoptimized + debuginfo] target(s) in 3.43s
Running `target\debug\testmqtt.exe`
Hello, world!
PS C:\Users\Pierre\rust\testmqtt> cargo run
Updating crates.io index
Compiling mosquitto-client v0.1.5
Compiling testmqtt v0.1.0 (C:\Users\Pierre\rust\testmqtt)
error: linking with `link.exe` failed: exit code: 1181
|
= note: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.23.28105\\bin\\HostX64\\x64\\link.exe" "/NOLOGO" "/NXCOMPAT" "/LIBPATH:C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.18yxopwcqksqllf0.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.26hriqf9eoqoz70e.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.287dmq688xsz3isv.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.2e77zj76zbvh065j.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.2huuzosvc51r1ocl.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.2o9r9r2t2clr39wq.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.2wggiqwux76jad1h.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.3mqzooten3ugyse9.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.3vqvdeaqidai2p26.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.4fnmrub2ky4biwf5.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.4tdiuzs0kqadbi75.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.4u40iyf9g9kmiphf.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.51m4wneyq731nq60.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.5d67na1jjhizscb4.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.ap2kea3xxb47i5p.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.h5xgbt8abre0rtw.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.vlg3p2hoy45m5m6.rcgu.o" "/OUT:C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.exe" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.49ivjbnnhficmjo4.rcgu.o" "/OPT:REF,NOICF" "/DEBUG" "/NATVIS:C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\intrinsic.natvis" "/NATVIS:C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\liballoc.natvis" "/NATVIS:C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\libcore.natvis" "/LIBPATH:C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps" "/LIBPATH:C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\libmosquitto_client-23967bfdaa3a5433.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libstd-8864852919b3dde3.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libpanic_unwind-60bab00b06422126.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libbacktrace-e90b3ab99b608a07.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_demangle-d9b7b1604d471c6c.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libhashbrown-a439eac7fda93b7a.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_std_workspace_alloc-058c975bf38e4686.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libunwind-711d56157cf28645.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcfg_if-d802c196c150a787.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liblibc-7147008fc56d32b8.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liballoc-57b2ee5c835455f8.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_std_workspace_core-6391a360e3eeafba.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcore-6c8df881cdc2afb2.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcompiler_builtins-f998976453a15b70.rlib" "mosquitto.lib" "c.lib" "advapi32.lib" "ws2_32.lib" "userenv.lib" "msvcrt.lib"
= note: Non-UTF-8 output: LINK : fatal error LNK1181: impossible d\'ouvrir le fichier en entr\xe9e \'mosquitto.lib\'\r\n
error: aborting due to previous error
error: Could not compile `testmqtt`.
To learn more, run the command again with --verbose.
Here is the verbose ouput
To learn more, run the command again with --verbose.
PS C:\Users\Pierre\rust\testmqtt> cargo run --verbose
Fresh mosquitto-client v0.1.5
Compiling testmqtt v0.1.0 (C:\Users\Pierre\rust\testmqtt)
Running `rustc --edition=2018 --crate-name testmqtt src\main.rs --color always --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=e2a79a549b8dacef -C extra-filename=-e2a79a549b8dacef --out-dir C:\Users\Pierre\rust\testmqtt\target\debug\deps -C incremental=C:\Users\Pierre\rust\testmqtt\target\debug\incremental -L dependency=C:\Users\Pierre\rust\testmqtt\target\debug\deps --extern mosquitto_client=C:\Users\Pierre\rust\testmqtt\target\debug\deps\libmosquitto_client-23967bfdaa3a5433.rlib`error: linking with `link.exe` failed: exit code: 1181
|
= note: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.23.28105\\bin\\HostX64\\x64\\link.exe" "/NOLOGO" "/NXCOMPAT" "/LIBPATH:C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.18yxopwcqksqllf0.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.26hriqf9eoqoz70e.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.287dmq688xsz3isv.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.2e77zj76zbvh065j.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.2huuzosvc51r1ocl.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.2o9r9r2t2clr39wq.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.2wggiqwux76jad1h.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.3mqzooten3ugyse9.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.3vqvdeaqidai2p26.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.4fnmrub2ky4biwf5.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.4tdiuzs0kqadbi75.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.4u40iyf9g9kmiphf.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.51m4wneyq731nq60.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.5d67na1jjhizscb4.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.ap2kea3xxb47i5p.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.h5xgbt8abre0rtw.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.vlg3p2hoy45m5m6.rcgu.o" "/OUT:C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.exe" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.49ivjbnnhficmjo4.rcgu.o" "/OPT:REF,NOICF" "/DEBUG" "/NATVIS:C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\intrinsic.natvis" "/NATVIS:C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\liballoc.natvis" "/NATVIS:C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\libcore.natvis" "/LIBPATH:C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps" "/LIBPATH:C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\libmosquitto_client-23967bfdaa3a5433.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libstd-8864852919b3dde3.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libpanic_unwind-60bab00b06422126.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libbacktrace-e90b3ab99b608a07.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_demangle-d9b7b1604d471c6c.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libhashbrown-a439eac7fda93b7a.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_std_workspace_alloc-058c975bf38e4686.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libunwind-711d56157cf28645.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcfg_if-d802c196c150a787.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liblibc-7147008fc56d32b8.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liballoc-57b2ee5c835455f8.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_std_workspace_core-6391a360e3eeafba.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcore-6c8df881cdc2afb2.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcompiler_builtins-f998976453a15b70.rlib" "mosquitto.lib" "c.lib" "advapi32.lib" "ws2_32.lib" "userenv.lib" "msvcrt.lib"
= note: Non-UTF-8 output: LINK : fatal error LNK1181: impossible d\'ouvrir le fichier en entr\xe9e \'mosquitto.lib\'\r\n
error: aborting due to previous error
error: Could not compile `testmqtt`.
Caused by:
process didn't exit successfully: `rustc --edition=2018 --crate-name testmqtt src\main.rs --color always --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=e2a79a549b8dacef -C extra-filename=-e2a79a549b8dacef --out-dir C:\Users\Pierre\rust\testmqtt\target\debug\deps -C incremental=C:\Users\Pierre\rust\testmqtt\target\debug\incremental -L dependency=C:\Users\Pierre\rust\testmqtt\target\debug\deps --extern mosquitto_client=C:\Users\Pierre\rust\testmqtt\target\debug\deps\libmosquitto_client-23967bfdaa3a5433.rlib` (exit code: 1)
It is possible to do that, isn't ?
Regards,
Pierre

Related

--go-grpc_out: protoc-gen-go-grpc: Plugin failed with status code 1

i am getting this error when i compile my proto file:
protoc-gen-go-grpc: program not found or is not executable
Please specify a program using absolute path or make sure the program is available in your PATH system variable
\--go-grpc_out: protoc-gen-go-grpc: Plugin failed with status code 1.
I am using these versions:
Binary
Version
protoc-gen-go
v1.25.0-devel
protoc
v3.12.4
I have tried to compile this proto file:
syntax = "proto3";
option go_package = "proto/";
message GreetingRequest {
string first_name = 1;
string last_name = 2;
}
message GreetingResponse{
string result = 1;
}
service AddService{
rpc Greet(GreetingRequest) returns (GreetingResponse) {};
}
I used this command:
protoc \
--proto_path=proto \
--go_out=proto \
--go_opt=paths=source_relative \
--go-grpc_out=proto \
--go-grpc_opt=paths=source_relative \
service.proto
I installed protoc-gen-go-grpc using:
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc#latest
but its still showing this error.

Eiffel compilation through Makefile and `dpkg-buildpackage -us -uc` generating an error

Am trying to create a debian package of my Eiffel application.
Either make or make -j4 (which is the called one from dpkg-buildpackage) within the root structure does the job without error
but when called from dpkg-buildpackage -us -uc which calls the Makefile it exits with an error
In file included from big_file_C7_c.c:40:0:
lo322.c: In function ‘inline_F425_4447’:
lo322.c:97:5: error: format not a string literal and no format arguments [-Werror=format-security]
syslog(arg1, arg2);
^~~~~~
cc1: some warnings being treated as errors
My makefile for info is as following:
#Build variables
MY_EC = $(shell which ec)
BUILT_TARGET = EIFGENs/$(TARGET_NAME)/F_code/$(APP_NAME)
# This target will compile all files
all: build
build:
# Checks eiffel compiler
# #echo "MY EC IS: ${MY_EC}"
#if [ -z "${MY_EC}" ]; then
echo "Compiler not found";
else
echo "Eiffel compiler found";
fi
# Compilation
echo '---------->finalizing'
ec -finalize -config $(APP_NAME).ecf -target $(TARGET_NAME) || (echo "last command failed $$="; exit 1)
cd $(FINAL_EXE_DIR); \
echo '---------->Finish freezing';\
finish_freezing || (echo "A problem occured during finish_freezing!!!"; exit 1)
The issue is caused by the feature c_logging_write_log of the class LOG_WRITER_SYSTEM in EiffelStudio 18.11 and earlier that makes the following call:
syslog($priority, $msg);
Replacing it with
syslog($priority, "%s", (char *) $msg);
(in $ISE_EIFFEL/library/runtime/logging/writers/log_writer_system.e) and recompiling the system (from scratch, if the logging library is marked as read-only) should fix the problem.

How to call a batch builder script on a Rust cargo build script?

How to call a batch builder script on a Rust cargo build script?
The project rust-onig requires to compile the oniguruma C project. This is originated from the question error: failed to run custom build command for `onig_sys v61.1.0` which attempts to build oniguruma on windows. Afterwards was noticed on windows within Visual Studio 2015, we need to call the make_win32.bat, instead of cmake to build the oniguruma C project.
However I have no idea how to do the cargo builder to call the make_win32.bat build script. Based on build-script, I edited the default builder build.rs which is attempting to use cmake instead of make_win32.bat:
extern crate pkg_config;
extern crate cmake;
// use std::env;
// fn compile_with_cmake() {
// use cmake::Config;
// let static_link = env::var("CARGO_FEATURE_STATIC_ONIG").is_ok();
// // Builds the project in the directory located in `oniguruma`, installing it
// // into $OUT_DIR
// let mut c = Config::new("oniguruma");
// let dst = if static_link {
// c.define("BUILD_SHARED_LIBS", "OFF")
// } else {
// c.define("CMAKE_MACOSX_RPATH", "NO")
// }
// .build();
// let link_type = if static_link {
// "static"
// } else {
// "dylib"
// };
// println!("cargo:rustc-link-search=native={}",
// dst.join("build").display());
// println!("cargo:rustc-link-lib={}=onig", link_type);
// }
pub fn main() {
println!("Opening MAIN!!!!!!!!\n\n\n\n");
use std::process::Command;
let status = Command::new("D:\\User\\Downloads\\rust-onig\\onig_sys\\oniguruma\\make_win32.bat").status().unwrap_or_else(|e|
{
panic!("failed to execute process: {}", e)
});
println!("process exited with: {}", status);
println!("process exited with: {}", status);
println!("process exited with: {}", status);
println!("process exited with: {}", status);
println!("process exited with: {}", status);
// if let Ok(_) = pkg_config::find_library("oniguruma") {
// return;
// }
// compile_with_cmake();
}
But my builder script is not called, as the message process exited with is never showed:
D:\Downloads\rust-onig>cargo build
Compiling onig_sys v61.1.0 (file:///D:/User/Downloads/rust-onig/onig_sys)
Compiling onig v1.2.0 (file:///D:/User/Downloads/rust-onig)
warning: unused import: `c_ulong`, #[warn(unused_imports)] on by default
--> src\names.rs:6:27
|
6 | use libc::{c_int, c_uint, c_ulong, c_void, c_uchar};
| ^^^^^^^
Finished dev [unoptimized + debuginfo] target(s) in 11.31 secs
D:\Downloads\rust-onig>
What is displayed, when do we attempt to used the cmake builder can be viewed on the question This is originated from the question error: failed to run custom build command for `onig_sys v61.1.0`
The problem there is cmake is generating several Visual Studio projects, which purely do not know how to build oniguruma. The only solution able to effectively build it is the make_win32.bat which already comes within oniguruma. Moreover, we need to use the make_win32.bat instead of let cmake generating Visual Studio.
I called it within -vv, as commented by user1034749, it outputted correctly and ran the make_win32.bat file.
I just have to put inside the make_win32.bat the command cd D:\rust-onig\src because the batch file was being ran on some folder elsewhere.
D:\rust-onig>cargo build -vv
Fresh libc v0.2.21
Fresh pkg-config v0.3.9
Fresh lazy_static v0.2.4
Fresh bitflags v0.7.0
Compiling onig_sys v61.3.0 (file:///D:/User/Downloads/rust-onig/onig_sys)
Running `D:\rust-onig\target\debug\build\onig_sys-a911e1c40e7ed561\build-script-build`
Opening MAIN!!!!!!!!
D:\rust-onig\onig_sys>cd /d D:\rust-onig\onig_sys\oniguruma\src
D:\rust-onig\onig_sys\oniguruma\src>copy config.h.win32 config.h
1 file(s) copied.
D:\rust-onig\onig_sys\oniguruma\src>nmake -f Makefile.windows
Microsoft (R) Program Maintenance Utility Version 14.00.23506.0
Copyright (C) Microsoft Corporation. All rights reserved.
process exited with: exit code: 0
process exited with: exit code: 0
process exited with: exit code: 0
process exited with: exit code: 0
process exited with: exit code: 0
Running `rustc --crate-name onig_sys onig_sys\src\lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg "feature=\"static_onig\"" -C metadata=071c5dad786f940b -C extra-filename=-071c5dad786f940b --out-dir D:\rust-onig\target\debug\deps -L dependency=D:\rust-onig\target\debug\deps --extern libc=D:\rust-onig\target\debug\deps\liblibc-5dc7b85e748840b4.rlib`
Compiling onig v1.2.2 (file:///D:/User/Downloads/rust-onig)
Running `rustc --crate-name onig src\lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=9cad49cfdc2b5108 -C extra-filename=-9cad49cfdc2b5108 --out-dir D:\rust-onig\target\debug\deps -L dependency=D:\rust-onig\target\debug\deps --extern libc=D:\rust-onig\target\debug\deps\liblibc-5dc7b85e748840b4.rlib --extern lazy_static=D:\rust-onig\target\debug\deps\liblazy_static-82c2efae9a7bf732.rlib --extern onig_sys=D:\rust-onig\target\debug\deps\libonig_sys-071c5dad786f940b.rlib --extern bitflags=D:\rust-onig\target\debug\deps\libbitflags-65ddff5d2b91509e.rlib`
Finished dev [unoptimized + debuginfo] target(s) in 8.92 secs
Update
The rust-onig developer had added built-in supported to call nmake directly instead of using a batch file: https://stackoverflow.com/a/42875974/4934640

YML parsing error

I'm trying to compile the bitcoin client for windows from ubutno but everytime I try to build it I keep getting this error:
/usr/lib/ruby/1.9.1/psych.rb:207:in `parse': (../bitcoin/contrib/gitian-descriptors/boost-win32.yml): could not find expected ':' while scanning a simple key at line 21 column 1 (Psych::SyntaxError)
I have investigated a bit about it and found that this is normally caused by some typo in the YML file. However I hardly know anything about ruby and was hoping that some of you guys could help me solve this problem.
My yml file is:
---
name: "boost"
suites:
- "lucid"
architectures:
- "i386"
packages:
- "mingw32"
- "faketime"
- "zip"
reference_datetime: "2011-01-30 00:00:00"
remotes: []
files:
- "boost_1_49_0.tar.bz2"
script: |
TMPDIR="$HOME/tmpdir"
mkdir -p $TMPDIR/bin/$GBUILD_BITS $TMPDIR/include
tar xjf boost_1_49_0.tar.bz2
cd boost_1_49_0
echo "--- tmp_dir_helpers.orig.hpp 2012-06-10 01:39:25.403268210 +0200
+++ tmp_dir_helpers.hpp 2012-06-10 01:41:14.653823479 +0200
## -19,9 +19,9 ##
#include <string>
#if defined(BOOST_INTERPROCESS_WINDOWS)
- //#define BOOST_INTERPROCESS_HAS_WINDOWS_KERNEL_BOOTTIME
- //#define BOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME
- //#include <boost/interprocess/detail/win32_api.hpp>
+ #define BOOST_INTERPROCESS_HAS_WINDOWS_KERNEL_BOOTTIME
+ #define BOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME
+ #include <boost/interprocess/detail/win32_api.hpp>
#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
//#include <sys/sysctl.h>
//#if defined(CTL_KERN) && defined (KERN_BOOTTIME)" > useboottime.patch
patch boost/interprocess/detail/tmp_dir_helpers.hpp useboottime.patch
echo "using gcc : 4.4 : i586-mingw32msvc-g++
:
<rc>i586-mingw32msvc-windres
<archiver>i586-mingw32msvc-ar
<cxxflags>-frandom-seed=boost1
;" > user-config.jam
./bootstrap.sh --without-icu
./bjam toolset=gcc target-os=windows threadapi=win32 threading=multi variant=release link=static --user-config=user-config.jam --without-mpi --without-python -sNO_BZIP2=1 -sNO_ZLIB=1 --layout=tagged --build-type=complete $MAKEOPTS stage
for lib in chrono date_time exception filesystem graph iostreams math_c99f math_c99l math_c99 math_tr1f math_tr1l math_tr1 prg_exec_monitor program_options random regex serialization signals system test_exec_monitor thread_win32 unit_test_framework wave wserialization; do
mkdir $lib
(cd $lib ; ar xf ../stage/lib/libboost_${lib}-mt-s.a)
mv $lib $TMPDIR/bin/$GBUILD_BITS
done
cp -a boost $TMPDIR/include
cd $TMPDIR
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
export FAKETIME=$REFERENCE_DATETIME
zip -r boost-win32-1.49.0-gitian2.zip *
cp boost-win32-1.49.0-gitian2.zip $OUTDIR
Thank you in advance and sorry if I'm asking to much :)
Edit:
by the way, I'm using Ruby 1.9.1 and my machine is running Ubuntu 13.0

Mozilla firefox build fails with 'does not match the static pattern 'c:/C''

I've followed the simple firefox build instructions, but the following error occured:
Gabor#AMANDA /c/dev/mozilla-central
$ ./mach build
0:00.36 C:/mozilla-build/msys/bin/sh.exe -c c:/mozilla-build/python/python.exe
c:/dev/mozilla-central/build/pymake/make.py -f client.mk -s
0:03.79 Adding client.mk options from c:/dev/mozilla-central/.mozconfig:
0:03.79 MOZ_OBJDIR=$(TOPSRCDIR)/obj-ff
0:03.79 FOUND_MOZCONFIG := c:/dev/mozilla-central/.mozconfig
0:04.83 c:\dev\mozilla-central\obj-ff\backend.RecursiveMakeBackend.pp:1:0:Targe
t 'backend.RecursiveMakeBackend' does not match the static pattern 'c:/C'
0:04.83 c:\dev\mozilla-central\client.mk:398:0: command 'c:/mozilla-build/pytho
n/python.exe c:/dev/mozilla-central/build/pymake/pymake/../make.py -j4 -C c:/dev
/mozilla-central/obj-ff' failed, return code 2
0:04.83 c:\dev\mozilla-central\client.mk:185:0: command 'c:/mozilla-build/pytho
n/python.exe c:/dev/mozilla-central/build/pymake/pymake/../make.py -f c:/dev/moz
illa-central/client.mk realbuild' failed, return code 2
0:04.95 0 compiler warnings present.
2
Anyone knows what can be the problem?
Mozconfig only contains this:
mk_add_options MOZ_OBJDIR=#TOPSRCDIR#/obj-ff

Resources