Package Details: ty 0.0.1_alpha.3-1

Git Clone URL: https://aur.archlinux.org/ty.git (read-only, click to copy)
Package Base: ty
Description: An extremely fast Python type checker and language server, written in Rust.
Upstream URL: https://github.com/astral-sh/ty
Licenses: MIT
Submitter: alub
Maintainer: alub
Last Packager: alub
Votes: 2
Popularity: 1.85
First Submitted: 2025-05-08 07:47 (UTC)
Last Updated: 2025-05-16 11:22 (UTC)

Dependencies (7)

Required by (0)

Sources (1)

Latest Comments

gyscos commented on 2025-05-16 13:50 (UTC) (edited on 2025-05-16 13:57 (UTC) by gyscos)

Thanks! rust 1.87 is in testing, you can try building in a chroot with the testing repo enabled, I suspect it will fail for now (until llvm and clang get updated to 20 probably).

alub commented on 2025-05-16 11:30 (UTC)

Hello @gyscos, thanks for testing! I’ve included your change regarding the toolchain file, that seems reasonable. Note that I test the build in a chroot (https://wiki.archlinux.org/title/DeveloperWiki:Building_in_a_clean_chroot) so I install rust 1.86 from the repository, not with Rustup.

gyscos commented on 2025-05-15 20:22 (UTC) (edited on 2025-05-16 00:05 (UTC) by gyscos)

Hi, and thanks for maintaining this package!

I'm getting a bunch of similar compilation errors on the latest version:

error: linking with `clang` failed: exit status: 1
  |
  = note:  "clang" "-m64" "/tmp/rustcmjrLb9/symbols.o" "<6 object files omitted>" "-Wl,--as-needed" "-Wl,-Bstatic" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib/{libstd-*,libpanic_unwind-*,libobject-*,libmemchr-*,libaddr2line-*,libgimli-*,librustc_
demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,libcfg_if-*,liblibc-*,liballoc-*,librustc_std_workspace_core-*,libcore-*,libcompiler_builtins-*}.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-
lrt" "-lpthread" "-lm" "-ldl" "-lc" "-L" "/tmp/rustcmjrLb9/raw-dylibs" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-Wl,-plugin-opt=O0,-plugin-opt=mcpu=x86-64" "-L" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/run/user/60039/paru/clone/ty/sr
c/git/ruff/target/release/build/portable-atomic-218e7280e7e9c8cd/build_script_build-218e7280e7e9c8cd" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,--strip-debug" "-nodefaultlibs" "-fuse-ld=lld"
  = note: some arguments are omitted. use `--verbose` to show all linker arguments
  = note: ld.lld: error: /run/user/60039/paru/clone/ty/src/git/ruff/target/release/build/portable-atomic-218e7280e7e9c8cd/build_script_build-218e7280e7e9c8cd.build_script_build.10ec10f10cc06f1d-cgu.0.rcgu.o: Invalid record
          clang: error: linker command failed with exit code 1 (use -v to see invocation)


error: could not compile `portable-atomic` (build script) due to 1 previous error

This here is for portable-atomic, but there are dozens of similar errors for probably all the other dependencies being built.

Running simply python -m build --wheel works, so something might be off with the lto/linker options given in the PKGBUILD?

I do have the lto option enabled in my /etc/makepkg.conf. But if I disable it for this package with options=(!lto) it doesn't fix anything, so I guess it's not the problem.

EDIT: Looks like it fails to build if I have the latest stable (1.87) installed. It looks like the repo specifies 1.86 in its rust-toolchain.toml, maybe some versions are crossed somewhere?

EDIT2: The problem might be that rust-toolchain.toml is under the ruff directory, and is apparently ignored. If I copy it in the parent directory, where python -m build --wheel is run, it looks like it works fine. It problably should be fixed upstream, but in the meantime this diff works for me:

diff --git a/PKGBUILD b/PKGBUILD
index b8c278d..5f9fb01 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -27,6 +27,7 @@ prepare() {

 build() {
   cd "${srcdir}/git"
+  cp ruff/rust-toolchain.toml .
   CC=clang RUSTFLAGS+=" -Clinker-plugin-lto -Clinker=clang -Clink-arg=-fuse-ld=lld" \
     python -m build --wheel
 }

Note: it's now beyond the scope of this, but if I update these rust-toolchain.toml to use 1.87, it fails with a different error:

error: linking with `clang` failed: exit status: 1
  |
  = note:  "clang" "-m64" "/tmp/rustcBZJ1Ed/symbols.o" "<3 object files omitted>" "-Wl,--as-needed" "-Wl,-Bstatic" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib/{libstd-*,libpanic_unwind-*,libobject-*,libmemchr-*,libaddr2line-*,libgimli-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,libcfg_if-*,liblibc-*,liballoc-*,librustc_std_workspace_core-*,libcore-*,libcompiler_builtins-*}.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-L" "/tmp/rustcBZJ1Ed/raw-dylibs" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-Wl,-plugin-opt=O0,-plugin-opt=mcpu=x86-64" "-L" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/run/user/60039/paru/clone/ty/src/git/ruff/target/release/build/rustversion-676042f75fc38a3f/build_script_build-676042f75fc38a3f" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,--strip-debug" "-nodefaultlibs" "-fuse-ld=lld"
  = note: some arguments are omitted. use `--verbose` to show all linker arguments
  = note: ld.lld: error: Invalid summary version 12. Version should be in the range [1-10].
          ld.lld: error: Invalid summary version 12. Version should be in the range [1-10].
          ld.lld: error: Invalid summary version 12. Version should be in the range [1-10].
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

Might be related to rust 1.87 bumping LLVM to 20, while clang and llvm are still at version 19 in the official arch packages.

rockerBOO commented on 2025-05-09 22:08 (UTC) (edited on 2025-05-09 22:28 (UTC) by rockerBOO)

The python build is not using the system python but the terminal python. So if you have a venv enabled it will try to use that to build with.

==> Starting build()...
***/.venv/bin/python: No module named build

Also requires rust 1.84 and doesn't support rust 1.82

 rustc 1.82.0 is not supported by the following packages:
  ruff_annotate_snippets@0.1.0 requires rustc 1.84
... (29 other packages)