Skip to content

Instantly share code, notes, and snippets.

@hnakamur
Forked from ebfe/build-cargo-freebsd.sh
Last active August 29, 2015 14:21
Show Gist options
  • Save hnakamur/4b85c051bfbc518c64df to your computer and use it in GitHub Desktop.
Save hnakamur/4b85c051bfbc518c64df to your computer and use it in GitHub Desktop.
#!/bin/sh
set -e
mkdir -p target
mkdir -p deps
git clone https://github.com/rust-lang/regex deps/regex
git clone https://github.com/rust-lang/semver deps/semver
git clone https://github.com/dguo/strsim-rs deps/strsim-rs
git clone https://github.com/rust-lang/rustc-serialize deps/rustc-serialize
git clone https://github.com/docopt/docopt.rs deps/docopt.rs
git clone https://github.com/alexcrichton/curl-rust deps/curl-rust --branch bundle
git clone https://github.com/lifthrasiir/rust-encoding deps/rust-encoding
#git clone https://github.com/alexcrichton/flate2-rs deps/flate2-rs
git clone https://github.com/hnakamur/flate2-rs deps/flate2-rs --branch add_feature_libc
git clone https://github.com/rust-lang/glob deps/glob
git clone https://github.com/carllerche/hamcrest-rust.git deps/hamcrest-rust
#git clone https://github.com/alexcrichton/tar-rs deps/tar-rs
git clone https://github.com/hnakamur/tar-rs deps/tar-rs --branch add_feature_libc
#git clone https://github.com/alexcrichton/libssh2-static-sys deps/libssh2-static-sys
#git clone https://github.com/alexcrichton/libz-sys deps/libz-sys
git clone https://github.com/hnakamur/libz-sys deps/libz-sys --branch add_feature_libc
git clone https://github.com/alexcrichton/ssh2-rs deps/ssh2-rs
git clone https://github.com/alexcrichton/openssl-static-sys deps/openssl-static-sys
git clone https://github.com/alexcrichton/openssl-sys deps/openssl-sys
git clone https://github.com/alexcrichton/toml-rs deps/toml-rs
git clone https://github.com/servo/rust-url deps/rust-url
git clone https://github.com/rust-lang/bitflags deps/bitflags
#git clone https://github.com/alexcrichton/git2-rs deps/git2-rs
git clone https://github.com/hnakamur/git2-rs deps/git2-rs --branch update_libgit2_sys
git clone https://github.com/alexcrichton/link-config deps/link-config
git clone https://github.com/SimonSapin/rust-std-candidates deps/SimonSapin/rust-std-candidates
git clone https://github.com/rust-lang/cargo
export RUST_BACKTRACE=1
rustc deps/regex/src/lib.rs --crate-type lib --crate-name regex --out-dir target -L target/
rustc deps/semver/src/lib.rs --crate-type lib --crate-name semver --out-dir target -L target/
rustc deps/strsim-rs/src/lib.rs --crate-type lib --crate-name strsim --out-dir target -L target/
rustc deps/rustc-serialize/src/lib.rs --crate-type lib --crate-name rustc_serialize --out-dir target -L target/
rustc deps/docopt.rs/src/lib.rs --crate-type lib --crate-name docopt --out-dir target -L target/
rustc deps/rust-encoding/src/index/singlebyte/lib.rs --crate-type lib --crate-name encoding_index_singlebyte --out-dir target -L target/
rustc deps/rust-encoding/src/index/korean/lib.rs --crate-type lib --crate-name encoding_index_korean --out-dir target -L target/
rustc deps/rust-encoding/src/index/japanese/lib.rs --crate-type lib --crate-name encoding_index_japanese --out-dir target -L target/
rustc deps/rust-encoding/src/index/simpchinese/lib.rs --crate-type lib --crate-name encoding_index_simpchinese --out-dir target -L target/
rustc deps/rust-encoding/src/index/tradchinese/lib.rs --crate-type lib --crate-name encoding_index_tradchinese --out-dir target -L target/
#rustc deps/rust-encoding/src/lib.rs --crate-type lib --crate-name encoding --out-dir target -L target/
#OUT_DIR=../../../target/ gmake -C deps/flate2-rs/build/
rustc deps/flate2-rs/miniz-sys/lib.rs --crate-type lib --crate-name miniz_sys --out-dir target -L target/
rustc deps/flate2-rs/src/lib.rs --crate-type lib --crate-name flate2 --out-dir target -L target/
rustc deps/glob/src/lib.rs --crate-type lib --crate-name glob --out-dir target -L target/
rustc deps/hamcrest-rust/src/lib.rs --crate-type lib --crate-name hamcrest --out-dir target -L target/
rustc deps/tar-rs/src/lib.rs --crate-type lib --crate-name tar --out-dir target -L target/
#rustc deps/libssh2-static-sys/src/lib.rs --crate-type lib --crate-name libssh2_static_sys --out-dir target -L target/
rustc deps/libz-sys/src/lib.rs --crate-type lib --crate-name libz_sys --out-dir target -L target/
rustc deps/openssl-sys/src/lib.rs --crate-type lib --crate-name openssl_sys --out-dir target -L target/
rustc deps/ssh2-rs/libssh2-sys/lib.rs --crate-type lib --crate-name libssh2_sys --out-dir target -L target/
#rustc deps/openssl-static-sys/src/lib.rs --crate-type lib --crate-name openssl_static_sys --out-dir target -L target/
rustc deps/toml-rs/src/lib.rs --crate-type lib --crate-name toml --out-dir target -L target/
rustc deps/SimonSapin/rust-std-candidates/matches/lib.rs --crate-type lib --crate-name matches --out-dir target -L target/
rustc deps/rust-url/src/lib.rs --crate-type lib --crate-name url --out-dir target -L target/
rustc deps/docopt.rs/docopt_macros/src/macro.rs --crate-type dylib --crate-name docopt_macros --out-dir target -L target/
rustc deps/bitflags/src/lib.rs --crate-type lib --crate-name bitflags --out-dir target -L target/
#rustc deps/link-config/src/lib.rs --crate-type lib --crate-name link_config --out-dir target -L target/ --crate-type dylib
rustc deps/git2-rs/libgit2-sys/lib.rs --crate-type lib --crate-name libgit2_sys --out-dir target -L target/ --extern url=target/liburl.rlib
rustc deps/git2-rs/src/lib.rs --crate-type lib --crate-name git2 --out-dir target -L target/ --extern url=target/liburl.rlib
rustc deps/curl-rust/curl-sys/src/lib.rs --crate-type lib --crate-name curl-sys --out-dir target -L target/
rustc deps/curl-rust/src/lib.rs --crate-type lib --crate-name curl --out-dir target -L target/ --extern url=target/liburl.rlib
export CARGO_PKG_VERSION_MAJOR=0
export CARGO_PKG_VERSION_MINOR=0
export CARGO_PKG_VERSION_PATCH=1
rustc cargo/src/cargo/lib.rs -L target --out-dir target --extern glob=target/libglob.rlib --extern semver=target/libsemver.rlib
rustc cargo/src/bin/cargo.rs -L target --out-dir target
@hnakamur
Copy link
Author

sh -x build-cargo-freebsd.sh
...
+ rustc deps/rust-encoding/src/lib.rs --crate-type lib --crate-name encoding --out-dir target -L target/
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'assertion failed: prev_const.is_none() || prev_const == Some(llconst)', /home/vagrant/rust/src/librustc_trans/trans/consts.rs:318

stack backtrace:
   1:        0x80653eca1 - <unknown>
   2:        0x806546a57 - <unknown>
   3:        0x80650994c - <unknown>
   4:        0x800b7645e - <unknown>
   5:        0x800be9420 - <unknown>
   6:        0x800c41590 - <unknown>
   7:        0x800bbb74f - <unknown>
   8:        0x800c57f4e - <unknown>
   9:        0x800bdd5b2 - <unknown>
  10:        0x800c83532 - <unknown>
  11:        0x800c5819c - <unknown>
  12:        0x800bdb646 - <unknown>
  13:        0x800c8383d - <unknown>
  14:        0x800c5819c - <unknown>
  15:        0x800bdb646 - <unknown>
  16:        0x800bd9f61 - <unknown>
  17:        0x800bdbc3a - <unknown>
  18:        0x800bdea07 - <unknown>
  19:        0x800bdf318 - <unknown>
  20:        0x800bec73c - <unknown>
  21:        0x80085ce9c - <unknown>
  22:        0x800835ba6 - <unknown>
  23:        0x8008ee381 - <unknown>
  24:        0x8008ebbd2 - <unknown>
  25:        0x8008eb3d9 - <unknown>
  26:        0x8065bbdd8 - <unknown>
  27:        0x8065bbdc5 - <unknown>
  28:        0x806532f08 - <unknown>
  29:        0x8008eb5f9 - <unknown>
  30:        0x806545676 - <unknown>
  31:        0x806a5d4f4 - <unknown>
  32:                0x0 - <unknown>

Relevant sources:

https://github.com/rust-lang/rust/blob/1742a01f8d5717f1ab2f445c4d4656633b4c88b9/src/librustc_trans/trans/consts.rs#L318

            if let Some(target) = adj.unsize {

https://github.com/rust-lang/rust/blob/1742a01f8d5717f1ab2f445c4d4656633b4c88b9/src/librustc_trans/trans/consts.rs#L345-L347

                let prev_const = cx.const_unsized().borrow_mut()
                                   .insert(base, llconst);
                assert!(prev_const.is_none() || prev_const == Some(llconst));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment