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

Errors aren't shown to user #87

Closed
Aatch opened this issue Jul 15, 2016 · 18 comments
Closed

Errors aren't shown to user #87

Aatch opened this issue Jul 15, 2016 · 18 comments

Comments

@Aatch
Copy link

Aatch commented Jul 15, 2016

In this gist the "explicit panic" is from a fail helper method that prints out the message. As you can see however, the actual message isn't show to the user. This kinda makes it hard to know what the error was.

The message should probably be printed to stderr, not stdout, anyway.

@Aatch Aatch changed the title Errors aren't show to user Errors aren't shown to user Jul 15, 2016
@alexcrichton
Copy link
Member

Hm, sounds like something is afoot! I don't think this is an issue with the gcc crate itself, because all errors are indeed shown. If anything this sounds like a Cargo issue going on here.

I'm worried that not even this println! is showing up in that gist.

I'm gonna close this as this shouldn't be an issue with gcc-rs, but does this reproduce for you locally? I'd be curious to debug further and see if this is a Cargo issue.

@retep998
Copy link
Member

retep998 commented Jul 15, 2016

None of that output was being written to the console, nor was it being written to the output file, according to @skeleten

@alexcrichton
Copy link
Member

@skeleten, out of curiosity, what sort of environment were you running Cargo in? Was it a cmd.exe shell, msys, etc?

@alexcrichton
Copy link
Member

Also, I'm specifically curious whether rust-lang/cargo#2630 may have broken something here (that's the only relevant change I can think of).

@skeleten
Copy link

I was running it in a normal cmd shell,
cargo 0.12.0-nightly (5716f32 2016-06-29),
rustc 1.11.0-nightly (1ab87b65a 2016-07-02)

@retep998
Copy link
Member

I'm unable to reproduce the issue. After fucking with my msvc installation to reproduce the same issues @skeleten was encountering, I get the output of gcc-rs in my console just fine.

Build failed, waiting for other jobs to finish...
error: failed to run custom build command for `openssl v0.7.13`
process didn't exit successfully: `C:\msys64\home\Peter\bunnybutt-rs\target\debug\build\openssl-d799b404184be4f1\build-script-build` (exit code: 101)
--- stdout
TARGET = Some("x86_64-pc-windows-msvc")
OPT_LEVEL = Some("0")
PROFILE = Some("debug")
TARGET = Some("x86_64-pc-windows-msvc")
debug=true opt-level=0
HOST = Some("x86_64-pc-windows-msvc")
TARGET = Some("x86_64-pc-windows-msvc")
TARGET = Some("x86_64-pc-windows-msvc")
HOST = Some("x86_64-pc-windows-msvc")
CC_x86_64-pc-windows-msvc = None
CC_x86_64_pc_windows_msvc = None
HOST_CC = None
CC = None
TARGET = Some("x86_64-pc-windows-msvc")
HOST = Some("x86_64-pc-windows-msvc")
CFLAGS_x86_64-pc-windows-msvc = None
CFLAGS_x86_64_pc_windows_msvc = None
HOST_CFLAGS = None
CFLAGS = None
running: "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\amd64\\cl.exe" "/nologo" "/MD" "/Z7" "/FoC:\\msys64\\home\\Peter\\bunnybutt-rs\\target\\debug\\build\\openssl-d799b404184be4f1\\out\\src\\c_helpers.o" "/c" "src/c_helpers.c"
c_helpers.c
C:\OpenSSL-Win64\include\openssl/crypto.h(120): fatal error C1083: Cannot open include file: 'stdlib.h': No such file or directory
ExitStatus(ExitStatus(2))


command did not execute successfully, got: exit code: 2



--- stderr
thread 'main' panicked at 'explicit panic', D:\Cargo\registry\src\github.com-1ecc6299db9ec823\gcc-0.3.28\src\lib.rs:840
note: Run with `RUST_BACKTRACE=1` for a backtrace.

And my versions:

rustc 1.11.0-nightly (ad7fe6521 2016-06-23)
cargo 0.12.0-nightly (50dad37 2016-06-21)

@alexcrichton
Copy link
Member

@retep998 I wonder if maybe it's a rustc/cargo difference? Could you try the same versions that @skeleten is using?

@skeleten
Copy link

I uploaded the complete build log here: https://gist.github.com/skeleten/b93631a6ebbd36d5fe765bdd99662869
After a rustup update I get the following log: https://gist.github.com/skeleten/b73cb78dba1418ae3591a07b34f7ab9e

Anything else I could provide for this issue?

Note that after the Build failed message it still takes a while until the command completes.

@alexcrichton
Copy link
Member

@skeleten could you try with Rust 1.10.0?

@retep998
Copy link
Member

Okay, this time I definitely have the same nightly that @skeleten used.

C:\msys64\home\Peter\bunnybutt-rs [master ≡ +1 ~0 -0 !]> rustc -vV
rustc 1.11.0-nightly (1ab87b65a 2016-07-02)
binary: rustc
commit-hash: 1ab87b65a220a933dc9d171ef0fd865ddd88fe89
commit-date: 2016-07-02
host: x86_64-pc-windows-msvc
release: 1.11.0-nightly
C:\msys64\home\Peter\bunnybutt-rs [master ≡ +1 ~0 -0 !]> cargo -vV
cargo 0.12.0-nightly (5716f32 2016-06-29)
C:\msys64\home\Peter\bunnybutt-rs [master ≡ +1 ~0 -0 !]> cargo build
   Compiling matches v0.1.2
   Compiling unicode-normalization v0.1.2
   Compiling libc v0.2.11
   Compiling encoding_index_tests v0.1.4
   Compiling bitflags v0.7.0
   Compiling typeable v0.1.2
   Compiling num_cpus v0.2.12
   Compiling openssl-sys v0.7.13
   Compiling encoding-index-tradchinese v1.20141219.5
   Compiling semver v0.1.20
   Compiling language-tags v0.2.2
   Compiling encoding-index-simpchinese v1.20141219.5
   Compiling log v0.3.6
   Compiling regex-syntax v0.3.3
   Compiling mime v0.2.0
   Compiling rustc-serialize v0.3.19
   Compiling winapi v0.2.7
   Compiling encoding-index-japanese v1.20141219.5
   Compiling httparse v1.1.2
   Compiling rustc_version v0.1.7
   Compiling unicase v1.4.0
   Compiling encoding-index-korean v1.20141219.5
   Compiling winapi-build v0.1.1
   Compiling gdi32-sys v0.2.0
   Compiling kernel32-sys v0.2.2
   Compiling user32-sys v0.2.0
   Compiling lazy_static v0.2.1
   Compiling hpack v0.2.0
   Compiling traitobject v0.0.1
   Compiling encoding-index-singlebyte v1.20141219.5
   Compiling encoding v0.2.32
   Compiling solicit v0.4.4
   Compiling unicode-bidi v0.2.3
   Compiling gcc v0.3.28
   Compiling utf8-ranges v0.1.3
   Compiling idna v0.1.0
   Compiling memchr v0.1.11
   Compiling openssl-sys-extras v0.7.13
   Compiling openssl v0.7.13
Build failed, waiting for other jobs to finish...
error: failed to run custom build command for `openssl-sys-extras v0.7.13`
process didn't exit successfully: `C:\msys64\home\Peter\bunnybutt-rs\target\debug\build\openssl-sys-extras-c284211a61168afa\build-script-build` (exit code: 101)
--- stdout
TARGET = Some("x86_64-pc-windows-msvc")
OPT_LEVEL = Some("0")
PROFILE = Some("debug")
TARGET = Some("x86_64-pc-windows-msvc")
debug=true opt-level=0
HOST = Some("x86_64-pc-windows-msvc")
TARGET = Some("x86_64-pc-windows-msvc")
TARGET = Some("x86_64-pc-windows-msvc")
HOST = Some("x86_64-pc-windows-msvc")
CC_x86_64-pc-windows-msvc = None
CC_x86_64_pc_windows_msvc = None
HOST_CC = None
CC = None
TARGET = Some("x86_64-pc-windows-msvc")
HOST = Some("x86_64-pc-windows-msvc")
CFLAGS_x86_64-pc-windows-msvc = None
CFLAGS_x86_64_pc_windows_msvc = None
HOST_CFLAGS = None
CFLAGS = None
running: "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\amd64\\cl.exe" "/nologo" "/MD" "/Z7" "/FoC:\\msys64\\home\\Peter\\bunnybutt-rs\\target\\debug\\build\\openssl-sys-extras-c284211a61168afa\\out\\src\\openssl_shim.o" "/c" "src/openssl_shim.c"
openssl_shim.c
C:\OpenSSL-Win64\include\openssl/bio.h(65): fatal error C1083: Cannot open include file: 'stdio.h': No such file or directory
ExitStatus(ExitStatus(2))


command did not execute successfully, got: exit code: 2



--- stderr
thread 'main' panicked at 'explicit panic', D:\Cargo\registry\src\github.com-1ecc6299db9ec823\gcc-0.3.28\src\lib.rs:840
note: Run with `RUST_BACKTRACE=1` for a backtrace.

@skeleten
Copy link


C:\Users\skeleten\Source\AlertsTest>cargo -vV
cargo 0.11.0-nightly (259324c 2016-05-20)

C:\Users\skeleten\Source\AlertsTest>rustc -vV
rustc 1.10.0 (cfcb716cf 2016-07-03)
binary: rustc
commit-hash: cfcb716cf0961a7e3a4eceac828d94805cf8140b
commit-date: 2016-07-03
host: x86_64-pc-windows-msvc
release: 1.10.0

C:\Users\skeleten\Source\AlertsTest>cargo clean
error: could not remove build directory

To learn more, run the command again with --verbose.

C:\Users\skeleten\Source\AlertsTest>cargo clean

C:\Users\skeleten\Source\AlertsTest>cargo build
   Compiling matches v0.1.2
   Compiling pkg-config v0.3.8
   Compiling winapi v0.2.8
   Compiling semver v0.1.20
   Compiling libc v0.2.14
   Compiling bitflags v0.7.0
   Compiling unicode-normalization v0.1.2
   Compiling lazy_static v0.2.1
   Compiling traitobject v0.0.1
   Compiling unicode-bidi v0.2.3
   Compiling nom v1.2.3
   Compiling typeable v0.1.2
   Compiling log v0.3.6
   Compiling openssl-sys v0.7.14
   Compiling winapi-build v0.1.1
   Compiling RustyXML v0.1.1
   Compiling mime v0.2.1
   Compiling kernel32-sys v0.2.2
   Compiling hpack v0.2.0
error: linking with `link.exe` failed: exit code: 1104
note: "E:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\amd64\\link.exe" "/LIBPATH:E:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\lib\\amd64" "/LIBPATH:C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.10586.0\\ucrt\\x64" "/LIBPATH:C:\\Program Files (x86)\\Windows Kits\\8.1\\lib\\winv6.3\\um\\x64" "/NOLOGO" "/NXCOMPAT" "/LIBPATH:C:\\Users\\skeleten\\.multirust\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "C:\\Users\\skeleten\\Source\\AlertsTest\\target\\debug\\build\\openssl-sys-db8810c7f6ab3f5c\\build_script_build.0.o" "/OUT:C:\\Users\\skeleten\\Source\\AlertsTest\\target\\debug\\build\\openssl-sys-db8810c7f6ab3f5c\\build_script_build.exe" "/OPT:REF,ICF" "/DEBUG" "/LIBPATH:C:\\Users\\skeleten\\Source\\AlertsTest\\target\\debug\\deps" "/LIBPATH:C:\\Users\\skeleten\\Source\\AlertsTest\\target\\debug\\deps" "/LIBPATH:C:\\Users\\skeleten\\.multirust\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "D:\\Source\\AlertsTest\\target\\debug\\deps\\libpkg_config-7cc12d9787dada57.rlib" "C:\\Users\\skeleten\\.multirust\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libstd-e8edd0fd.rlib" "C:\\Users\\skeleten\\.multirust\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcollections-e8edd0fd.rlib" "C:\\Users\\skeleten\\.multirust\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libpanic_unwind-e8edd0fd.rlib" "C:\\Users\\skeleten\\.multirust\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_unicode-e8edd0fd.rlib" "C:\\Users\\skeleten\\.multirust\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libunwind-e8edd0fd.rlib" "C:\\Users\\skeleten\\.multirust\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librand-e8edd0fd.rlib" "C:\\Users\\skeleten\\.multirust\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liblibc-e8edd0fd.rlib" "C:\\Users\\skeleten\\.multirust\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liballoc-e8edd0fd.rlib" "C:\\Users\\skeleten\\.multirust\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liballoc_system-e8edd0fd.rlib" "C:\\Users\\skeleten\\.multirust\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcore-e8edd0fd.rlib" "ws2_32.lib" "userenv.lib" "shell32.lib" "advapi32.lib" "msvcrt.lib" "compiler-rt.lib"
note: Non-UTF-8 output: LINK : fatal error LNK1104: Datei \"ucrt.lib\" kann nicht ge\xf6ffnet werden.\r\n

error: aborting due to previous error
error: linking with `link.exe` failed: exit code: 1104
note: "E:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\amd64\\link.exe" "/LIBPATH:E:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\lib\\amd64" "/LIBPATH:C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.10586.0\\ucrt\\x64" "/LIBPATH:C:\\Program Files (x86)\\Windows Kits\\8.1\\lib\\winv6.3\\um\\x64" "/NOLOGO" "/NXCOMPAT" "/LIBPATH:C:\\Users\\skeleten\\.multirust\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "C:\\Users\\skeleten\\Source\\AlertsTest\\target\\debug\\build\\kernel32-sys-d6afa5bd3d7cfaef\\build_script_build.0.o" "/OUT:C:\\Users\\skeleten\\Source\\AlertsTest\\target\\debug\\build\\kernel32-sys-d6afa5bd3d7cfaef\\build_script_build.exe" "/OPT:REF,ICF" "/DEBUG" "/LIBPATH:C:\\Users\\skeleten\\Source\\AlertsTest\\target\\debug\\deps" "/LIBPATH:C:\\Users\\skeleten\\Source\\AlertsTest\\target\\debug\\deps" "/LIBPATH:C:\\Users\\skeleten\\.multirust\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "D:\\Source\\AlertsTest\\target\\debug\\deps\\libbuild-493a7b0628804707.rlib" "C:\\Users\\skeleten\\.multirust\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libstd-e8edd0fd.rlib" "C:\\Users\\skeleten\\.multirust\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcollections-e8edd0fd.rlib" "C:\\Users\\skeleten\\.multirust\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libpanic_unwind-e8edd0fd.rlib" "C:\\Users\\skeleten\\.multirust\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_unicode-e8edd0fd.rlib" "C:\\Users\\skeleten\\.multirust\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libunwind-e8edd0fd.rlib" "C:\\Users\\skeleten\\.multirust\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librand-e8edd0fd.rlib" "C:\\Users\\skeleten\\.multirust\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liblibc-e8edd0fd.rlib" "C:\\Users\\skeleten\\.multirust\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liballoc-e8edd0fd.rlib" "C:\\Users\\skeleten\\.multirust\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liballoc_system-e8edd0fd.rlib" "C:\\Users\\skeleten\\.multirust\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcore-e8edd0fd.rlib" "ws2_32.lib" "userenv.lib" "shell32.lib" "advapi32.lib" "msvcrt.lib" "compiler-rt.lib"
note: Non-UTF-8 output: LINK : fatal error LNK1104: Datei \"ucrt.lib\" kann nicht ge\xf6ffnet werden.\r\n

error: aborting due to previous error
   Compiling rustc-serialize v0.3.19
Build failed, waiting for other jobs to finish...
^C
C:\Users\skeleten\Source\AlertsTest>
C:\Users\skeleten\Source\AlertsTest>set LIB="
C:\Users\skeleten\Source\AlertsTest>set LIB="C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64"

C:\Users\skeleten\Source\AlertsTest>echo %LIB%
"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64"

C:\Users\skeleten\Source\AlertsTest>cargo build
   Compiling kernel32-sys v0.2.2
   Compiling gdi32-sys v0.2.0
   Compiling user32-sys v0.2.0
   Compiling winapi v0.2.8
   Compiling solicit v0.4.4
   Compiling num_cpus v0.2.13
   Compiling num-integer v0.1.32
   Compiling openssl-sys v0.7.14
   Compiling rustc_version v0.1.7
   Compiling idna v0.1.0
   Compiling openssl-sys-extras v0.7.14
   Compiling openssl v0.7.14
   Compiling unicase v1.4.0
   Compiling num-iter v0.1.32
Build failed, waiting for other jobs to finish...
error: failed to run custom build command for `openssl-sys-extras v0.7.14`
Process didn't exit successfully: `C:\Users\skeleten\Source\AlertsTest\target\debug\build\openssl-sys-extras-5c7e4d8925825f00\build-script-build` (exit code: 101)
--- stderr
thread '<main>' panicked at 'explicit panic', C:\Users\skeleten\.cargo\registry\src\github.com-1ecc6299db9ec823\gcc-0.3.31\src\lib.rs:840
stack backtrace:
   0:     0x7ff629a475e2 - std::rt::lang_start::hbcefdc316c2fbd45
   1:     0x7ff629a46bcd - std::rt::lang_start::hbcefdc316c2fbd45
   2:     0x7ff629a2e88d - std::panicking::rust_panic_with_hook::h5dd7da6bb3d06020
   3:     0x7ff6299fa1a2 - begin_panic<&str>
                        at D:\Source\src\libstd\panicking.rs:328
   4:     0x7ff629a08bb9 - fail
                        at D:\Source\AlertsTest\<std macros>:3
   5:     0x7ff629a046c3 - run
                        at C:\Users\skeleten\.cargo\registry\src\github.com-1ecc6299db9ec823\gcc-0.3.31\src\lib.rs:834
   6:     0x7ff6299faef0 - compile_object
                        at C:\Users\skeleten\.cargo\registry\src\github.com-1ecc6299db9ec823\gcc-0.3.31\src\lib.rs:375
   7:     0x7ff6299f8995 - compile
                        at C:\Users\skeleten\.cargo\registry\src\github.com-1ecc6299db9ec823\gcc-0.3.31\src\lib.rs:330
   8:     0x7ff6299f1253 - main
                        at C:\Users\skeleten\.cargo\registry\src\github.com-1ecc6299db9ec823\openssl-sys-extras-0.7.14\build.rs:19
   9:     0x7ff629a465cc - std::rt::lang_start::hbcefdc316c2fbd45
  10:     0x7ff629a4b051 - _rust_maybe_catch_panic
  11:     0x7ff629a46304 - std::rt::lang_start::hbcefdc316c2fbd45
  12:     0x7ff6299f3ff9 - main
  13:     0x7ff629a4fccf - __scrt_common_main_seh
                        at f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:264
  14:     0x7ffbd7498363 - BaseThreadInitThunk


C:\Users\skeleten\Source\AlertsTest>

@alexcrichton
Copy link
Member

@skeleten it looks like you had to configure LIB manually, which makes me think that you're probably not running in a VS shell, but you have link.exe in your PATH? Could you describe exactly how this shell is configured?

It also looks like stdout may almost just be getting dropped entirely, but it may be worth doing something like this:

$ cargo new foo
$ cd foo

# add `build = "build.rs"` to Cargo.toml

$ echo 'fn main() { println!("hello"); panic!("world"); }' > build.rs
$ cargo build

I'm curious if you see "hello" from that build script?

@retep998
Copy link
Member

it looks like you had to configure LIB manually

This is an issues with vcvars and older versions of rustc/gcc-rs where it picks the highest numbered folder as the ucrt candidate, even if there is no ucrt folder inside (hence why I added a check). For some reason there will be a 10.0.240.0 folder with the ucrt and a 10.0.586.0 folder without the ucrt in some installations of VC++.

@skeleten
Copy link

@alexcrichton I have VS 2015 Enterprise Installed - did not modify anything about my PATH including link.exe or similiar stuff.
The sample code gives the following output:

C:\Users\skeleten\Source\foo>cargo build
   Compiling foo v0.1.0 (file:///C:/Users/skeleten/Source/foo)
error: failed to run custom build command for `foo v0.1.0 (file:///C:/Users/skeleten/Source/foo)`
process didn't exit successfully: `C:\Users\skeleten\Source\foo\target\debug\build\foo-1b98bc985bb00deb\build-script-build` (exit code: 101)
--- stdout
Hello,

--- stderr
thread 'main' panicked at 'World!', build.rs:3
stack backtrace:
   0:     0x7ff7f568c7ac - std::panicking::default_hook::_{{closure}}::h2cc84f0378700526
   1:     0x7ff7f568b0df - std::rt::lang_start::hfe9ab243c60ffb9b
   2:     0x7ff7f568b8cd - std::panicking::rust_panic_with_hook::h105c3d42fcd2fb5e
   3:     0x7ff7f5681092 - begin_panic<&str>
                        at C:\bot\slave\nightly-dist-rustc-win-msvc-64\build\src\libstd\panicking.rs:328
   4:     0x7ff7f56812ba - main
                        at C:\Users\skeleten\Source\foo\<std macros>:3
   5:     0x7ff7f568b4ec - std::rt::lang_start::hfe9ab243c60ffb9b
   6:     0x7ff7f568ebb1 - _rust_maybe_catch_panic
   7:     0x7ff7f568a974 - std::rt::lang_start::hfe9ab243c60ffb9b
   8:     0x7ff7f56812e9 - main
   9:     0x7ff7f56930a3 - __scrt_common_main_seh
                        at f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:264
  10:     0x7ffbd7498363 - BaseThreadInitThunk


C:\Users\skeleten\Source\foo>

@alexcrichton
Copy link
Member

Oh @retep998 that's interesting! @skeleten what version of gcc-rs are you using?

@skeleten
Copy link

I'm using gcc v0.3.31

@alexcrichton
Copy link
Member

@skeleten hm this all definitely sounds quite suspicious! Could I take a look at the build script you've written so far?

@skeleten
Copy link

skeleten commented Jul 17, 2016

@alexcrichton I'm trying to use it as a dependency of another dependency, so I haven't actually written any build script by myself.
I'll upload the test code to github and provide the codebase as reference though.
Edit: The code i'm having issues with can be found under https://github.com/skeleten/AlertTests

Edit 2: after some consulting in IRC, building openssl with the -vv option gives the following output:

C:\Users\skeleten\Source\rust-openssl\openssl>cargo build -vv
       Fresh bitflags v0.7.0
       Fresh gcc v0.3.31
       Fresh winapi-build v0.1.1
       Fresh libc v0.2.14
       Fresh winapi v0.2.8
       Fresh pkg-config v0.3.8
       Fresh lazy_static v0.2.1
       Fresh user32-sys v0.2.0
       Fresh gdi32-sys v0.2.0
   Compiling openssl v0.7.14 (file:///C:/Users/skeleten/Source/rust-openssl/openssl)
   Compiling openssl-sys-extras v0.7.14 (file:///C:/Users/skeleten/Source/rust-openssl/openssl-sys-extras)
       Fresh openssl-sys v0.7.14 (file:///C:/Users/skeleten/Source/rust-openssl/openssl-sys)
     Running `C:\Users\skeleten\Source\rust-openssl\openssl\target\debug\build\openssl-5394a393c3cca28b\build-script-build`
     Running `C:\Users\skeleten\Source\rust-openssl\openssl\target\debug\build\openssl-sys-extras-79e04e77ac15c4a0\build-script-build`
In openssl now!
TARGET = Some("x86_64-pc-windows-msvc")
OPT_LEVEL = Some("0")
PROFILE = Some("debug")
TARGET = Some("x86_64-pc-windows-msvc")
debug=true opt-level=0
HOST = Some("x86_64-pc-windows-msvc")
TARGET = Some("x86_64-pc-windows-msvc")
TARGET = Some("x86_64-pc-windows-msvc")
HOST = Some("x86_64-pc-windows-msvc")
CC_x86_64-pc-windows-msvc = None
CC_x86_64_pc_windows_msvc = None
HOST_CC = None
CC = None
TARGET = Some("x86_64-pc-windows-msvc")
HOST = Some("x86_64-pc-windows-msvc")
CFLAGS_x86_64-pc-windows-msvc = None
CFLAGS_x86_64_pc_windows_msvc = None
HOST_CFLAGS = None
CFLAGS = None
running: "E:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\amd64\\cl.exe" "/nologo" "/MD" "/Z7" "/I" "E:\\OpenSSL-Win64\\include" "/FoC:\\Users\\skeleten\\Source\\rust-openssl\\openssl\\target\\debug\\build\\openssl-5394a393c3cca28b\\out\\src\\c_helpers.o" "/c" "src/c_helpers.c"
TARGET = Some("x86_64-pc-windows-msvc")
OPT_LEVEL = Some("0")
PROFILE = Some("debug")
TARGET = Some("x86_64-pc-windows-msvc")
debug=true opt-level=0
HOST = Some("x86_64-pc-windows-msvc")
TARGET = Some("x86_64-pc-windows-msvc")
TARGET = Some("x86_64-pc-windows-msvc")
HOST = Some("x86_64-pc-windows-msvc")
CC_x86_64-pc-windows-msvc = None
CC_x86_64_pc_windows_msvc = None
HOST_CC = None
CC = None
TARGET = Some("x86_64-pc-windows-msvc")
HOST = Some("x86_64-pc-windows-msvc")
CFLAGS_x86_64-pc-windows-msvc = None
CFLAGS_x86_64_pc_windows_msvc = None
HOST_CFLAGS = None
CFLAGS = None
running: "E:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\amd64\\cl.exe" "/nologo" "/MD" "/Z7" "/I" "E:\\OpenSSL-Win64\\include" "/FoC:\\Users\\skeleten\\Source\\rust-openssl\\openssl\\target\\debug\\build\\openssl-sys-extras-79e04e77ac15c4a0\\out\\src\\openssl_shim.o" "/c" "src/openssl_shim.c"
c_helpers.c
openssl_shim.c
E:\OpenSSL-Win64\include\openssl/dtls1.h(71): fatal error C1083: Datei (Include) kann nicht ge�ffnet werden: "winsock.h": No such file or directory
E:\OpenSSL-Win64\include\openssl/dtls1.h(71): fatal error C1083: Datei (Include) kann nicht ge�ffnet werden: "winsock.h": No such file or directory
ExitStatus(ExitStatus(2))


command did not execute successfully, got: exit code: 2


thread 'main' panicked at 'explicit panic', C:\Users\skeleten\.cargo\registry\src\github.com-1ecc6299db9ec823\gcc-0.3.31\src\lib.rs:840
ExitStatus(ExitStatus(2))


command did not execute successfully, got: exit code: 2


thread 'main' panicked at 'explicit panic', C:\Users\skeleten\.cargo\registry\src\github.com-1ecc6299db9ec823\gcc-0.3.31\src\lib.rs:840
stack backtrace:
   0:     0x7ff6c96e4bbc - std::panicking::default_hook::_{{closure}}::h2cc84f0378700526
   1:     0x7ff6c96e21df - std::rt::lang_start::hfe9ab243c60ffb9b
   2:     0x7ff6c96e29cd - std::panicking::rust_panic_with_hook::h105c3d42fcd2fb5e
   3:     0x7ff6c969e1e2 - begin_panic<&str>
                        at C:\bot\slave\nightly-dist-rustc-win-msvc-64\build\src\libstd\panicking.rs:328
   4:     0x7ff6c96c4379 - fail
                        at C:\Users\skeleten\Source\rust-openssl\openssl\<std macros>:3
   5:     0x7ff6c96c3ff0 - run
                        at C:\Users\skeleten\.cargo\registry\src\github.com-1ecc6299db9ec823\gcc-0.3.31\src\lib.rs:834
   6:     0x7ff6c96bd0c0 - compile_object
                        at C:\Users\skeleten\.cargo\registry\src\github.com-1ecc6299db9ec823\gcc-0.3.31\src\lib.rs:375
   7:     0x7ff6c96bbbd2 - compile
                        at C:\Users\skeleten\.cargo\registry\src\github.com-1ecc6299db9ec823\gcc-0.3.31\src\lib.rs:330
   8:     0x7ff6c9692702 - main
                        at C:\Users\skeleten\Source\rust-openssl\openssl\build.rs:16
   9:     0x7ff6c96e25ec - std::rt::lang_start::hfe9ab243c60ffb9b
  10:     0x7ff6c96e6fc1 - _rust_maybe_catch_panic
  11:     0x7ff6c96e1a74 - std::rt::lang_start::hfe9ab243c60ffb9b
  12:     0x7ff6c9692959 - main
  13:     0x7ff6c96ecd1f - __scrt_common_main_seh
                        at f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:264
  14:     0x7ffbd7498363 - BaseThreadInitThunk
stack backtrace:
   0:     0x7ff7c66d896c - std::panicking::default_hook::_{{closure}}::h2cc84f0378700526
   1:     0x7ff7c66d5f8f - std::rt::lang_start::hfe9ab243c60ffb9b
Build failed, waiting for other jobs to finish...
   2:     0x7ff7c66d677d - std::panicking::rust_panic_with_hook::h105c3d42fcd2fb5e
   3:     0x7ff7c66921a2 - begin_panic<&str>
                        at C:\bot\slave\nightly-dist-rustc-win-msvc-64\build\src\libstd\panicking.rs:328
   4:     0x7ff7c66b7f69 - fail
                        at C:\Users\skeleten\Source\rust-openssl\openssl\<std macros>:3
   5:     0x7ff7c66b7be0 - run
                        at C:\Users\skeleten\.cargo\registry\src\github.com-1ecc6299db9ec823\gcc-0.3.31\src\lib.rs:834
   6:     0x7ff7c66b0cb0 - compile_object
                        at C:\Users\skeleten\.cargo\registry\src\github.com-1ecc6299db9ec823\gcc-0.3.31\src\lib.rs:375
   7:     0x7ff7c66af7c2 - compile
                        at C:\Users\skeleten\.cargo\registry\src\github.com-1ecc6299db9ec823\gcc-0.3.31\src\lib.rs:330
   8:     0x7ff7c66851d3 - main
                        at C:\Users\skeleten\Source\rust-openssl\openssl-sys-extras\build.rs:19
   9:     0x7ff7c66d639c - std::rt::lang_start::hfe9ab243c60ffb9b
  10:     0x7ff7c66dad71 - _rust_maybe_catch_panic
  11:     0x7ff7c66d5824 - std::rt::lang_start::hfe9ab243c60ffb9b
  12:     0x7ff7c6686ac9 - main
  13:     0x7ff7c66e0acf - __scrt_common_main_seh
                        at f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:264
  14:     0x7ffbd7498363 - BaseThreadInitThunk
error: failed to run custom build command for `openssl v0.7.14 (file:///C:/Users/skeleten/Source/rust-openssl/openssl)`
process didn't exit successfully: `C:\Users\skeleten\Source\rust-openssl\openssl\target\debug\build\openssl-5394a393c3cca28b\build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'explicit panic', C:\Users\skeleten\.cargo\registry\src\github.com-1ecc6299db9ec823\gcc-0.3.31\src\lib.rs:840
stack backtrace:
   0:     0x7ff6c96e4bbc - std::panicking::default_hook::_{{closure}}::h2cc84f0378700526
   1:     0x7ff6c96e21df - std::rt::lang_start::hfe9ab243c60ffb9b
   2:     0x7ff6c96e29cd - std::panicking::rust_panic_with_hook::h105c3d42fcd2fb5e
   3:     0x7ff6c969e1e2 - begin_panic<&str>
                        at C:\bot\slave\nightly-dist-rustc-win-msvc-64\build\src\libstd\panicking.rs:328
   4:     0x7ff6c96c4379 - fail
                        at C:\Users\skeleten\Source\rust-openssl\openssl\<std macros>:3
   5:     0x7ff6c96c3ff0 - run
                        at C:\Users\skeleten\.cargo\registry\src\github.com-1ecc6299db9ec823\gcc-0.3.31\src\lib.rs:834
   6:     0x7ff6c96bd0c0 - compile_object
                        at C:\Users\skeleten\.cargo\registry\src\github.com-1ecc6299db9ec823\gcc-0.3.31\src\lib.rs:375
   7:     0x7ff6c96bbbd2 - compile
                        at C:\Users\skeleten\.cargo\registry\src\github.com-1ecc6299db9ec823\gcc-0.3.31\src\lib.rs:330
   8:     0x7ff6c9692702 - main
                        at C:\Users\skeleten\Source\rust-openssl\openssl\build.rs:16
   9:     0x7ff6c96e25ec - std::rt::lang_start::hfe9ab243c60ffb9b
  10:     0x7ff6c96e6fc1 - _rust_maybe_catch_panic
  11:     0x7ff6c96e1a74 - std::rt::lang_start::hfe9ab243c60ffb9b
  12:     0x7ff6c9692959 - main
  13:     0x7ff6c96ecd1f - __scrt_common_main_seh
                        at f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:264
  14:     0x7ffbd7498363 - BaseThreadInitThunk


C:\Users\skeleten\Source\rust-openssl\openssl>

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

4 participants