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

Added documentation for how to emit the smir.json for the std-lib #17

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

dkcumming
Copy link
Collaborator

How to build smir-json for the std-lib

Working for cargo version 1.79.0-nightly
Not working for cargo version 1.82.0-nightly <-- currently investigating

@dkcumming dkcumming self-assigned this Oct 30, 2024
@dkcumming dkcumming removed their assignment Jan 17, 2025
@dkcumming dkcumming added the bug Something isn't working label Jan 17, 2025
@dkcumming
Copy link
Collaborator Author

This still is broken, but some of the changes to from #19 need to be handled also. We can see #27 occurring, the variants that aren't completed in #32 being reached, and stack overflow occurring (not sure why). Here is the current error output:

$ RUSTC="/home/daniel/Applications/smir_pretty/run.sh" cargo build -Z build-std --target x86_64-unknown-linux-gnu
   Compiling compiler_builtins v0.1.140
   Compiling core v0.0.0 (/home/daniel/Applications/smir_pretty/deps/rust/src/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/src/rust/library/core)
   Compiling libc v0.2.169
   Compiling object v0.36.7
   Compiling std v0.0.0 (/home/daniel/Applications/smir_pretty/deps/rust/src/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/src/rust/library/std)

thread 'rustc' panicked at compiler/rustc_middle/src/ty/predicate.rs:533:9:
`<dyn std::fmt::Debug as std::marker::Sized>` has escaping bound vars, so it cannot be wrapped in a dummy binder.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'rustc' has overflowed its stack
fatal runtime error: stack overflow
error: could not compile `std` (build script)

Caused by:
  process didn't exit successfully: `/home/daniel/Applications/smir_pretty/run.sh --crate-name build_script_build --edition=2021 /home/daniel/Applications/smir_pretty/deps/rust/src/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/src/rust/library/std/build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=190 --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --warn=unexpected_cfgs --check-cfg 'cfg(bootstrap)' --check-cfg 'cfg(target_arch, values("xtensa"))' --check-cfg 'cfg(feature, values(any()))' --cfg 'feature="addr2line"' --cfg 'feature="backtrace"' --cfg 'feature="miniz_oxide"' --cfg 'feature="object"' --cfg 'feature="panic-unwind"' --cfg 'feature="panic_unwind"' --cfg 'feature="std_detect_dlsym_getauxval"' --cfg 'feature="std_detect_file_io"' --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("addr2line", "backtrace", "compiler-builtins-c", "compiler-builtins-mangled-names", "compiler-builtins-mem", "compiler-builtins-no-asm", "compiler-builtins-no-f16-f128", "llvm-libunwind", "miniz_oxide", "object", "optimize_for_size", "panic-unwind", "panic_immediate_abort", "panic_unwind", "std_detect_dlsym_getauxval", "std_detect_env_override", "std_detect_file_io", "system-llvm-libunwind", "windows_raw_dylib"))' -C metadata=7490d6d09f43d07f -C extra-filename=-fa968cab43f57f4d --out-dir /home/daniel/example1/target/debug/build/std-fa968cab43f57f4d -Z force-unstable-if-unmarked -L dependency=/home/daniel/example1/target/debug/deps --cap-lints allow` (exit status: 101)
warning: build failed, waiting for other jobs to finish...

thread 'rustc' panicked at src/printer.rs:424:10:
not yet implemented
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: could not compile `libc` (build script)

Caused by:
  process didn't exit successfully: `/home/daniel/Applications/smir_pretty/run.sh --crate-name build_script_build --edition=2021 /home/daniel/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libc-0.2.169/build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=190 --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="align"' --cfg 'feature="rustc-dep-of-std"' --cfg 'feature="rustc-std-workspace-core"' --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("align", "const-extern-fn", "default", "extra_traits", "rustc-dep-of-std", "rustc-std-workspace-core", "std", "use_std"))' -C metadata=294cbaaf8d6d9a65 -C extra-filename=-769212f1baf19e0b --out-dir /home/daniel/example1/target/debug/build/libc-769212f1baf19e0b -Z force-unstable-if-unmarked -L dependency=/home/daniel/example1/target/debug/deps --cap-lints allow` (exit status: 101)

thread 'rustc' has overflowed its stack
fatal runtime error: stack overflow
/home/daniel/Applications/smir_pretty/run.sh: line 19: 232652 Aborted                 (core dumped) "$SCRIPT_DIR/target/debug/$BIN" "$@"
error: could not compile `object` (build script)

Caused by:
  process didn't exit successfully: `/home/daniel/Applications/smir_pretty/run.sh --crate-name build_script_build --edition=2018 /home/daniel/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/object-0.36.7/build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=190 --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="alloc"' --cfg 'feature="archive"' --cfg 'feature="coff"' --cfg 'feature="compiler_builtins"' --cfg 'feature="core"' --cfg 'feature="elf"' --cfg 'feature="macho"' --cfg 'feature="pe"' --cfg 'feature="read_core"' --cfg 'feature="rustc-dep-of-std"' --cfg 'feature="unaligned"' --cfg 'feature="xcoff"' --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("all", "alloc", "archive", "build", "build_core", "cargo-all", "coff", "compiler_builtins", "compression", "core", "default", "doc", "elf", "macho", "pe", "read", "read_core", "rustc-dep-of-std", "std", "unaligned", "unstable", "unstable-all", "wasm", "write", "write_core", "write_std", "xcoff"))' -C metadata=7958ce590311f63f -C extra-filename=-fceacc963cd31589 --out-dir /home/daniel/example1/target/debug/build/object-fceacc963cd31589 -Z force-unstable-if-unmarked -L dependency=/home/daniel/example1/target/debug/deps --cap-lints allow` (exit status: 134)
/home/daniel/Applications/smir_pretty/run.sh: line 19: 232646 Aborted                 (core dumped) "$SCRIPT_DIR/target/debug/$BIN" "$@"
error: could not compile `compiler_builtins` (build script)

Caused by:
  process didn't exit successfully: `/home/daniel/Applications/smir_pretty/run.sh --crate-name build_script_build --edition=2021 /home/daniel/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/compiler_builtins-0.1.140/build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=190 --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="compiler-builtins"' --cfg 'feature="core"' --cfg 'feature="default"' --cfg 'feature="rustc-dep-of-std"' --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("c", "cc", "compiler-builtins", "core", "default", "mangled-names", "mem", "no-asm", "no-f16-f128", "public-test-deps", "rustc-dep-of-std"))' -C metadata=593111ed4d4e6790 -C extra-filename=-063be6be206fe9a0 --out-dir /home/daniel/example1/target/debug/build/compiler_builtins-063be6be206fe9a0 -Z force-unstable-if-unmarked -L dependency=/home/daniel/example1/target/debug/deps --cap-lints allow` (exit status: 134)

thread 'rustc' panicked at compiler/rustc_middle/src/ty/predicate.rs:533:9:
`<[fmt::rt::Argument<'_>] as marker::Sized>` has escaping bound vars, so it cannot be wrapped in a dummy binder.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: could not compile `core` (lib)

Caused by:
  process didn't exit successfully: `/home/daniel/Applications/smir_pretty/run.sh --crate-name core --edition=2021 /home/daniel/Applications/smir_pretty/deps/rust/src/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/src/rust/library/core/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=190 --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --warn=unexpected_cfgs --check-cfg 'cfg(bootstrap)' --check-cfg 'cfg(no_fp_fmt_parse)' --check-cfg 'cfg(stdarch_intel_sde)' --check-cfg 'cfg(target_arch, values("xtensa"))' --check-cfg 'cfg(feature, values(any()))' --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("debug_refcell", "optimize_for_size", "panic_immediate_abort"))' -C metadata=b23d5a2d22078acd -C extra-filename=-33c3f457ff0f0469 --out-dir /home/daniel/example1/target/x86_64-unknown-linux-gnu/debug/deps --target x86_64-unknown-linux-gnu -Z force-unstable-if-unmarked -L dependency=/home/daniel/example1/target/x86_64-unknown-linux-gnu/debug/deps -L dependency=/home/daniel/example1/target/debug/deps --cap-lints allow` (exit status: 101)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant