[SOLVED] cannot build rust package for armv6

Problems with packages? Post here, using [tags] of the package name.

[SOLVED] cannot build rust package for armv6

Postby keithspg » Thu Nov 03, 2022 3:28 am

I am trying to build a number packages for armv6. The latest stumbling block is rust. I know armv6 is no longer supported, but I have been able to update gcc and gcc libs and other packages to be able to build trhe packages I need to stay current. I am now trying to build the latest rust using the PKGBUILD and other source files from the git repository:
https://github.com/archlinuxarm/PKGBUILDs/tree/master/extra/rust
I added the architecture to the PKGBUIILD and when I build it, I get this problem:
$this->bbcode_second_pass_code('', ' Building rustbuild
error: process didn't exit successfully: `/usr/bin/rustc -vV` (exit status: 1)
--- stderr
/usr/bin/rustc: /usr/lib/libLLVM-13.so: version `LLVM_13' not found (required by /usr/lib/librustc_driver-471ac765f256ad23.so)

failed to run: /usr/bin/cargo build --manifest-path /Rune_dev/armv6/rust/src/rustc-1.64.0-src/src/bootstrap/Cargo.toml --locked --frozen
Build completed unsuccessfully in 0:00:00
==> ERROR: A failure occurred in build(). ')
but libLLVM-13.so is present:
$this->bbcode_second_pass_code('', '$ ls -al /usr/lib/libLLVM-*
lrwxrwxrwx 1 root root 13 Nov 1 22:13 /usr/lib/libLLVM-13.so -> libLLVM-14.so
lrwxrwxrwx 1 root root 13 Oct 31 23:13 /usr/lib/libLLVM-14.0.6.so -> libLLVM-14.so
-rwxr-xr-x 1 root root 105542368 Oct 31 23:13 /usr/lib/libLLVM-14.so
lrwxrwxrwx 1 root root 14 Apr 10 2020 /usr/lib/libLLVM-7.1.0.so -> libLLVM-7.1.so
-rwxr-xr-x 1 root root 61149252 Apr 10 2020 /usr/lib/libLLVM-7.1.so
')
I previously built llvm for armv6 and installed it. My guess is that the verions ov llvm, is not properly configured or maybe not built for armv6. I used this package to build it:
https://archlinuxarm.org/packages/armv7h/llvm/files
and added armv6h to the architectures. It builds, but fails the tests, so to build the package, I have to comment out the test portion of the PKGBUILD to get it to build a package. I am building it again to see what the error is.
EDIT - error shown:
$this->bbcode_second_pass_code('', '==> Starting check()...
[1/2] Running all regression tests
-- Testing: 47062 tests, 4 workers --
0% [--------------------------------------------------------------------------------------------------------------------------------------------------]

Traceback (most recent call last):
File "/Rune_dev/armv6/llvm/src/llvm-14.0.6.src/build/./bin/llvm-lit", line 39, in <module>
main(builtin_parameters)
File "/Rune_dev/armv6/llvm/src/llvm-14.0.6.src/utils/lit/lit/main.py", line 106, in main
run_tests(selected_tests, lit_config, opts, len(discovered_tests))
File "/Rune_dev/armv6/llvm/src/llvm-14.0.6.src/utils/lit/lit/main.py", line 225, in run_tests
execute_in_tmp_dir(run, lit_config)
File "/Rune_dev/armv6/llvm/src/llvm-14.0.6.src/utils/lit/lit/main.py", line 255, in execute_in_tmp_dir
run.execute()
File "/Rune_dev/armv6/llvm/src/llvm-14.0.6.src/utils/lit/lit/run.py", line 55, in execute
self._execute(deadline)
File "/Rune_dev/armv6/llvm/src/llvm-14.0.6.src/utils/lit/lit/run.py", line 69, in _execute
pool = multiprocessing.Pool(self.workers, lit.worker.initialize,
File "/usr/lib/python3.10/multiprocessing/context.py", line 119, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild,
File "/usr/lib/python3.10/multiprocessing/pool.py", line 191, in __init__
self._setup_queues()
File "/usr/lib/python3.10/multiprocessing/pool.py", line 343, in _setup_queues
self._inqueue = self._ctx.SimpleQueue()
File "/usr/lib/python3.10/multiprocessing/context.py", line 113, in SimpleQueue
return SimpleQueue(ctx=self.get_context())
File "/usr/lib/python3.10/multiprocessing/queues.py", line 342, in __init__
self._rlock = ctx.Lock()
File "/usr/lib/python3.10/multiprocessing/context.py", line 68, in Lock
return Lock(ctx=self.get_context())
File "/usr/lib/python3.10/multiprocessing/synchronize.py", line 162, in __init__
SemLock.__init__(self, SEMAPHORE, 1, 1, ctx=ctx)
File "/usr/lib/python3.10/multiprocessing/synchronize.py", line 57, in __init__
sl = self._semlock = _multiprocessing.SemLock(
PermissionError: [Errno 13] Permission denied
FAILED: CMakeFiles/check-all /Rune_dev/armv6/llvm/src/llvm-14.0.6.src/build/CMakeFiles/check-all
cd /Rune_dev/armv6/llvm/src/llvm-14.0.6.src/build && /usr/bin/python3.10 /Rune_dev/armv6/llvm/src/llvm-14.0.6.src/build/./bin/llvm-lit -sv /Rune_dev/armv
6/llvm/src/llvm-14.0.6.src/build/utils/lit /Rune_dev/armv6/llvm/src/llvm-14.0.6.src/build/test
ninja: build stopped: subcommand failed.
==> ERROR: A failure occurred in check().
Aborting...
')

This is the error which stops llvm from completing

Any help appreciated.
Last edited by keithspg on Tue Dec 13, 2022 12:48 pm, edited 1 time in total.
keithspg
 
Posts: 224
Joined: Mon Feb 23, 2015 4:14 pm

Re: cannot build rust package for armv6

Postby robg » Thu Nov 03, 2022 3:14 pm

I believe the error
$this->bbcode_second_pass_code('', '/usr/bin/rustc: /usr/lib/libLLVM-13.so: version `LLVM_13' not found (required by /usr/lib/librustc_driver-471ac765f256ad23.so)')
is not about lacking /usr/lin/libLLVM-13.so, but rather about a "version" variable in /usr/lin/libLLVM-13.so being set to "LLVM_14" (because, as you have showed, your libLLVM-13.so is a symlink to libLLVM-14.so).

So your rust compiler (rustc) is targeting LLVM 13; inspecting the PKGBUILD should indicate how to change this.
robg
 
Posts: 194
Joined: Tue Jan 05, 2021 8:22 am

Re: cannot build rust package for armv6

Postby keithspg » Mon Nov 07, 2022 11:57 pm

Robg,

Thanks for the hint. I looked at the PKGBUILD here:https://github.com/archlinuxarm/PKGBUILDs/blob/master/extra/rust/PKGBUILD
as well as the llvm patch file as well and cannot see what it is that I could change to get it to change to llvm14 as opposed to 13.

EDIT: I noticed a new version of rust was dropped in the PKGBUILDS and I started over with this new one. I get the same result.
$this->bbcode_second_pass_code('', '==> Starting build()...
Building rustbuild
error: process didn't exit successfully: `/usr/bin/rustc -vV` (exit status: 1)
--- stderr
/usr/bin/rustc: /usr/lib/libLLVM-13.so: version `LLVM_13' not found (required by /usr/lib/librustc_driver-471ac765f256ad23.so)

failed to run: /usr/bin/cargo build --manifest-path /Rune_dev/armv6/rust/src/rustc-1.65.0-src/src/bootstrap/Cargo.toml --locked --frozen
Build completed unsuccessfully in 0:00:00
==> ERROR: A failure occurred in build().
Aborting...
')
there is no 'make' or 'ninja' command in the build. I do not know much about rust other than I need it to build a couple packages from the PKGBUILDs I have. I am really confused as to how to remedy this.

Thanks for any help!

Keith
keithspg
 
Posts: 224
Joined: Mon Feb 23, 2015 4:14 pm

Re: cannot build rust package for armv6

Postby keithspg » Wed Nov 09, 2022 3:15 am

Well digging some more, I may have stumbled across it though I am still stymied with the 'permission denied' error.

I believe the llvm error is related to the clang package. My clang was out of date so I tried to build a new version from the PKGBUILD. It builds but then fails every time with this:
$this->bbcode_second_pass_code('', '==> Starting check()...
[0/2] Running the Clang extra tools' regression tests
-- Testing: 1158 tests, 4 workers --
0% [--------------------------------------------------------------------------------------------------------------]

Traceback (most recent call last):
...
File "/usr/lib/python3.10/multiprocessing/synchronize.py", line 57, in __init__
sl = self._semlock = _multiprocessing.SemLock(
PermissionError: [Errno 13] Permission denied
FAILED: tools/extra/test/CMakeFiles/check-clang-tools /Rune_dev/armv6/clang/src/clang-14.0.6.src/build/tools/extra/te
st/CMakeFiles/check-clang-tools
cd /Rune_dev/armv6/clang/src/clang-14.0.6.src/build/tools/extra/test && /usr/bin/python3.10 /usr/bin/lit -sv /Rune_de
v/armv6/clang/src/clang-14.0.6.src/build/tools/extra/test
ninja: build stopped: subcommand failed.
==> ERROR: A failure occurred in check().
')
I am running makepkg as a user, not root, and have access to the folder structure. I can create and destroy directories and files in tehis directory. This directory is an NFS mount, so that may be a contributing factor.
Any hints?
keithspg
 
Posts: 224
Joined: Mon Feb 23, 2015 4:14 pm

Re: cannot build rust package for armv6

Postby keithspg » Thu Nov 10, 2022 12:51 am

So, the story so far. I built and installed the latest clang and still get teh same error when I try to build rust. It is interesting to me that I need rust to build rust (it is a make_depend). When I try to build it, I get the LLVM_13 error and therefore not build rust.
$this->bbcode_second_pass_code('', '$ /usr/bin/rustc -vV
/usr/bin/rustc: /usr/lib/libLLVM-13.so: version `LLVM_13' not found (required by /usr/lib/librustc_driver-471ac765f256ad23.so)
')

So, to get a bit further, I installed the last armv6 version of llvm-libs and now it gets further, but still will not build cargo:
$this->bbcode_second_pass_code('', 'Building rustbuild
error: failed to get `cc` as a dependency of package `bootstrap v0.0.0 (/Rune_dev/armv6/rust/src/rustc-1.65.0-src/src/bootstrap)`

Caused by:
failed to load source for dependency `cc`

Caused by:
Unable to update registry `crates-io`

Caused by:
failed to update replaced source registry `crates-io`

Caused by:
failed to parse manifest at `/Rune_dev/armv6/rust/src/rustc-1.65.0-src/vendor/libgit2-sys/Cargo.toml`

Caused by:
optional dependency features with `?` syntax are only allowed on the nightly channel and requires the `-Z weak-dep-features` flag on the command line
Feature `zlib-ng-compat` had feature value `libssh2-sys?/zlib-ng-compat`.
failed to run: /usr/bin/cargo build --manifest-path /Rune_dev/armv6/rust/src/rustc-1.65.0-src/src/bootstrap/Cargo.toml --locked --frozen
Build completed unsuccessfully in 0:00:02
')

I did a bit of digging and tried this:
$this->bbcode_second_pass_code('', '$ /usr/bin/cargo build --manifest-path /Rune_dev/armv6/rust/src/rustc-1.65.0-src/src/bootstrap/Cargo.toml
Downloaded fd-lock v3.0.6
Downloaded io-lifetimes v0.7.2
...
')

so it looks like it is downloading and building bits, but then it stops with this:
$this->bbcode_second_pass_code('', 'Compiling toml v0.5.9
error[E0658]: use of unstable library feature 'available_parallelism'
--> lib.rs:1018:13
|
1018 | std::thread::available_parallelism().map_or(1, std::num::NonZeroUsize::get) as u32
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #74479 <https://github.com/rust-lang/rust/issues/74479> for more information

error[E0658]: use of unstable library feature 'available_parallelism'
--> config.rs:1446:14
|
1446 | 0 => std::thread::available_parallelism().map_or(1, std::num::NonZeroUsize::get) as u32,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #74479 <https://github.com/rust-lang/rust/issues/74479> for more information

error[E0658]: use of unstable library feature 'available_parallelism'
--> flags.rs:223:13
|
223 | std::thread::available_parallelism().map_or(1, std::num::NonZeroUsize::get)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #74479 <https://github.com/rust-lang/rust/issues/74479> for more information

For more information about this error, try `rustc --explain E0658`.
error: could not compile `bootstrap` due to 3 previous errors
')

so, I cannot build rust as a package and even when I try to build it (not as a package), it still fails. I did a bit of digging and am stumped as to how to go further.

I am having another problem as well where any tests that are built as part of any package (it seems) complain that they cannot write to the directory and then refuse to run the tests

Any help appreciated.

Keith
keithspg
 
Posts: 224
Joined: Mon Feb 23, 2015 4:14 pm

Re: cannot build rust package for armv6

Postby robg » Fri Nov 11, 2022 12:12 pm

Still not sure why the default PKGBUILD won't build on armv6 (provided all dependencies are up to date). But in case, note that there are the packages
$this->bbcode_second_pass_code('', '$ pacman -Ss llvm | grep 13
extra/clang13 13.0.1-4
C language family frontend for LLVM 13
extra/lld13 13.0.1-1
extra/llvm13 13.0.1-3
Compiler infrastructure (LLVM 13)
extra/llvm13-libs 13.0.1-3
LLVM 13 runtime libraries')
where in particular llvm13-libs provides a proper /usr/lib/libLLVM-13.so (not just a symlink). If you have not already done so, perhaps try building and installing these packages first, and then rust.
robg
 
Posts: 194
Joined: Tue Jan 05, 2021 8:22 am

Re: cannot build rust package for armv6

Postby keithspg » Mon Nov 14, 2022 11:50 pm

Well, I tried that query and get this:
$this->bbcode_second_pass_code('', '$ pacman -Ss llvm | grep 13
extra/clang 13.0.0-4 [installed: 14.0.6-3]
extra/lld 13.0.0-1 [installed: 14.0.6-1]
extra/llvm 13.0.0-6 [installed]
extra/llvm-libs 13.0.0-6 [installed]
extra/llvm-ocaml 13.0.0-6
extra/openmp 13.0.0-1
extra/polly 13.0.0-1
community/libc++ 13.0.0-1
community/libc++abi 13.0.0-1
community/libc++experimental 13.0.0-1
community/spirv-llvm-translator 13.0.0-1
community/wasi-compiler-rt 13.0.0-1
community/wasi-libc++ 13.0.0-2
community/wasi-libc++abi 13.0.0-2
')

So I grabbed and installed the last armv6 versions of lld (13.0.0-1) and clang(13.0.0-4) and am trying it again. It takes a while, so we'll see how it goes.

update:

Same result:
$this->bbcode_second_pass_code('', '==> Starting build()...
Building rustbuild
error: failed to get `cc` as a dependency of package `bootstrap v0.0.0 (/Rune_dev/armv6/rust/src/rustc-1.65.0-src/src/bootstrap)`

Caused by:
failed to load source for dependency `cc`

Caused by:
Unable to update registry `crates-io`

Caused by:
failed to update replaced source registry `crates-io`

Caused by:
failed to parse manifest at `/Rune_dev/armv6/rust/src/rustc-1.65.0-src/vendor/libgit2-sys/Cargo.toml`

Caused by:
optional dependency features with `?` syntax are only allowed on the nightly channel and requires the `-Z weak-dep-features` flag on the command line
Feature `zlib-ng-compat` had feature value `libssh2-sys?/zlib-ng-compat`.
failed to run: /usr/bin/cargo build --manifest-path /Rune_dev/armv6/rust/src/rustc-1.65.0-src/src/bootstrap/Cargo.toml --locked --frozen
Build completed unsuccessfully in 0:00:03
==> ERROR: A failure occurred in build().
')
Thanks for the help!
keithspg
 
Posts: 224
Joined: Mon Feb 23, 2015 4:14 pm

Re: cannot build rust package for armv6

Postby keithspg » Tue Nov 15, 2022 1:10 pm

Well, I tried to build it under armv7 just to see and it builds fine:
$this->bbcode_second_pass_code('', 'Finished making: rust 1:1.65.0-1.1 (Mon 14 Nov 2022 11:54:48 PM CST)')

so there is something different on armv6. I wonder if it is that the version of rust that I am trying to build the current version of rust with is just too old. Maybe I should build an older version of rust from the arch arm packagefile git repo and see if it builds?

Keith
keithspg
 
Posts: 224
Joined: Mon Feb 23, 2015 4:14 pm

Re: cannot build rust package for armv6

Postby robg » Wed Nov 16, 2022 9:18 pm

If all rust dependencies (build and run) are installed and up-to-date on your armv6 and on your armv7 system, but rust only builds on the latter, then I am at a loss for now (e.g., Debian has a working rust package for armv6.)

$this->bbcode_second_pass_quote('keithspg', 'I') wonder if it is that the version of rust that I am trying to build the current version of rust with is just too old.

Possibly. Note that the error says
$this->bbcode_second_pass_code('', 'Caused by:
failed to parse manifest at `/Rune_dev/armv6/rust/src/rustc-1.65.0-src/vendor/libgit2-sys/Cargo.toml`

Caused by:
optional dependency features with `?` syntax are only allowed on the nightly channel and requires the `-Z weak-dep-features` flag on the command line
Feature `zlib-ng-compat` had feature value `libssh2-sys?/zlib-ng-compat`.')
And indeed, the rust docs state that the ? syntax is only available as of Rust 1.60.
robg
 
Posts: 194
Joined: Tue Jan 05, 2021 8:22 am

Re: cannot build rust package for armv6

Postby keithspg » Tue Dec 13, 2022 12:48 pm

I found a solution. I uninstalled rust and installed rustup from the archive then updated it. I was then able to build the 2 packages I was interested in for my project and will now build the latest rust and re-install the rust package for armv6.

$this->bbcode_second_pass_code('', '$ sudo pacman -U rustup-1.24.3-2-armv6h.pkg.tar.xz
$ rustup default stable
$ rustc -V
rustc 1.65.0 (897e37553 2022-11-02)')

Update: It still will not build the rust package. AFAICT, the binaries built w/o error when I used rustup to update then build, so unless there is a problem with the binaries, I will not be building the rust package...

Keith
keithspg
 
Posts: 224
Joined: Mon Feb 23, 2015 4:14 pm


Return to Packages

Who is online

Users browsing this forum: No registered users and 13 guests