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

openindiana filename confusion for '*-x86_64-sun-solaris.tar.xz' #90393

Open
3eka opened this issue Oct 29, 2021 · 15 comments
Open

openindiana filename confusion for '*-x86_64-sun-solaris.tar.xz' #90393

3eka opened this issue Oct 29, 2021 · 15 comments
Labels
needs-triage-legacy Old issue that were never triaged. Remove this label once the issue has been sufficiently triaged. O-solaris Operating system: Solaris O-x86_64 Target: x86-64 processors (like x86_64-*) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@3eka
Copy link

3eka commented Oct 29, 2021

Hi,

just wanted to try to build latest rustc on openindiana:

:; git clone https://github.com/rust-lang/rust.git && cd rust
:; python3 x.py setup
Updating only changed submodules
Submodules updated in 0.47 seconds
extracting /nobackup/SFW_build/rust/build/cache/2021-10-22/rust-std-beta-x86_64-sun-solaris.tar.xz
Traceback (most recent call last):
  File "/nobackup/SFW_build/rust/x.py", line 27, in <module>
    bootstrap.main()
  File "/nobackup/SFW_build/rust/src/bootstrap/bootstrap.py", line 1252, in main
    bootstrap(help_triggered)
  File "/nobackup/SFW_build/rust/src/bootstrap/bootstrap.py", line 1218, in bootstrap
    build.download_toolchain()
  File "/nobackup/SFW_build/rust/src/bootstrap/bootstrap.py", line 415, in download_toolchain
    self._download_component_helper(filename, "rustc", tarball_suffix, stage0)
  File "/nobackup/SFW_build/rust/src/bootstrap/bootstrap.py", line 553, in _download_component_helper
    get(
  File "/nobackup/SFW_build/rust/src/bootstrap/bootstrap.py", line 35, in get
    raise RuntimeError("src/stage0.json doesn't contain a checksum for {}".format(url))
RuntimeError: src/stage0.json doesn't contain a checksum for dist/2021-10-22/rustc-beta-x86_64-sun-solaris.tar.xz

note difference:
rust-std-beta-x86_64-sun-solaris.tar.xz vs rustc-beta-x86_64-sun-solaris.tar.xz

Why it downloads one file, and then tries to use another one?
For example:

:; grep x86_64-sun-solaris.tar.xz src/stage0.json
    "dist/2021-10-22/rust-std-beta-x86_64-sun-solaris.tar.xz": "3a7d686102d9f2469e180a80679db52b6c8dc8ca35adf3e50a25b7bd35f4c6a5",

Am I doing something wrong?
Regards.

@hkratz
Copy link
Contributor

hkratz commented Oct 29, 2021

./x.py setup --build x86_64-unknown-illumos should work. The build target auto-detection incorrectly assumes the deprecated build triple x86_64-sun-solaris which is only supported for cross-compilation from other platforms.

@3eka
Copy link
Author

3eka commented Oct 29, 2021

Thanks,
I should guess myself. Will give it a try.

@3eka
Copy link
Author

3eka commented Nov 1, 2021

Hi,
tried, and after hour or two, it has failed...
Failure output is 3,1MG (uncompressed)... This was command:

:; python3 x.py build --build x86_64-unknown-illumos --j 2 |& tee /tmp/rust-compile.txt

not sure if you are interested in log.
Regards.

@hkratz
Copy link
Contributor

hkratz commented Nov 1, 2021

The actual error should be in the last 100-200 lines. So those should be enough.

@3eka
Copy link
Author

3eka commented Nov 1, 2021

Here you are:

rust-compile.last_200_lines.txt

...
Building stage0 compiler artifacts (x86_64-unknown-illumos -> x86_64-unknown-illumos)
   Compiling rustc_driver v0.0.0 (/nobackup/SFW_build/rust/compiler/rustc_driver)
error: linking with `gcc` failed: exit status: 1
...
  = note: Text relocation remains                 referenced
              against symbol    offsetin file
          vtable for llvm::format_object<float> 0x62      /nobackup/SFW_build/rust/build/x86_64-unknown-illumos/stage0-rustc/x86_64-unknown-illumos/release/deps/librustc_llvm-b3854e7bc8fbee87.rlib(AArch64I
nstPrinter.cpp.o)
          vtable for llvm::format_object<float> 0x5d      /nobackup/SFW_build/rust/build/x86_64-unknown-illumos/stage0-rustc/x86_64-unknown-illumos/release/deps/librustc_llvm-b3854e7bc8fbee87.rlib(AArch64InstPrinter.cpp.o)
...

plenty of it (last 200 in the attached file)

THanks

@hkratz
Copy link
Contributor

hkratz commented Nov 1, 2021

This seems to be a Solaris/Illumos-specific ld error linking in the llvm library, so I am not sure if I can help here. One idea would be to build llvm locally on your machine by putting this in your config.toml file:

[llvm]
download-ci-llvm = false

Of course this will make the build take even longer.

@3eka
Copy link
Author

3eka commented Nov 1, 2021

Thanks @hkratz,
anyway, I will give it a try...

@3eka
Copy link
Author

3eka commented Nov 1, 2021

It has failed (after setting in config.toml were applied:

...
error: could not compile `rustc_driver` due to previous error
Build completed unsuccessfully in 2:05:13

to me, it seems with identical error...

So, I am also out of ideas. Thanks anyway.
Regards.

@3eka
Copy link
Author

3eka commented Nov 2, 2021

FYI, SmartOS has it built (see https://www.pkgsrc.org), but using different methods (I would say).
I was just curious if it could be built with instructions from github.

Will do investigation, and give it a try later.
Regards.

@3eka
Copy link
Author

3eka commented Nov 2, 2021

@hkratz ;
would be possible to specify different Compiler, etc via config.toml:

#cc = "cc" (path)
#cxx = "c++" (path)
#ar = "ar" (path)

For example, if there is GCC 9 present under /usr/gcc/9/bin/gcc what would be cc value?
Regards.

@hkratz
Copy link
Contributor

hkratz commented Nov 2, 2021

Yes, like this:

cc = "/usr/gcc/9/bin/gcc"
cxx = "/usr/gcc/9/bin/g++"
ar = "/usr/gcc/9/bin/ar"

@3eka
Copy link
Author

3eka commented Nov 2, 2021

Hmm,
(cloned rust from git again), and

:; python3 x.py build --build x86_64-unknown-illumos
...
   Compiling cmake v0.1.44
   Compiling quote v1.0.7
   Compiling filetime v0.2.14
   Compiling time v0.1.43
   Compiling num_cpus v1.13.0
   Compiling aho-corasick v0.7.18
   Compiling bstr v0.2.13
   Compiling regex v1.5.4
   Compiling globset v0.4.5
   Compiling ignore v0.4.17
   Compiling merge_derive v0.1.0
   Compiling merge v0.1.0
   Compiling toml v0.5.7
    Finished dev [unoptimized] target(s) in 56.03s
failed to parse TOML configuration 'config.toml': unknown field `cc`, expected one of `optimize`, `debug`, `codegen-units`, `codegen-units-std`, `debug-assertions`, `debug-assertions-std`, `overflow-checks`, `overflow-checks-std`, `debug-logging`, `debuginfo-level`, `debuginfo-level-rustc`, `debuginfo-level-std`, `debuginfo-level-tools`, `debuginfo-level-tests`, `run-dsymutil`, `backtrace`, `incremental`, `parallel-compiler`, `default-linker`, `channel`, `description`, `musl-root`, `rpath`, `verbose-tests`, `optimize-tests`, `codegen-tests`, `ignore-git`, `dist-src`, `save-toolstates`, `codegen-backends`, `lld`, `use-lld`, `llvm-tools`, `deny-warnings`, `backtrace-on-ice`, `verify-llvm-ir`, `thin-lto-import-instr-limit`, `remap-debuginfo`, `jemalloc`, `test-compare-mode`, `llvm-libunwind`, `control-flow-guard`, `new-symbol-mangling`, `profile-generate`, `profile-use`, `download-rustc` for key `rust` at line 708 column 1
Build completed unsuccessfully in 0:01:37

with:

:; grep -E "(cc|cxx|ar) =" config.toml | grep -v ^#
cc = "/usr/gcc/9/bin/gcc"
cxx = "/usr/gcc/9/bin/g++"
ar = "/usr/gcc/9/bin/gcc-ar"

so, I have probably done something wrong.
Thanks for being patient.
Regards.

@hkratz
Copy link
Contributor

hkratz commented Nov 2, 2021

It must be in a target section, like this:

[target.x86_64-unknown-illumos]
cc = "/usr/gcc/9/bin/gcc"
cxx = "/usr/gcc/9/bin/g++"
ar = "/usr/gcc/9/bin/gcc-ar"

@3eka
Copy link
Author

3eka commented Nov 3, 2021

Thanks,
that has helped, but compilation died (see https://app.box.com/s/ykkfjp2j8g03fs81oipdo6zzbosn88cg) log file.

:; grep -v ^# config.toml | grep .
changelog-seen = 2
[llvm]
download-ci-llvm = false
[build]
[install]
prefix = "/pz/SFW"
[rust]
[target.x86_64-unknown-illumos]
cc = "/usr/gcc/9/bin/gcc"
cxx = "/usr/gcc/9/bin/g++"
ar = "/usr/gcc/9/bin/gcc-ar"
[dist]

was configuration .
If you have no idea, let me know (again, this is just my curiosity, not so important atm).

Regards.

P.S. I will delete log file next Wednesday.

@inferiorhumanorgans
Copy link

inferiorhumanorgans commented Jul 26, 2023

For @3eka's issue with undefined symbols setting target.x86_64-pc-solaris.ar and target.x86_64-pc-solaris.ranlib in config.toml to point at newer toolchain bits should help things along. I'm not sure what OpenIndiana comes with but both GNU binutils 2.40 and LLVM 14 worked for me where the stock Apple stuff did not. See also #114162.

@workingjubilee workingjubilee added C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. needs-triage-legacy Old issue that were never triaged. Remove this label once the issue has been sufficiently triaged. O-x86_64 Target: x86-64 processors (like x86_64-*) and removed C-bug Category: This is a bug. labels Jul 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage-legacy Old issue that were never triaged. Remove this label once the issue has been sufficiently triaged. O-solaris Operating system: Solaris O-x86_64 Target: x86-64 processors (like x86_64-*) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants