diff --git a/README.md b/README.md index 6a490e1..02004b0 100644 --- a/README.md +++ b/README.md @@ -57,8 +57,3 @@ Testing /dev/tenstorrent/1 @ 0000:76:00.0 ``` As far as I can tell, these failures are exercised by the tests, and a clean `stdout` means there is no issue. - - -# TODO - -- [ ] Better update system diff --git a/docker/nix/default.nix b/docker/nix/default.nix new file mode 100644 index 0000000..d5a44fd --- /dev/null +++ b/docker/nix/default.nix @@ -0,0 +1,68 @@ +{ dockerTools +, bashInteractive +, cacert +, coreutils +, curl +, gitReallyMinimal +, gnutar +, gzip +, iana-etc +, nix +, openssh +, xz +, fromImage +, extraContents ? [ ] +, extraEnv ? [ ] +}: +let + image = dockerTools.buildImageWithNixDb { + inherit (nix) name; + inherit fromImage; + + contents = [ + ./root + coreutils + # add /bin/sh + bashInteractive + nix + + # runtime dependencies of nix + cacert + gitReallyMinimal + gnutar + gzip + openssh + xz + + # for haskell binaries + iana-etc + ] ++ extraContents; + + extraCommands = '' + # for /usr/bin/env + mkdir usr + ln -s ../bin usr/bin + + # make sure /tmp exists + mkdir -m 1777 tmp + + # need a HOME + mkdir -vp root + ''; + + config = { + Cmd = [ "/bin/bash" ]; + Env = [ + "ENV=/etc/profile.d/nix.sh" + "BASH_ENV=/etc/profile.d/nix.sh" + "NIX_BUILD_SHELL=/bin/bash" + "NIX_PATH=nixpkgs=${./fake_nixpkgs}" + "PAGER=cat" + "PATH=/usr/bin:/bin" + "SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt" + "USER=root" + ] ++ extraEnv; + }; + }; +in +image // { meta = nix.meta // image.meta; } diff --git a/docker/nix/fake_nixpkgs/default.nix b/docker/nix/fake_nixpkgs/default.nix new file mode 100644 index 0000000..eee7aac --- /dev/null +++ b/docker/nix/fake_nixpkgs/default.nix @@ -0,0 +1,10 @@ +_: +throw '' + This container doesn't include nixpkgs. + + The best way to work around that is to pin your dependencies. See + https://nix.dev/tutorials/first-steps/towards-reproducibility-pinning-nixpkgs.html + + Or if you must, override the NIX_PATH environment variable with eg: + "NIX_PATH=nixpkgs=channel:nixos-unstable" +'' diff --git a/docker/nix/root/etc/group b/docker/nix/root/etc/group new file mode 100644 index 0000000..162f79f --- /dev/null +++ b/docker/nix/root/etc/group @@ -0,0 +1,21 @@ +root:x:0: +wheel:x:1: +kmem:x:2: +tty:x:3: +messagebus:x:4: +disk:x:6: +audio:x:17: +floppy:x:18: +uucp:x:19: +lp:x:20: +cdrom:x:24: +tape:x:25: +video:x:26: +dialout:x:27: +utmp:x:29: +adm:x:55: +keys:x:96: +users:x:100: +input:x:174: +nixbld:x:30000:nixbld1,nixbld10,nixbld11,nixbld12,nixbld13,nixbld14,nixbld15,nixbld16,nixbld17,nixbld18,nixbld19,nixbld2,nixbld20,nixbld21,nixbld22,nixbld23,nixbld24,nixbld25,nixbld26,nixbld27,nixbld28,nixbld29,nixbld3,nixbld30,nixbld31,nixbld32,nixbld4,nixbld5,nixbld6,nixbld7,nixbld8,nixbld9 +nogroup:x:65534: diff --git a/docker/nix/root/etc/nsswitch.conf b/docker/nix/root/etc/nsswitch.conf new file mode 100644 index 0000000..59a2141 --- /dev/null +++ b/docker/nix/root/etc/nsswitch.conf @@ -0,0 +1,11 @@ +passwd: files mymachines systemd +group: files mymachines systemd +shadow: files + +hosts: files mymachines dns myhostname +networks: files + +ethers: files +services: files +protocols: files +rpc: files diff --git a/docker/nix/root/etc/passwd b/docker/nix/root/etc/passwd new file mode 100644 index 0000000..006b53f --- /dev/null +++ b/docker/nix/root/etc/passwd @@ -0,0 +1,34 @@ +root:x:0:0:System administrator:/root:/bin/bash +nixbld1:x:30001:30000:Nix build user 1:/var/empty:/run/current-system/sw/bin/nologin +nixbld2:x:30002:30000:Nix build user 2:/var/empty:/run/current-system/sw/bin/nologin +nixbld3:x:30003:30000:Nix build user 3:/var/empty:/run/current-system/sw/bin/nologin +nixbld4:x:30004:30000:Nix build user 4:/var/empty:/run/current-system/sw/bin/nologin +nixbld5:x:30005:30000:Nix build user 5:/var/empty:/run/current-system/sw/bin/nologin +nixbld6:x:30006:30000:Nix build user 6:/var/empty:/run/current-system/sw/bin/nologin +nixbld7:x:30007:30000:Nix build user 7:/var/empty:/run/current-system/sw/bin/nologin +nixbld8:x:30008:30000:Nix build user 8:/var/empty:/run/current-system/sw/bin/nologin +nixbld9:x:30009:30000:Nix build user 9:/var/empty:/run/current-system/sw/bin/nologin +nixbld10:x:30010:30000:Nix build user 10:/var/empty:/run/current-system/sw/bin/nologin +nixbld11:x:30011:30000:Nix build user 11:/var/empty:/run/current-system/sw/bin/nologin +nixbld12:x:30012:30000:Nix build user 12:/var/empty:/run/current-system/sw/bin/nologin +nixbld13:x:30013:30000:Nix build user 13:/var/empty:/run/current-system/sw/bin/nologin +nixbld14:x:30014:30000:Nix build user 14:/var/empty:/run/current-system/sw/bin/nologin +nixbld15:x:30015:30000:Nix build user 15:/var/empty:/run/current-system/sw/bin/nologin +nixbld16:x:30016:30000:Nix build user 16:/var/empty:/run/current-system/sw/bin/nologin +nixbld17:x:30017:30000:Nix build user 17:/var/empty:/run/current-system/sw/bin/nologin +nixbld18:x:30018:30000:Nix build user 18:/var/empty:/run/current-system/sw/bin/nologin +nixbld19:x:30019:30000:Nix build user 19:/var/empty:/run/current-system/sw/bin/nologin +nixbld20:x:30020:30000:Nix build user 20:/var/empty:/run/current-system/sw/bin/nologin +nixbld21:x:30021:30000:Nix build user 21:/var/empty:/run/current-system/sw/bin/nologin +nixbld22:x:30022:30000:Nix build user 22:/var/empty:/run/current-system/sw/bin/nologin +nixbld23:x:30023:30000:Nix build user 23:/var/empty:/run/current-system/sw/bin/nologin +nixbld24:x:30024:30000:Nix build user 24:/var/empty:/run/current-system/sw/bin/nologin +nixbld25:x:30025:30000:Nix build user 25:/var/empty:/run/current-system/sw/bin/nologin +nixbld26:x:30026:30000:Nix build user 26:/var/empty:/run/current-system/sw/bin/nologin +nixbld27:x:30027:30000:Nix build user 27:/var/empty:/run/current-system/sw/bin/nologin +nixbld28:x:30028:30000:Nix build user 28:/var/empty:/run/current-system/sw/bin/nologin +nixbld29:x:30029:30000:Nix build user 29:/var/empty:/run/current-system/sw/bin/nologin +nixbld30:x:30030:30000:Nix build user 30:/var/empty:/run/current-system/sw/bin/nologin +nixbld31:x:30031:30000:Nix build user 31:/var/empty:/run/current-system/sw/bin/nologin +nixbld32:x:30032:30000:Nix build user 32:/var/empty:/run/current-system/sw/bin/nologin +nobody:x:65534:65534:Unprivileged account (don't use!):/var/empty:/run/current-system/sw/bin/nologin diff --git a/flake.lock b/flake.lock index 2f764f9..d6a0883 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1733328505, - "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", "owner": "edolstra", "repo": "flake-compat", - "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", "type": "github" }, "original": { @@ -18,11 +18,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1734649271, - "narHash": "sha256-4EVBRhOjMDuGtMaofAIqzJbg4Ql7Ai0PSeuVZTHjyKQ=", + "lastModified": 1730200266, + "narHash": "sha256-l253w0XMT8nWHGXuXqyiIC/bMvh1VRszGXgdpQlfhvU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d70bd19e0a38ad4790d3913bf08fcbfc9eeca507", + "rev": "807e9154dcb16384b1b765ebe9cd2bba2ac287fd", "type": "github" }, "original": { @@ -59,11 +59,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 19937ab..24f25bf 100644 --- a/flake.nix +++ b/flake.nix @@ -31,14 +31,21 @@ { kmd = callPackages ./pkgs/kmd { inherit kernel; }; sfpi = callPackages ./pkgs/sfpi { }; - luwen = (callPackage ./pkgs/luwen { }).luwen; - pyluwen = (callPackage ./pkgs/luwen { }).pyluwen; + luwen = callPackage ./pkgs/luwen { }; tools-common = callPackage ./pkgs/tools-common { }; system-tools = callPackage ./pkgs/system-tools { }; - flash = callPackage ./pkgs/flash { }; - smi = callPackage ./pkgs/smi { }; + flash = callPackage ./pkgs/flash { + pyluwen = self.luwen.pyluwen_0_1; + }; + smi = callPackage ./pkgs/smi { + pyluwen = self.luwen.pyluwen; + }; umd = callPackage ./pkgs/umd { }; metal = callPackage ./pkgs/metal { }; + buda-docker = callPackage ./pkgs/buda-docker { }; + # Will be difficult to get these 2 working and keep them working + buda-prebuilt = callPackage ./pkgs/buda-prebuilt { }; + buda = callPackage ./pkgs/buda { }; } ); @@ -49,16 +56,18 @@ udev-rules = scope.kmd.udev-rules; kmd-test = scope.kmd.test; sfpi = scope.sfpi.sfpi; - sfpi-prebuilt = scope.sfpi.prebuilt; tt-gcc = scope.sfpi.tt-gcc; smi = scope.smi; - luwen = scope.luwen; - pyluwen = scope.pyluwen; + luwen = scope.luwen.luwen; + pyluwen = scope.luwen.pyluwen; tools-common = scope.tools-common; system-tools = scope.system-tools; flash = scope.flash; umd = scope.umd; metal = scope.metal; + buda-docker = scope.buda-docker; + buda-prebuilt = scope.buda-prebuilt; + buda = scope.buda; default = self.packages.${system}.smi; }; @@ -92,45 +101,17 @@ }) ]; kernelParams = [ + # TODO: Use the scripts instead https://github.com/tenstorrent/tt-system-tools they work regardless of how many devices there are + # https://github.com/tenstorrent/tt-system-tools/blob/main/hugepages-setup.sh#L31 + "hugepagesz=1G" + "hugepages=4" "iommu=pt" ]; kernelModules = [ "tenstorrent" ]; }; - systemd = { - # https://github.com/NixOS/nixpkgs/issues/81138 - services.tenstorrent-hugepages.wantedBy = [ "sysinit.target" ]; - # Define https://github.com/tenstorrent/tt-system-tools/blob/29ba4dc6049eef3cee4314c53720417823ffc667/dev-hugepages%5Cx2d1G.mount - # because it has bad start ordering relations with tenstorrent-hugepages.service - # or it may be that the `wantedBy` does not work correctly in mounts like it does't work in serices. - mounts = [ - { - description = "Mount hugepages at /dev/hugepages-1G for Tenstorrent ASICs"; - what = "hugetlbfs"; - where = "/dev/hugepages-1G"; - type = "hugetlbfs"; - options = "pagesize=1G,mode=0777,nosuid,nodev"; - wantedBy = [ "sysinit.target" ]; - after = [ "tenstorrent-hugepages.service" ]; - unitConfig = { - DefaultDependencies = false; - ConditionPathExists = "/sys/kernel/mm/hugepages/hugepages-1048576kB"; - ConditionCapability = "CAP_SYS_ADMIN"; - }; - } - ]; - packages = [ - (pkgs.tt-system-tools or self.packages.${pkgs.hostPlatform.system}.system-tools) - ]; - }; - services.udev = { - packages = [ (pkgs.tt-udev-rules or self.packages.${pkgs.hostPlatform.system}.udev-rules) ]; - # NOTE: passing just the group does not work currently for docker so unneeded for now so use the udev-rules package for now - # TT_METAL_HOME=$PWD docker run -v $PWD:/host --workdir /host -v /dev/hugepages-1G:/dev/hugepages-1G -v /dev/tenstorrent:/dev/tenstorrent -u :994 -v /etc/group:/etc/group:ro -it tt-metal bash - # extraRules = '' - # KERNEL=="tenstorrent*", MODE="0666", OWNER="root", GROUP="tenstorrent" - # ''; - }; - # users.groups.tenstorrent = { }; + services.udev.packages = [ + (pkgs.tt-udev-rules or self.packages.${pkgs.hostPlatform.system}.udev-rules) + ]; }; }; diff --git a/pkgs/buda-docker/default.nix b/pkgs/buda-docker/default.nix new file mode 100644 index 0000000..95af17a --- /dev/null +++ b/pkgs/buda-docker/default.nix @@ -0,0 +1,41 @@ +{ + dockerTools, + callPackage, + git, +}: + +let + budaDocker = dockerTools.pullImage { + imageName = "ghcr.io/tenstorrent/tt-buda/ubuntu-22-04-amd64/wh_b0"; + imageDigest = "sha256:3a6f84ed355c8738432737f6498745c4bee235b871e97608394e29e396ff6925"; + sha256 = "1vx7v9yx211dibshzgzz9zwm9xgkfj25iabplff19hx687w0n3sz"; + finalImageName = "ghcr.io/tenstorrent/tt-buda/ubuntu-22-04-amd64/wh_b0"; + finalImageTag = "v0.19.3"; + }; + + #nixDocker = dockerTools.pullImage { + # imageName = "nixpkgs/nix-flakes"; + # imageDigest = "sha256:cab18b64d25e4bc30415758d6e2f6bc05ecf6ae576092c0cf407b1cebb1ea0e5"; + # sha256 = "0v4npm2h4z0k3y0h75zsk3q589vhris76g4vg5gkjlfbg16c822j"; + # finalImageName = "nixpkgs/nix-flakes"; + # finalImageTag = "latest"; + #}; + + nixDocker = callPackage ../../docker/nix/default.nix { + fromImage = budaDocker; + + # gitMinimal still ships with perl and python + gitReallyMinimal = + (git.override { + perlSupport = false; + pythonSupport = false; + withManual = false; + withpcre2 = false; + }).overrideAttrs + (_: { + # installCheck is broken when perl is disabled + doInstallCheck = false; + }); + }; +in +budaDocker diff --git a/pkgs/buda-prebuilt/default.nix b/pkgs/buda-prebuilt/default.nix new file mode 100644 index 0000000..4d4eb93 --- /dev/null +++ b/pkgs/buda-prebuilt/default.nix @@ -0,0 +1,181 @@ +{ + lib, + python310Packages, + fetchzip, + stdenv, + callPackage, + __splicedPackages, + darwin, + runCommand, +}: + +let + python3Packages = python310Packages; + pkgs = __splicedPackages; + + boost_1_74 = (callPackage ./vendored/boost/default.nix { }).boost174; + yaml-cpp_0_6 = callPackage ./vendored/libyaml-cpp.nix { }; + + prebuilt-buda = fetchzip { + url = "https://github.com/tenstorrent/tt-buda/releases/download/v0.19.3/pybuda-wh.b0-v0.19.3-ubuntu-22-04-amd64-python3.10.zip"; + hash = "sha256-M9sgFKSmWra+BglEWgrfFPJRS+UIVKUG+ZF1oTPVexg="; + stripRoot = false; + }; + + pipInstallHook' = python3Packages.callPackage ( + { makePythonHook, pip }: + makePythonHook { + name = "pip-install-hook"; + propagatedBuildInputs = [ pip ]; + substitutions = { + pythonInterpreter = python3Packages.python.interpreter; + pythonSitePackages = python3Packages.python.sitePackages; + }; + } ./vendored/pip-install-hook.sh + ) { }; + + nukeReferences = callPackage ./vendored/nuke-references.nix { + inherit (darwin) signingUtils; + }; + + autoPatchelfHook = callPackage ( + { makeSetupHook, bintools }: + makeSetupHook { + name = "auto-patchelf-hook"; + propagatedBuildInputs = [ + bintools + ]; + substitutions = { + pythonInterpreter = "${python3Packages.python.withPackages (ps: [ ps.pyelftools ])}/bin/python"; + autoPatchelfScript = ./vendored/auto-patchelf.py; + }; + } ./auto-patchelf.sh + ) { }; + + tt-buda = stdenv.mkDerivation rec { + pname = "tt-buda"; + version = "0.19.3"; + format = "wheel"; + + src = prebuilt-buda; + + nativeBuildInputs = [ + pipInstallHook' + nukeReferences + ]; + + preInstall = '' + mkdir dist + mv *.whl dist/ + ''; + + postInstall = '' + find $out -name "__pycache__" -type d | xargs rm -rf + + find $out/bin/ -type f -not -name 'debuda' -print0 | xargs -0 rm -- + substituteInPlace $out/bin/debuda \ + --replace-fail "${python3Packages.python.interpreter}" "/usr/bin/env python3" + + # error: illegal path references in fixed-output derivation + find $out -print0 | xargs -0 nuke-refs + + ''; + + dontPatchShebangs = true; + dontFixup = true; + + outputHash = "sha256-eSU10kgIQzJ0kv6gmQwMCdVw0uBpohVyYqkjK4RU2ng="; + outputHashAlgo = "sha256"; + outputHashMode = "recursive"; + + meta = { + description = "Tenstorrent TT-BUDA Repository"; + homepage = "https://github.com/tenstorrent/tt-buda"; + license = lib.licenses.asl20; + mainProgram = "tt-buda"; + }; + }; + + tt-buda-final = python3Packages.toPythonModule ( + stdenv.mkDerivation (finalAttrs: { + pname = "tt-buda-final"; + inherit (tt-buda) version; + + nativeBuildInputs = [ + autoPatchelfHook + python3Packages.pythonImportsCheckHook + ]; + + buildInputs = + with pkgs; + [ + stdenv.cc.libc.libgcc + stdenv.cc.libc.libgcc.lib + libpng + python3Packages.python + ncurses + expat + hwloc + zeromq + libjpeg8 + glib + libGL + boost_1_74 + yaml-cpp_0_6 + ] + ++ (with pkgs.xorg; [ + libxcb + libXext + libX11 + libSM + libICE + ]); + + #runtimeDependencies = [ + # # from torch._C import * # noqa: F403 + # # ImportError: libstdc++.so.6: cannot open shared object file: No such file or directory + # stdenv.cc.libc.libgcc.lib + + #]; + + #pythonImportsCheck = [ + # "pybuda" + # "torch" + #]; + + passthru = { + inherit tt-buda yaml-cpp_0_6 boost_1_74; + pythonWith = python3Packages.python.withPackages (ps: [ finalAttrs.finalPackage ]); + + tests = { + integrationTest = + runCommand "tt-buda-tests-integration-test" + { + strictDeps = true; + nativeBuildInputs = [ + finalAttrs.passthru.pythonWith + stdenv.cc.libc.libgcc.lib + ]; + LD_LIBRARY_PATH = lib.makeLibraryPath [ stdenv.cc.libc.libgcc.lib ]; + } + '' + export HOME=$(mktemp -d) + python3 "${./test.py}" + touch "$out" + ''; + }; + }; + + dontUnpack = true; + installPhase = '' + runHook preInstall + mkdir -p $out + cp -r ${tt-buda}/* $out + runHook postInstall + + + ''; + }) + ); +in +tt-buda-final diff --git a/pkgs/buda-prebuilt/test.py b/pkgs/buda-prebuilt/test.py new file mode 100644 index 0000000..98bedff --- /dev/null +++ b/pkgs/buda-prebuilt/test.py @@ -0,0 +1,26 @@ +import pybuda +import torch + + +# Sample PyTorch module +class PyTorchTestModule(torch.nn.Module): + def __init__(self): + super().__init__() + self.weights1 = torch.nn.Parameter(torch.rand(32, 32), requires_grad=True) + self.weights2 = torch.nn.Parameter(torch.rand(32, 32), requires_grad=True) + def forward(self, act1, act2): + m1 = torch.matmul(act1, self.weights1) + m2 = torch.matmul(act2, self.weights2) + return m1 + m2, m1 + + +def test_module_direct_pytorch(): + input1 = torch.rand(4, 32, 32) + input2 = torch.rand(4, 32, 32) + # Run single inference pass on a PyTorch module, using a wrapper to convert to PyBUDA first + output = pybuda.PyTorchModule("direct_pt", PyTorchTestModule()).run(input1, input2) + print(output) + + +if __name__ == "__main__": + test_module_direct_pytorch() diff --git a/pkgs/buda-prebuilt/vendored/auto-patchelf.py b/pkgs/buda-prebuilt/vendored/auto-patchelf.py new file mode 100644 index 0000000..eca3007 --- /dev/null +++ b/pkgs/buda-prebuilt/vendored/auto-patchelf.py @@ -0,0 +1,439 @@ +#!/usr/bin/env python3 + +import argparse +import os +import pprint +import subprocess +import sys +import json +from fnmatch import fnmatch +from collections import defaultdict +from contextlib import contextmanager +from dataclasses import dataclass +from itertools import chain +from pathlib import Path, PurePath +from typing import DefaultDict, Generator, Iterator, Optional + +from elftools.common.exceptions import ELFError # type: ignore +from elftools.elf.dynamic import DynamicSection # type: ignore +from elftools.elf.sections import NoteSection # type: ignore +from elftools.elf.elffile import ELFFile # type: ignore +from elftools.elf.enums import ENUM_E_TYPE, ENUM_EI_OSABI # type: ignore + + +@contextmanager +def open_elf(path: Path) -> Iterator[ELFFile]: + with path.open('rb') as stream: + yield ELFFile(stream) + + +def is_static_executable(elf: ELFFile) -> bool: + # Statically linked executables have an ELF type of EXEC but no INTERP. + return (elf.header["e_type"] == 'ET_EXEC' + and not elf.get_section_by_name(".interp")) + + +def is_dynamic_executable(elf: ELFFile) -> bool: + # We do not require an ELF type of EXEC. This also catches + # position-independent executables, as they typically have an INTERP + # section but their ELF type is DYN. + return bool(elf.get_section_by_name(".interp")) + + +def get_dependencies(elf: ELFFile) -> list[list[Path]]: + dependencies = [] + # This convoluted code is here on purpose. For some reason, using + # elf.get_section_by_name(".dynamic") does not always return an + # instance of DynamicSection, but that is required to call iter_tags + for section in elf.iter_sections(): + if isinstance(section, DynamicSection): + for tag in section.iter_tags('DT_NEEDED'): + dependencies.append([Path(tag.needed)]) + break # There is only one dynamic section + + return dependencies + + +def get_dlopen_dependencies(elf: ELFFile) -> list[list[Path]]: + """ + Extracts dependencies from the `.note.dlopen` section. + This is a FreeDesktop standard to annotate binaries with libraries that it may `dlopen`. + See https://systemd.io/ELF_DLOPEN_METADATA/ + """ + dependencies = [] + for section in elf.iter_sections(): + if not isinstance(section, NoteSection) or section.name != ".note.dlopen": + continue + for note in section.iter_notes(): + if note["n_type"] != 0x407C0C0A or note["n_name"] != "FDO": + continue + note_desc = note["n_desc"] + text = note_desc.decode("utf-8").rstrip("\0") + j = json.loads(text) + for d in j: + dependencies.append([Path(soname) for soname in d["soname"]]) + return dependencies + + +def get_rpath(elf: ELFFile) -> list[str]: + # This convoluted code is here on purpose. For some reason, using + # elf.get_section_by_name(".dynamic") does not always return an + # instance of DynamicSection, but that is required to call iter_tags + for section in elf.iter_sections(): + if isinstance(section, DynamicSection): + for tag in section.iter_tags('DT_RUNPATH'): + return tag.runpath.split(':') + + for tag in section.iter_tags('DT_RPATH'): + return tag.rpath.split(':') + + break # There is only one dynamic section + + return [] + + +def get_arch(elf: ELFFile) -> str: + return elf.get_machine_arch() + + +def get_osabi(elf: ELFFile) -> str: + return elf.header["e_ident"]["EI_OSABI"] + + +def osabi_are_compatible(wanted: str, got: str) -> bool: + """ + Tests whether two OS ABIs are compatible, taking into account the + generally accepted compatibility of SVR4 ABI with other ABIs. + """ + if not wanted or not got: + # One of the types couldn't be detected, so as a fallback we'll + # assume they're compatible. + return True + + # Generally speaking, the base ABI (0x00), which is represented by + # readelf(1) as "UNIX - System V", indicates broad compatibility + # with other ABIs. + # + # TODO: This isn't always true. For example, some OSes embed ABI + # compatibility into SHT_NOTE sections like .note.tag and + # .note.ABI-tag. It would be prudent to add these to the detection + # logic to produce better ABI information. + if wanted == 'ELFOSABI_SYSV': + return True + + # Similarly here, we should be able to link against a superset of + # features, so even if the target has another ABI, this should be + # fine. + if got == 'ELFOSABI_SYSV': + return True + + # Otherwise, we simply return whether the ABIs are identical. + return wanted == got + + +def glob(path: Path, pattern: str, recursive: bool) -> Iterator[Path]: + if path.is_dir(): + return path.rglob(pattern) if recursive else path.glob(pattern) + else: + # path.glob won't return anything if the path is not a directory. + # We extend that behavior by matching the file name against the pattern. + # This allows to pass single files instead of dirs to auto_patchelf, + # for greater control on the files to consider. + return [path] if path.match(pattern) else [] + + +cached_paths: set[Path] = set() +soname_cache: DefaultDict[tuple[str, str], list[tuple[Path, str]]] = defaultdict(list) + + +def populate_cache(initial: list[Path], recursive: bool =False) -> None: + lib_dirs = list(initial) + + while lib_dirs: + lib_dir = lib_dirs.pop(0) + + if lib_dir in cached_paths: + continue + + cached_paths.add(lib_dir) + + for path in glob(lib_dir, "*.so*", recursive): + if not path.is_file(): + continue + + # As an optimisation, resolve the symlinks here, as the target is unique + # XXX: (layus, 2022-07-25) is this really an optimisation in all cases ? + # It could make the rpath bigger or break the fragile precedence of $out. + resolved = path.resolve() + # Do not use resolved paths when names do not match + if resolved.name != path.name: + resolved = path + + try: + with open_elf(path) as elf: + osabi = get_osabi(elf) + arch = get_arch(elf) + rpath = [Path(p) for p in get_rpath(elf) + if p and '$ORIGIN' not in p] + lib_dirs += rpath + soname_cache[(path.name, arch)].append((resolved.parent, osabi)) + + except ELFError: + # Not an ELF file in the right format + pass + + +def find_dependency(soname: str, soarch: str, soabi: str) -> Optional[Path]: + for lib, libabi in soname_cache[(soname, soarch)]: + if osabi_are_compatible(soabi, libabi): + return lib + return None + + +@dataclass +class Dependency: + file: Path # The file that contains the dependency + name: Path # The name of the dependency + found: bool = False # Whether it was found somewhere + + +def auto_patchelf_file(path: Path, runtime_deps: list[Path], append_rpaths: list[Path] = [], keep_libc: bool = False, extra_args: list[str] = []) -> list[Dependency]: + try: + with open_elf(path) as elf: + + if is_static_executable(elf): + # No point patching these + print(f"skipping {path} because it is statically linked") + return [] + + if elf.num_segments() == 0: + # no segment (e.g. object file) + print(f"skipping {path} because it contains no segment") + return [] + + file_arch = get_arch(elf) + if interpreter_arch != file_arch: + # Our target architecture is different than this file's + # architecture, so skip it. + print(f"skipping {path} because its architecture ({file_arch})" + f" differs from target ({interpreter_arch})") + return [] + + file_osabi = get_osabi(elf) + if not osabi_are_compatible(interpreter_osabi, file_osabi): + print(f"skipping {path} because its OS ABI ({file_osabi}) is" + f" not compatible with target ({interpreter_osabi})") + return [] + + file_is_dynamic_executable = is_dynamic_executable(elf) + + file_dependencies = get_dependencies(elf) + get_dlopen_dependencies(elf) + + except ELFError: + return [] + + rpath = [] + if file_is_dynamic_executable: + print("setting interpreter of", path) + subprocess.run( + ["patchelf", "--set-interpreter", interpreter_path.as_posix(), path.as_posix()] + extra_args, + check=True) + rpath += runtime_deps + + print("searching for dependencies of", path) + dependencies = [] + # Be sure to get the output of all missing dependencies instead of + # failing at the first one, because it's more useful when working + # on a new package where you don't yet know the dependencies. + for dep in file_dependencies: + was_found = False + for candidate in dep: + + # This loop determines which candidate for a given + # dependency can be found, and how. There may be multiple + # candidates for a dep because of '.note.dlopen' + # dependencies. + # + # 1. If a candidate is an absolute path, it is already a + # valid dependency if that path exists, and nothing needs + # to be done. It should be an error if that path does not exist. + # 2. If a candidate is found within libc, it should be dropped + # and resolved automatically by the dynamic linker, unless + # keep_libc is enabled. + # 3. If a candidate is found in our library dependencies, that + # dependency should be added to rpath. + # 4. If all of the above fail, libc dependencies should still be + # considered found. This is in contrast to step 2, because + # enabling keep_libc should allow libc to be found in step 3 + # if possible to preserve its presence in rpath. + # + # These conditions are checked in this order, because #2 + # and #3 may both be true. In that case, we still want to + # add the dependency to rpath, as the original binary + # presumably had it and this should be preserved. + + is_libc = (libc_lib / candidate).is_file() + + if candidate.is_absolute() and candidate.is_file(): + was_found = True + break + elif is_libc and not keep_libc: + was_found = True + break + elif found_dependency := find_dependency(candidate.name, file_arch, file_osabi): + rpath.append(found_dependency) + dependencies.append(Dependency(path, candidate, found=True)) + print(f" {candidate} -> found: {found_dependency}") + was_found = True + break + elif is_libc and keep_libc: + was_found = True + break + + if not was_found: + dep_name = dep[0] if len(dep) == 1 else f"any({', '.join(map(str, dep))})" + dependencies.append(Dependency(path, dep_name, found=False)) + print(f" {dep_name} -> not found!") + + rpath.extend(append_rpaths) + + # Dedup the rpath + rpath_str = ":".join(dict.fromkeys(map(Path.as_posix, rpath))) + + if rpath: + print("setting RPATH to:", rpath_str) + subprocess.run( + ["patchelf", "--set-rpath", rpath_str, path.as_posix()] + extra_args, + check=True) + + return dependencies + + +def auto_patchelf( + paths_to_patch: list[Path], + lib_dirs: list[Path], + runtime_deps: list[Path], + recursive: bool = True, + ignore_missing: list[str] = [], + append_rpaths: list[Path] = [], + keep_libc: bool = False, + extra_args: list[str] = []) -> None: + + if not paths_to_patch: + sys.exit("No paths to patch, stopping.") + + # Add all shared objects of the current output path to the cache, + # before lib_dirs, so that they are chosen first in find_dependency. + populate_cache(paths_to_patch, recursive) + populate_cache(lib_dirs) + + dependencies = [] + for path in chain.from_iterable(glob(p, '*', recursive) for p in paths_to_patch): + if not path.is_symlink() and path.is_file(): + dependencies += auto_patchelf_file(path, runtime_deps, append_rpaths, keep_libc, extra_args) + + missing = [dep for dep in dependencies if not dep.found] + + # Print a summary of the missing dependencies at the end + print(f"auto-patchelf: {len(missing)} dependencies could not be satisfied") + failure = False + for dep in missing: + for pattern in ignore_missing: + if fnmatch(dep.name.name, pattern): + print(f"warn: auto-patchelf ignoring missing {dep.name} wanted by {dep.file}") + break + else: + print(f"error: auto-patchelf could not satisfy dependency {dep.name} wanted by {dep.file}") + failure = True + + if failure: + sys.exit('auto-patchelf failed to find all the required dependencies.\n' + 'Add the missing dependencies to --libs or use ' + '`--ignore-missing="foo.so.1 bar.so etc.so"`.') + + +def main() -> None: + parser = argparse.ArgumentParser( + prog="auto-patchelf", + description='auto-patchelf tries as hard as possible to patch the' + ' provided binary files by looking for compatible' + 'libraries in the provided paths.') + parser.add_argument( + "--ignore-missing", + nargs="*", + type=str, + help="Do not fail when some dependencies are not found.") + parser.add_argument( + "--no-recurse", + dest="recursive", + action="store_false", + help="Disable the recursive traversal of paths to patch.") + parser.add_argument( + "--paths", nargs="*", type=Path, + help="Paths whose content needs to be patched." + " Single files and directories are accepted." + " Directories are traversed recursively by default.") + parser.add_argument( + "--libs", nargs="*", type=Path, + help="Paths where libraries are searched for." + " Single files and directories are accepted." + " Directories are not searched recursively.") + parser.add_argument( + "--runtime-dependencies", nargs="*", type=Path, + help="Paths to prepend to the runtime path of executable binaries." + " Subject to deduplication, which may imply some reordering.") + parser.add_argument( + "--append-rpaths", + nargs="*", + type=Path, + help="Paths to append to all runtime paths unconditionally", + ) + parser.add_argument( + "--keep-libc", + dest="keep_libc", + action="store_true", + help="Attempt to search for and relink libc dependencies.", + ) + parser.add_argument( + "--extra-args", + # Undocumented Python argparse feature: consume all remaining arguments + # as values for this one. This means this argument should always be passed + # last. + nargs="...", + type=str, + help="Extra arguments to pass to patchelf. This argument should always come last." + ) + + print("automatically fixing dependencies for ELF files") + args = parser.parse_args() + pprint.pprint(vars(args)) + + auto_patchelf( + args.paths, + args.libs, + args.runtime_dependencies, + args.recursive, + args.ignore_missing, + append_rpaths=args.append_rpaths, + keep_libc=args.keep_libc, + extra_args=args.extra_args) + + +interpreter_path: Path = None # type: ignore +interpreter_osabi: str = None # type: ignore +interpreter_arch: str = None # type: ignore +libc_lib: Path = None # type: ignore + +if __name__ == "__main__": + nix_support = Path(os.environ['NIX_BINTOOLS']) / 'nix-support' + interpreter_path = Path((nix_support / 'dynamic-linker').read_text().strip()) + libc_lib = Path((nix_support / 'orig-libc').read_text().strip()) / 'lib' + + with open_elf(interpreter_path) as interpreter: + interpreter_osabi = get_osabi(interpreter) + interpreter_arch = get_arch(interpreter) + + if interpreter_arch and interpreter_osabi and interpreter_path and libc_lib: + main() + else: + sys.exit("Failed to parse dynamic linker (ld) properties.") diff --git a/pkgs/buda-prebuilt/vendored/auto-patchelf.sh b/pkgs/buda-prebuilt/vendored/auto-patchelf.sh new file mode 100644 index 0000000..8f010a3 --- /dev/null +++ b/pkgs/buda-prebuilt/vendored/auto-patchelf.sh @@ -0,0 +1,20 @@ +# This setup hook calls patchelf to automatically remove unneeded +# directories from the RPATH of every library or executable in every +# output. + +fixupOutputHooks+=('if [ -z "${dontPatchELF-}" ]; then patchELF "$prefix"; fi') + +patchELF() { + local dir="$1" + [ -e "$dir" ] || return 0 + + echo "shrinking RPATHs of ELF executables and libraries in $dir" + + local i + while IFS= read -r -d $'\0' i; do + if [[ "$i" =~ .build-id ]]; then continue; fi + if ! isELF "$i"; then continue; fi + echo "shrinking $i" + patchelf --shrink-rpath "$i" || true + done < <(find "$dir" -type f -print0) +} diff --git a/pkgs/buda-prebuilt/vendored/boost/1.74.nix b/pkgs/buda-prebuilt/vendored/boost/1.74.nix new file mode 100644 index 0000000..f28f400 --- /dev/null +++ b/pkgs/buda-prebuilt/vendored/boost/1.74.nix @@ -0,0 +1,15 @@ +{ callPackage, fetchurl, fetchpatch, ... } @ args: + +callPackage ./generic.nix (args // rec { + version = "1.74.0"; + + src = fetchurl { + urls = [ + "mirror://sourceforge/boost/boost_${builtins.replaceStrings ["."] ["_"] version}.tar.bz2" + "https://boostorg.jfrog.io/artifactory/main/release/${version}/source/boost_${builtins.replaceStrings ["."] ["_"] version}.tar.bz2" + ]; + # SHA256 from http://www.boost.org/users/history/version_1_74_0.html + sha256 = "83bfc1507731a0906e387fc28b7ef5417d591429e51e788417fe9ff025e116b1"; + }; +}) + diff --git a/pkgs/buda-prebuilt/vendored/boost/cmake-paths-173.patch b/pkgs/buda-prebuilt/vendored/boost/cmake-paths-173.patch new file mode 100644 index 0000000..7b88da0 --- /dev/null +++ b/pkgs/buda-prebuilt/vendored/boost/cmake-paths-173.patch @@ -0,0 +1,22 @@ +diff --git a/tools/boost_install/boost-install.jam b/tools/boost_install/boost-install.jam +index 4238f921e..8fc1ea269 100644 +--- a/tools/boost_install/boost-install.jam ++++ b/tools/boost_install/boost-install.jam +@@ -649,7 +649,7 @@ rule generate-cmake-config- ( target : sources * : properties * ) + "" + "# Compute the include and library directories relative to this file." + "" +- "get_filename_component(_BOOST_CMAKEDIR \"${CMAKE_CURRENT_LIST_DIR}/../\" REALPATH)" ++ "get_filename_component(_BOOST_REAL_CMAKEDIR \"${CMAKE_CURRENT_LIST_DIR}/../\" REALPATH)" + : true ; + + if [ path.is-rooted $(cmakedir) ] +@@ -668,6 +668,8 @@ rule generate-cmake-config- ( target : sources * : properties * ) + " unset(_BOOST_CMAKEDIR_ORIGINAL)" + "endif()" + "" ++ "# Assume that the installer actually did know where the libs were to be installed" ++ "get_filename_component(_BOOST_CMAKEDIR \"$(cmakedir-native)\" REALPATH)" + : true ; + } + diff --git a/pkgs/buda-prebuilt/vendored/boost/cmake-paths.patch b/pkgs/buda-prebuilt/vendored/boost/cmake-paths.patch new file mode 100644 index 0000000..b7f9014 --- /dev/null +++ b/pkgs/buda-prebuilt/vendored/boost/cmake-paths.patch @@ -0,0 +1,21 @@ +diff --git a/tools/boost_install/boost-install.jam b/tools/boost_install/boost-install.jam +index ad19f7b55..ec6bf57ff 100644 +--- a/tools/boost_install/boost-install.jam ++++ b/tools/boost_install/boost-install.jam +@@ -587,6 +587,7 @@ rule generate-cmake-config- ( target : sources * : properties * ) + "# Compute the include and library directories relative to this file." + "" + "get_filename_component(_BOOST_CMAKEDIR \"${CMAKE_CURRENT_LIST_DIR}/../\" ABSOLUTE)" ++ "get_filename_component(_BOOST_REAL_CMAKEDIR \"${CMAKE_CURRENT_LIST_DIR}/../\" ABSOLUTE)" + : true ; + + if [ path.is-rooted $(cmakedir) ] +@@ -607,6 +608,8 @@ rule generate-cmake-config- ( target : sources * : properties * ) + " unset(_BOOST_CMAKEDIR_ORIGINAL)" + "endif()" + "" ++ "# Assume that the installer actually did know where the libs were to be installed" ++ "get_filename_component(_BOOST_CMAKEDIR \"$(cmakedir-native)\" REALPATH)" + : true ; + } + diff --git a/pkgs/buda-prebuilt/vendored/boost/darwin-no-system-python.patch b/pkgs/buda-prebuilt/vendored/boost/darwin-no-system-python.patch new file mode 100644 index 0000000..73e0910 --- /dev/null +++ b/pkgs/buda-prebuilt/vendored/boost/darwin-no-system-python.patch @@ -0,0 +1,45 @@ +diff --git a/tools/build/src/tools/python.jam b/tools/build/src/tools/python.jam +index 273b28a..2d2031e 100644 +--- a/tools/build/src/tools/python.jam ++++ b/tools/build/src/tools/python.jam +@@ -428,13 +428,7 @@ local rule windows-installed-pythons ( version ? ) + + local rule darwin-installed-pythons ( version ? ) + { +- version ?= $(.version-countdown) ; +- +- local prefix +- = [ GLOB /System/Library/Frameworks /Library/Frameworks +- : Python.framework ] ; +- +- return $(prefix)/Versions/$(version)/bin/python ; ++ return ; + } + + +@@ -890,25 +884,6 @@ local rule configure ( version ? : cmd-or-prefix ? : includes * : libraries ? : + + # See if we can find a framework directory on darwin. + local framework-directory ; +- if $(target-os) = darwin +- { +- # Search upward for the framework directory. +- local framework-directory = $(libraries[-1]) ; +- while $(framework-directory:D=) && $(framework-directory:D=) != Python.framework +- { +- framework-directory = $(framework-directory:D) ; +- } +- +- if $(framework-directory:D=) = Python.framework +- { +- debug-message framework directory is \"$(framework-directory)\" ; +- } +- else +- { +- debug-message "no framework directory found; using library path" ; +- framework-directory = ; +- } +- } + + local dll-path = $(libraries) ; + diff --git a/pkgs/buda-prebuilt/vendored/boost/default.nix b/pkgs/buda-prebuilt/vendored/boost/default.nix new file mode 100644 index 0000000..1194b6f --- /dev/null +++ b/pkgs/buda-prebuilt/vendored/boost/default.nix @@ -0,0 +1,20 @@ +{ lib +, callPackage +, boost-build +, fetchurl +}: + +let + makeBoost = file: + lib.fix (self: + callPackage file { + boost-build = boost-build.override { + # useBoost allows us passing in src and version from + # the derivation we are building to get a matching b2 version. + useBoost = self; + }; + } + ); +in { + boost174 = makeBoost ./1.74.nix; +} diff --git a/pkgs/buda-prebuilt/vendored/boost/generic.nix b/pkgs/buda-prebuilt/vendored/boost/generic.nix new file mode 100644 index 0000000..7d8aee0 --- /dev/null +++ b/pkgs/buda-prebuilt/vendored/boost/generic.nix @@ -0,0 +1,249 @@ +{ lib, stdenv, icu, expat, zlib, bzip2, zstd, xz, python ? null, fixDarwinDylibNames, libiconv, libxcrypt +, boost-build +, fetchpatch +, which +, toolset ? /**/ if stdenv.cc.isClang then "clang" + else if stdenv.cc.isGNU then "gcc" + else null +, enableRelease ? true +, enableDebug ? false +, enableSingleThreaded ? false +, enableMultiThreaded ? true +, enableShared ? !(with stdenv.hostPlatform; isStatic || libc == "msvcrt") # problems for now +, enableStatic ? !enableShared +, enablePython ? false +, enableNumpy ? false +, enableIcu ? stdenv.hostPlatform == stdenv.buildPlatform +, taggedLayout ? ((enableRelease && enableDebug) || (enableSingleThreaded && enableMultiThreaded) || (enableShared && enableStatic)) +, patches ? [] +, boostBuildPatches ? [] +, useMpi ? false +, mpi +, extraB2Args ? [] + +# Attributes inherit from specific versions +, version, src +, ... +}: + +# We must build at least one type of libraries +assert enableShared || enableStatic; + +assert enableNumpy -> enablePython; + +# Boost <1.69 can't be built on linux with clang >8, because pth was removed +assert with lib; (stdenv.isLinux && toolset == "clang" && versionAtLeast stdenv.cc.version "8.0.0") -> versionAtLeast version "1.69"; + +let + + variant = lib.concatStringsSep "," + (lib.optional enableRelease "release" ++ + lib.optional enableDebug "debug"); + + threading = lib.concatStringsSep "," + (lib.optional enableSingleThreaded "single" ++ + lib.optional enableMultiThreaded "multi"); + + link = lib.concatStringsSep "," + (lib.optional enableShared "shared" ++ + lib.optional enableStatic "static"); + + runtime-link = if enableShared then "shared" else "static"; + + # To avoid library name collisions + layout = if taggedLayout then "tagged" else "system"; + + needUserConfig = stdenv.hostPlatform != stdenv.buildPlatform || useMpi || (stdenv.isDarwin && enableShared); + + b2Args = lib.concatStringsSep " " ([ + "--includedir=$dev/include" + "--libdir=$out/lib" + "-j$NIX_BUILD_CORES" + "--layout=${layout}" + "variant=${variant}" + "threading=${threading}" + "link=${link}" + "-sEXPAT_INCLUDE=${expat.dev}/include" + "-sEXPAT_LIBPATH=${expat.out}/lib" + + # TODO: make this unconditional + ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform || + # required on mips; see 61d9f201baeef4c4bb91ad8a8f5f89b747e0dfe4 + (stdenv.hostPlatform.isMips && lib.versionAtLeast version "1.79")) [ + "address-model=${toString stdenv.hostPlatform.parsed.cpu.bits}" + "architecture=${if stdenv.hostPlatform.isMips64 + then if lib.versionOlder version "1.78" then "mips1" else "mips" + else if stdenv.hostPlatform.parsed.cpu.name == "s390x" then "s390x" + else toString stdenv.hostPlatform.parsed.cpu.family}" + "binary-format=${toString stdenv.hostPlatform.parsed.kernel.execFormat.name}" + "target-os=${toString stdenv.hostPlatform.parsed.kernel.name}" + + # adapted from table in boost manual + # https://www.boost.org/doc/libs/1_66_0/libs/context/doc/html/context/architectures.html + "abi=${if stdenv.hostPlatform.parsed.cpu.family == "arm" then "aapcs" + else if stdenv.hostPlatform.isWindows then "ms" + else if stdenv.hostPlatform.isMips32 then "o32" + else if stdenv.hostPlatform.isMips64n64 then "n64" + else "sysv"}" + ] ++ lib.optional (link != "static") "runtime-link=${runtime-link}" + ++ lib.optional (variant == "release") "debug-symbols=off" + ++ lib.optional (toolset != null) "toolset=${toolset}" + ++ lib.optional (!enablePython) "--without-python" + ++ lib.optional needUserConfig "--user-config=user-config.jam" + ++ lib.optional (stdenv.buildPlatform.isDarwin && stdenv.hostPlatform.isLinux) "pch=off" + ++ lib.optionals (stdenv.hostPlatform.libc == "msvcrt") [ + "threadapi=win32" + ] ++ extraB2Args + ); + +in + +stdenv.mkDerivation { + pname = "boost"; + + inherit src version; + + patchFlags = []; + + patches = patches + ++ lib.optional stdenv.isDarwin ./darwin-no-system-python.patch + # Fix boost-context segmentation faults on ppc64 due to ABI violation + ++ lib.optional (lib.versionOlder version "1.71") (fetchpatch { + url = "https://github.com/boostorg/context/commit/2354eca9b776a6739112833f64754108cc0d1dc5.patch"; + sha256 = "067m4bjpmcanqvg28djax9a10avmdwhlpfx6gn73kbqqq70dnz29"; + stripLen = 1; + extraPrefix = "libs/context/"; + }) + ++ lib.optional (lib.versionOlder version "1.70") (fetchpatch { + # support for Mips64n64 appeared in boost-context 1.70 + url = "https://github.com/boostorg/context/commit/e3f744a1862164062d579d1972272d67bdaa9c39.patch"; + sha256 = "sha256-qjQy1b4jDsIRrI+UYtcguhvChrMbGWO0UlEzEJHYzRI="; + stripLen = 1; + extraPrefix = "libs/context/"; + }) + ++ lib.optional (lib.versionAtLeast version "1.70" && lib.versionOlder version "1.73") ./cmake-paths.patch + ++ lib.optional (lib.versionAtLeast version "1.73") ./cmake-paths-173.patch + ++ lib.optional (version == "1.77.0") (fetchpatch { + url = "https://github.com/boostorg/math/commit/7d482f6ebc356e6ec455ccb5f51a23971bf6ce5b.patch"; + relative = "include"; + sha256 = "sha256-KlmIbixcds6GyKYt1fx5BxDIrU7msrgDdYo9Va/KJR4="; + }); + + meta = with lib; { + homepage = "http://boost.org/"; + description = "Collection of C++ libraries"; + license = licenses.boost; + platforms = platforms.unix ++ platforms.windows; + badPlatforms = optionals (versionOlder version "1.73") platforms.riscv; + maintainers = with maintainers; [ hjones2199 ]; + + broken = + # boost-context lacks support for the N32 ABI on mips64. The build + # will succeed, but packages depending on boost-context will fail with + # a very cryptic error message. + stdenv.hostPlatform.isMips64n32; + }; + + passthru = { + inherit boostBuildPatches; + }; + + preConfigure = lib.optionalString useMpi '' + cat << EOF >> user-config.jam + using mpi : ${mpi}/bin/mpiCC ; + EOF + '' + # On darwin we need to add the `$out/lib` to the libraries' rpath explicitly, + # otherwise the dynamic linker is unable to resolve the reference to @rpath + # when the boost libraries want to load each other at runtime. + + lib.optionalString (stdenv.isDarwin && enableShared) '' + cat << EOF >> user-config.jam + using clang-darwin : : ${stdenv.cc.targetPrefix}c++ + : "-rpath $out/lib/" + ; + EOF + '' + # b2 has trouble finding the correct compiler and tools for cross compilation + # since it apparently ignores $CC, $AR etc. Thus we need to set everything + # in user-config.jam. To keep things simple we just set everything in an + # uniform way for clang and gcc (which works thanks to our cc-wrapper). + # We pass toolset later which will make b2 invoke everything in the right + # way -- the other toolset in user-config.jam will be ignored. + + lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + cat << EOF >> user-config.jam + using gcc : cross : ${stdenv.cc.targetPrefix}c++ + : $AR + $RANLIB + ; + + using clang : cross : ${stdenv.cc.targetPrefix}c++ + : $AR + $RANLIB + ; + EOF + '' + # b2 needs to be explicitly told how to find Python when cross-compiling + + lib.optionalString enablePython '' + cat << EOF >> user-config.jam + using python : : ${python.interpreter} + : ${python}/include/python${python.pythonVersion} + : ${python}/lib + ; + EOF + ''; + + NIX_CFLAGS_LINK = lib.optionalString stdenv.isDarwin + "-headerpad_max_install_names"; + + enableParallelBuilding = true; + + nativeBuildInputs = [ which boost-build ] + ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; + buildInputs = [ expat zlib bzip2 libiconv ] + ++ lib.optional (lib.versionAtLeast version "1.69") zstd + ++ [ xz ] + ++ lib.optional enableIcu icu + ++ lib.optionals enablePython [ libxcrypt python ] + ++ lib.optional enableNumpy python.pkgs.numpy; + + configureScript = "./bootstrap.sh"; + configurePlatforms = []; + dontDisableStatic = true; + dontAddStaticConfigureFlags = true; + configureFlags = [ + "--includedir=$(dev)/include" + "--libdir=$(out)/lib" + "--with-bjam=b2" # prevent bootstrapping b2 in configurePhase + ] ++ lib.optional (toolset != null) "--with-toolset=${toolset}" + ++ [ (if enableIcu then "--with-icu=${icu.dev}" else "--without-icu") ]; + + buildPhase = '' + runHook preBuild + b2 ${b2Args} + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + # boostbook is needed by some applications + mkdir -p $dev/share/boostbook + cp -a tools/boostbook/{xsl,dtd} $dev/share/boostbook/ + + # Let boost install everything else + b2 ${b2Args} install + + runHook postInstall + ''; + + postFixup = '' + # Make boost header paths relative so that they are not runtime dependencies + cd "$dev" && find include \( -name '*.hpp' -or -name '*.h' -or -name '*.ipp' \) \ + -exec sed '1s/^\xef\xbb\xbf//;1i#line 1 "{}"' -i '{}' \; + '' + lib.optionalString (stdenv.hostPlatform.libc == "msvcrt") '' + $RANLIB "$out/lib/"*.a + ''; + + outputs = [ "out" "dev" ]; + setOutputFlags = false; +} diff --git a/pkgs/buda-prebuilt/vendored/boost/pthread-stack-min-fix.patch b/pkgs/buda-prebuilt/vendored/boost/pthread-stack-min-fix.patch new file mode 100644 index 0000000..b6c85f8 --- /dev/null +++ b/pkgs/buda-prebuilt/vendored/boost/pthread-stack-min-fix.patch @@ -0,0 +1,15 @@ +Taken from https://github.com/conan-io/conan-center-index/pull/361/files + +diff --git a/include/boost/thread/pthread/thread_data.hpp b/include/boost/thread/pthread/thread_data.hpp +index aefbeb4..bc9b136 100644 +--- a/boost/thread/pthread/thread_data.hpp ++++ b/boost/thread/pthread/thread_data.hpp +@@ -57,7 +57,7 @@ namespace boost + #else + std::size_t page_size = ::sysconf( _SC_PAGESIZE); + #endif +-#if PTHREAD_STACK_MIN > 0 ++#ifdef PTHREAD_STACK_MIN + if (size "$i.tmp" + if test -x "$i"; then chmod +x "$i.tmp"; fi + cmp -s "$i" "$i.tmp" || echo "Changed file: \"$i\"" + mv "$i.tmp" "$i" + + for hook in "${fixupHooks[@]}"; do + eval "$hook" "$i" + done + fi +done diff --git a/pkgs/buda-prebuilt/vendored/pip-install-hook.sh b/pkgs/buda-prebuilt/vendored/pip-install-hook.sh new file mode 100644 index 0000000..7a9106c --- /dev/null +++ b/pkgs/buda-prebuilt/vendored/pip-install-hook.sh @@ -0,0 +1,24 @@ +# Setup hook for pip. +echo "Sourcing pip-install-hook" + +declare -a pipInstallFlags + +pipInstallPhase() { + echo "Executing pipInstallPhase" + runHook preInstall + + mkdir -p "$out/@pythonSitePackages@" + export PYTHONPATH="$out/@pythonSitePackages@:$PYTHONPATH" + + pushd dist || return 1 + @pythonInterpreter@ -m pip install ./*.whl --no-warn-script-location --prefix="$out" --no-cache $pipInstallFlags + popd || return 1 + + runHook postInstall + echo "Finished executing pipInstallPhase" +} + +if [ -z "${dontUsePipInstall-}" ] && [ -z "${installPhase-}" ]; then + echo "Using pipInstallPhase" + installPhase=pipInstallPhase +fi diff --git a/pkgs/buda/default.nix b/pkgs/buda/default.nix new file mode 100644 index 0000000..508a17c --- /dev/null +++ b/pkgs/buda/default.nix @@ -0,0 +1,58 @@ +{ + lib, + python3Packages, + fetchFromGitHub, + git, + cmake, +}: + +python3Packages.buildPythonApplication rec { + pname = "tt-buda"; + version = "0.19.3"; + pyproject = true; + + src = fetchFromGitHub { + owner = "tenstorrent"; + repo = "tt-buda"; + rev = "v${version}"; + #hash = "sha256-g5eB2roVh4t4fhM+t2QYm+3NXYM94hbwstWES2sL6hA="; + hash = "sha256-a+yamtu93AypLAXa9cj3yQ1AcizEBbmDd8fa2RNjGcQ="; + fetchSubmodules = true; + leaveDotGit = true; + }; + + build-system = [ + python3Packages.setuptools + python3Packages.wheel + ]; + + nativeBuildInputs = [ + git + cmake + ] ++ python3Packages.pybind11.propagatedNativeBuildInputs; + + buildInputs = [ + python3Packages.python # pybind python.h + ]; + + postPatch = '' + substituteInPlace compile_flags.txt third_party/budabackend/compile_flags.txt \ + --replace-fail "-I/usr/include/python3.8" "-I/usr/include/python3.8" + ''; + + dontUseCmakeConfigure = true; + + pythonImportsCheck = [ + "tt_buda" + ]; + + BACKEND_ARCH_NAME = "wormhole_b0"; + ARCH_NAME = "wormhole_b0"; + + meta = { + description = "Tenstorrent TT-BUDA Repository"; + homepage = "https://github.com/tenstorrent/tt-buda"; + license = lib.licenses.asl20; + mainProgram = "tt-buda"; + }; +} diff --git a/pkgs/flash/default.nix b/pkgs/flash/default.nix index d5f6e9e..35d289c 100644 --- a/pkgs/flash/default.nix +++ b/pkgs/flash/default.nix @@ -8,13 +8,13 @@ with pkgs.python3Packages; buildPythonPackage rec { pname = "tt-flash"; - version = "3.1.1"; + version = "unstable-2024-09-27"; src = pkgs.fetchFromGitHub { owner = "tenstorrent"; repo = "tt-flash"; - rev = "refs/tags/v${version}"; - hash = "sha256-t2B1XEOKBKxE2eQiS7pc+EemBWomMgocyk4oRDt0Q78="; + rev = "4002fee1da7edfcbf09093ba23612caeca071f23"; + hash = "sha256-O6b/vS/zCjp/mrNzFEylWs0jtwdHY65nwkvn5GFridI="; }; nativeBuildInputs = [ pythonRelaxDepsHook ]; diff --git a/pkgs/kmd/default.nix b/pkgs/kmd/default.nix index 71914df..c819150 100644 --- a/pkgs/kmd/default.nix +++ b/pkgs/kmd/default.nix @@ -4,10 +4,10 @@ let src = pkgs.fetchFromGitHub { owner = "tenstorrent"; repo = "tt-kmd"; - rev = "refs/tags/ttkmd-${version}"; - hash = "sha256-TTd+SXUQ/RwsZB7YIc0QsE9zHBCYO3NRrCub7/K1rP4="; + rev = "715a5d76e5dbb6d8972d4aa92e8cbe3434986b9f"; + hash = "sha256-OCnGhvIDIqkQJXlIpOVnP0O9cA9J7/bz1JPAOpeDNYQ="; }; - version = "1.31"; + version = "unstable-2024-09-06"; in { kmd = pkgs.stdenv.mkDerivation { @@ -41,9 +41,6 @@ in test = pkgs.stdenv.mkDerivation { pname = "tt-kmd-test"; - # https://github.com/tenstorrent/tt-kmd/pull/37 - patches = ./limits.patch; - inherit src version; nativeBuildInputs = [ pkgs.gnumake ]; diff --git a/pkgs/kmd/limits.patch b/pkgs/kmd/limits.patch deleted file mode 100644 index 1f9edd1..0000000 --- a/pkgs/kmd/limits.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/test/query_mappings.cpp b/test/query_mappings.cpp -index 0721485..7fe7ae4 100644 ---- a/test/query_mappings.cpp -+++ b/test/query_mappings.cpp -@@ -16,6 +16,7 @@ - #include - #include - #include -+#include - #include - - #include diff --git a/pkgs/luwen/Cargo_0_1.lock b/pkgs/luwen/Cargo_0_1.lock new file mode 100644 index 0000000..8c79257 --- /dev/null +++ b/pkgs/luwen/Cargo_0_1.lock @@ -0,0 +1,1037 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bitfield-struct" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0526e3752c9058af187599111a39eff3669ff8cc775063cf94709db66f0afcac" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "cbindgen" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faeaa693e5a727975a79211b8f35c0cb09b031fdb6eaa4a788bc6713d01488ca" +dependencies = [ + "clap", + "heck", + "indexmap 1.9.3", + "log", + "proc-macro2", + "quote", + "serde", + "serde_json", + "syn 1.0.109", + "tempfile", + "toml", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clap" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" +dependencies = [ + "atty", + "bitflags 1.3.2", + "clap_lex", + "indexmap 1.9.3", + "strsim", + "termcolor", + "textwrap", +] + +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "console" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "unicode-width", + "windows-sys", +] + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "fastrand" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", +] + +[[package]] +name = "indexmap" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" +dependencies = [ + "equivalent", + "hashbrown 0.14.3", +] + +[[package]] +name = "indicatif" +version = "0.17.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb28741c9db9a713d93deb3bb9515c20788cef5815265bee4980e87bde7e0f25" +dependencies = [ + "console", + "instant", + "number_prefix", + "portable-atomic", + "unicode-width", +] + +[[package]] +name = "indoc" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa799dd5ed20a7e349f3b4639aa80d74549c81716d9ec4f994c9b5815598306" + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "inventory" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f958d3d68f4167080a18141e10381e7634563984a537f2a49a30fd8e53ac5767" + +[[package]] +name = "itoa" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" + +[[package]] +name = "kmdif" +version = "0.1.0" +dependencies = [ + "bitfield-struct", + "luwen-core", + "memmap2", + "nix", + "thiserror", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.153" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" + +[[package]] +name = "linux-raw-sys" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" + +[[package]] +name = "lock_api" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "luwen" +version = "0.1.0" +dependencies = [ + "bincode", + "luwen-core", + "luwen-if", + "luwen-ref", + "rand", + "serde", + "serde_yaml", +] + +[[package]] +name = "luwen-core" +version = "0.1.0" +dependencies = [ + "thiserror", +] + +[[package]] +name = "luwen-if" +version = "0.2.0" +dependencies = [ + "bincode", + "luwen-core", + "rust-embed", + "serde", + "thiserror", +] + +[[package]] +name = "luwen-ref" +version = "0.2.0" +dependencies = [ + "indicatif", + "kmdif", + "luwen-if", + "thiserror", +] + +[[package]] +name = "luwencpp" +version = "0.1.0" +dependencies = [ + "cbindgen", + "luwen-core", + "luwen-if", +] + +[[package]] +name = "memmap2" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49388d20533534cd19360ad3d6a7dadc885944aa802ba3995040c5ec11288c6" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +dependencies = [ + "autocfg", +] + +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "nix" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" +dependencies = [ + "bitflags 1.3.2", + "cfg-if", + "libc", + "memoffset 0.7.1", + "pin-utils", +] + +[[package]] +name = "number_prefix" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "os_str_bytes" +version = "6.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.48.5", +] + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "portable-atomic" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "proc-macro2" +version = "1.0.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "pyluwen" +version = "0.3.2" +dependencies = [ + "kmdif", + "luwen-core", + "luwen-if", + "luwen-ref", + "pyo3", +] + +[[package]] +name = "pyo3" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e681a6cfdc4adcc93b4d3cf993749a4552018ee0a9b65fc0ccfad74352c72a38" +dependencies = [ + "cfg-if", + "indoc", + "inventory", + "libc", + "memoffset 0.9.0", + "parking_lot", + "pyo3-build-config", + "pyo3-ffi", + "pyo3-macros", + "unindent", +] + +[[package]] +name = "pyo3-build-config" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "076c73d0bc438f7a4ef6fdd0c3bb4732149136abd952b110ac93e4edb13a6ba5" +dependencies = [ + "once_cell", + "target-lexicon", +] + +[[package]] +name = "pyo3-ffi" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e53cee42e77ebe256066ba8aa77eff722b3bb91f3419177cf4cd0f304d3284d9" +dependencies = [ + "libc", + "pyo3-build-config", +] + +[[package]] +name = "pyo3-macros" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfeb4c99597e136528c6dd7d5e3de5434d1ceaf487436a3f03b2d56b6fc9efd1" +dependencies = [ + "proc-macro2", + "pyo3-macros-backend", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "pyo3-macros-backend" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "947dc12175c254889edc0c02e399476c2f652b4b9ebd123aa655c224de259536" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "rust-embed" +version = "8.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a82c0bbc10308ed323529fd3c1dce8badda635aa319a5ff0e6466f33b8101e3f" +dependencies = [ + "rust-embed-impl", + "rust-embed-utils", + "walkdir", +] + +[[package]] +name = "rust-embed-impl" +version = "8.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6227c01b1783cdfee1bcf844eb44594cd16ec71c35305bf1c9fb5aade2735e16" +dependencies = [ + "proc-macro2", + "quote", + "rust-embed-utils", + "syn 2.0.48", + "walkdir", +] + +[[package]] +name = "rust-embed-utils" +version = "8.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cb0a25bfbb2d4b4402179c2cf030387d9990857ce08a32592c6238db9fa8665" +dependencies = [ + "sha2", + "walkdir", +] + +[[package]] +name = "rustix" +version = "0.38.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +dependencies = [ + "bitflags 2.4.2", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] + +[[package]] +name = "ryu" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "serde" +version = "1.0.196" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.196" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "serde_json" +version = "1.0.113" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_yaml" +version = "0.9.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adf8a49373e98a4c5f0ceb5d05aa7c648d75f63774981ed95b7c7443bbd50c6e" +dependencies = [ + "indexmap 2.2.2", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "smallvec" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "target-lexicon" +version = "0.12.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae" + +[[package]] +name = "tempfile" +version = "3.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" +dependencies = [ + "cfg-if", + "fastrand", + "redox_syscall", + "rustix", + "windows-sys", +] + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "textwrap" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" + +[[package]] +name = "thiserror" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-width" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" + +[[package]] +name = "unindent" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1766d682d402817b5ac4490b3c3002d91dfa0d22812f341609f97b08757359c" + +[[package]] +name = "unsafe-libyaml" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab4c90930b95a82d00dc9e9ac071b4991924390d46cbd0dfe566148667605e4b" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "walkdir" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" diff --git a/pkgs/luwen/Cargo_0_2.lock b/pkgs/luwen/Cargo_0_2.lock index 218f30d..f7c368c 100644 --- a/pkgs/luwen/Cargo_0_2.lock +++ b/pkgs/luwen/Cargo_0_2.lock @@ -1,12 +1,12 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 4 +version = 3 [[package]] name = "anstream" -version = "0.6.18" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" dependencies = [ "anstyle", "anstyle-parse", @@ -19,37 +19,36 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.10" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] name = "anstyle-parse" -version = "0.2.6" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.2" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.7" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" dependencies = [ "anstyle", - "once_cell", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] @@ -81,7 +80,7 @@ checksum = "adc0846593a56638b74e136a45610f9934c052e14761bebca6b092d5522599e3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.79", ] [[package]] @@ -92,9 +91,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.8.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "block-buffer" @@ -105,12 +104,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "bumpalo" -version = "3.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" - [[package]] name = "byteorder" version = "1.5.0" @@ -119,9 +112,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "cbindgen" -version = "0.28.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eadd868a2ce9ca38de7eeafdcec9c7065ef89b42b32f0839278d55f35c54d1ff" +checksum = "3fce8dd7fcfcbf3a0a87d8f515194b49d6135acab73e18bd380d1d93bb1a15eb" dependencies = [ "clap", "heck 0.4.1", @@ -131,7 +124,7 @@ dependencies = [ "quote", "serde", "serde_json", - "syn 2.0.96", + "syn 2.0.79", "tempfile", "toml", ] @@ -150,9 +143,9 @@ checksum = "6e4de3bc4ea267985becf712dc6d9eed8b04c953b3fcfb339ebc87acd9804901" [[package]] name = "clap" -version = "4.5.27" +version = "4.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "769b0145982b4b48713e01ec42d61614425f27b7058bda7180a3a41f30104796" +checksum = "7be5744db7978a28d9df86a214130d106a89ce49644cbc4e3f0c22c3fba30615" dependencies = [ "clap_builder", "clap_derive", @@ -160,9 +153,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.27" +version = "4.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b26884eb4b57140e4d2d93652abfa49498b938b3c9179f9fc487b0acc3edad7" +checksum = "a5fbc17d3ef8278f55b282b2a2e75ae6f6c7d4bb70ed3d0382375104bfafdb4b" dependencies = [ "anstream", "anstyle", @@ -172,62 +165,50 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.24" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c" +checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.79", ] [[package]] name = "clap_lex" -version = "0.7.4" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "colorchoice" -version = "1.0.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" [[package]] name = "console" -version = "0.15.10" +version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea3c6ecd8059b57859df5c69830340ed3c41d30e3da0c1cbed90a96ac853041b" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" dependencies = [ "encode_unicode", + "lazy_static", "libc", - "once_cell", "unicode-width", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] name = "cpufeatures" -version = "0.2.17" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] -[[package]] -name = "create-ethernet-map" -version = "0.1.0" -dependencies = [ - "clap", - "luwen-core", - "luwen-if", - "luwen-ref", - "prometheus", - "prometheus_exporter", -] - [[package]] name = "crypto-common" version = "0.1.6" @@ -278,17 +259,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "displaydoc" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - [[package]] name = "drunken-monkey" version = "0.1.1" @@ -300,9 +270,9 @@ dependencies = [ [[package]] name = "encode_unicode" -version = "1.0.0" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "equivalent" @@ -312,19 +282,19 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.10" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] name = "fastrand" -version = "2.3.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "fnv" @@ -359,26 +329,14 @@ checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", -] - -[[package]] -name = "getrandom" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" -dependencies = [ - "cfg-if", - "libc", - "wasi 0.13.3+wasi-0.2.2", - "windows-targets 0.52.6", + "wasi", ] [[package]] name = "hashbrown" -version = "0.15.2" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "heck" @@ -398,150 +356,21 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" -[[package]] -name = "icu_collections" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" -dependencies = [ - "displaydoc", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_locid" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" -dependencies = [ - "displaydoc", - "litemap", - "tinystr", - "writeable", - "zerovec", -] - -[[package]] -name = "icu_locid_transform" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_locid_transform_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" - -[[package]] -name = "icu_normalizer" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_normalizer_data", - "icu_properties", - "icu_provider", - "smallvec", - "utf16_iter", - "utf8_iter", - "write16", - "zerovec", -] - -[[package]] -name = "icu_normalizer_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" - -[[package]] -name = "icu_properties" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_locid_transform", - "icu_properties_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_properties_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" - -[[package]] -name = "icu_provider" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_provider_macros", - "stable_deref_trait", - "tinystr", - "writeable", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_provider_macros" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - [[package]] name = "idna" -version = "1.0.3" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ - "idna_adapter", - "smallvec", - "utf8_iter", -] - -[[package]] -name = "idna_adapter" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" -dependencies = [ - "icu_normalizer", - "icu_properties", + "unicode-bidi", + "unicode-normalization", ] [[package]] name = "indexmap" -version = "2.7.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ "equivalent", "hashbrown", @@ -549,15 +378,15 @@ dependencies = [ [[package]] name = "indicatif" -version = "0.17.11" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "183b3088984b400f4cfac3620d5e076c84da5364016b4f49473de574b2586235" +checksum = "763a5a8f45087d6bcea4222e7b72c291a054edf80e4ef6efd2a4979878c7bea3" dependencies = [ "console", + "instant", "number_prefix", "portable-atomic", "unicode-width", - "web-time", ] [[package]] @@ -567,14 +396,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa799dd5ed20a7e349f3b4639aa80d74549c81716d9ec4f994c9b5815598306" [[package]] -name = "inventory" -version = "0.3.17" +name = "instant" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b31349d02fe60f80bbbab1a9402364cad7460626d6030494b08ac4a2075bf81" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ - "rustversion", + "cfg-if", ] +[[package]] +name = "inventory" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f958d3d68f4167080a18141e10381e7634563984a537f2a49a30fd8e53ac5767" + [[package]] name = "is_terminal_polyfill" version = "1.70.1" @@ -583,19 +418,9 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itoa" -version = "1.0.14" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" - -[[package]] -name = "js-sys" -version = "0.3.77" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" -dependencies = [ - "once_cell", - "wasm-bindgen", -] +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "lazy_static" @@ -605,9 +430,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.169" +version = "0.2.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" [[package]] name = "libredox" @@ -615,21 +440,15 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "libc", ] [[package]] name = "linux-raw-sys" -version = "0.4.15" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" - -[[package]] -name = "litemap" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" @@ -643,13 +462,13 @@ dependencies = [ [[package]] name = "log" -version = "0.4.25" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "luwen" -version = "0.4.8" +version = "0.4.3" dependencies = [ "bincode", "clap", @@ -782,7 +601,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.79", ] [[package]] @@ -802,9 +621,12 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "once_cell" -version = "1.20.2" +version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +checksum = "82881c4be219ab5faaf2ad5e5e5ecdff8c66bd7402ca3160975c93b24961afd1" +dependencies = [ + "portable-atomic", +] [[package]] name = "option-ext" @@ -843,9 +665,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project-lite" -version = "0.2.16" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -855,9 +677,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "portable-atomic" -version = "1.10.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" +checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2" [[package]] name = "powerfmt" @@ -876,9 +698,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.93" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] @@ -889,7 +711,7 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "731e0d9356b0c25f16f33b5be79b1c57b562f141ebfcdb0ad8ac2c13a24293b4" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "hex", "lazy_static", "procfs-core", @@ -902,7 +724,7 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3554923a69f4ce04c4a754260c338f505ce22642d3830e049a399fc2059a29" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "hex", ] @@ -957,7 +779,7 @@ checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" [[package]] name = "pyluwen" -version = "0.6.1" +version = "0.6.0" dependencies = [ "luwen-core", "luwen-if", @@ -1029,9 +851,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.38" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -1063,16 +885,16 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.15", + "getrandom", ] [[package]] name = "redox_syscall" -version = "0.5.8" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", ] [[package]] @@ -1081,7 +903,7 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ - "getrandom 0.2.15", + "getrandom", "libredox", "thiserror", ] @@ -1107,7 +929,7 @@ dependencies = [ "quote", "rust-embed-utils", "shellexpand", - "syn 2.0.96", + "syn 2.0.79", "walkdir", ] @@ -1123,28 +945,22 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.44" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] -[[package]] -name = "rustversion" -version = "1.0.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" - [[package]] name = "ryu" -version = "1.0.19" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "same-file" @@ -1163,29 +979,29 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.217" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.217" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.79", ] [[package]] name = "serde_json" -version = "1.0.138" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ "itoa", "memchr", @@ -1241,12 +1057,6 @@ version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - [[package]] name = "strsim" version = "0.11.1" @@ -1266,26 +1076,15 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.96" +version = "2.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" +checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] -[[package]] -name = "synstructure" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - [[package]] name = "target-lexicon" version = "0.12.16" @@ -1294,13 +1093,12 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tempfile" -version = "3.16.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38c246215d7d24f48ae091a2902398798e05d978b24315d6efbc00ede9a8bb91" +checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" dependencies = [ "cfg-if", "fastrand", - "getrandom 0.3.1", "once_cell", "rustix", "windows-sys 0.59.0", @@ -1308,29 +1106,29 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.69" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.69" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.79", ] [[package]] name = "time" -version = "0.3.37" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", @@ -1349,9 +1147,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.19" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ "num-conv", "time-core", @@ -1371,15 +1169,20 @@ dependencies = [ ] [[package]] -name = "tinystr" -version = "0.7.6" +name = "tinyvec" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ - "displaydoc", - "zerovec", + "tinyvec_macros", ] +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + [[package]] name = "toml" version = "0.8.19" @@ -1416,9 +1219,9 @@ dependencies = [ [[package]] name = "tracing" -version = "0.1.41" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ "pin-project-lite", "tracing-attributes", @@ -1427,20 +1230,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.28" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.79", ] [[package]] name = "tracing-core" -version = "0.1.33" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", ] @@ -1464,16 +1267,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] -name = "unicode-ident" -version = "1.0.16" +name = "unicode-bidi" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + +[[package]] +name = "unicode-ident" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" + +[[package]] +name = "unicode-normalization" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" +dependencies = [ + "tinyvec", +] [[package]] name = "unicode-width" -version = "0.2.0" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "unindent" @@ -1489,27 +1307,15 @@ checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" [[package]] name = "url" -version = "2.5.4" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", "percent-encoding", ] -[[package]] -name = "utf16_iter" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" - -[[package]] -name = "utf8_iter" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" - [[package]] name = "utf8parse" version = "0.2.2" @@ -1538,82 +1344,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wasi" -version = "0.13.3+wasi-0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" -dependencies = [ - "wit-bindgen-rt", -] - -[[package]] -name = "wasm-bindgen" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" -dependencies = [ - "cfg-if", - "once_cell", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" -dependencies = [ - "bumpalo", - "log", - "proc-macro2", - "quote", - "syn 2.0.96", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "web-time" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - [[package]] name = "winapi-util" version = "0.1.9" @@ -1632,6 +1362,15 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-sys" version = "0.59.0" @@ -1764,58 +1503,13 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.25" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad699df48212c6cc6eb4435f35500ac6fd3b9913324f938aea302022ce19d310" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" dependencies = [ "memchr", ] -[[package]] -name = "wit-bindgen-rt" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" -dependencies = [ - "bitflags 2.8.0", -] - -[[package]] -name = "write16" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" - -[[package]] -name = "writeable" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" - -[[package]] -name = "yoke" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" -dependencies = [ - "serde", - "stable_deref_trait", - "yoke-derive", - "zerofrom", -] - -[[package]] -name = "yoke-derive" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", - "synstructure", -] - [[package]] name = "zerocopy" version = "0.7.35" @@ -1834,48 +1528,5 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", -] - -[[package]] -name = "zerofrom" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" -dependencies = [ - "zerofrom-derive", -] - -[[package]] -name = "zerofrom-derive" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", - "synstructure", -] - -[[package]] -name = "zerovec" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" -dependencies = [ - "yoke", - "zerofrom", - "zerovec-derive", -] - -[[package]] -name = "zerovec-derive" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", + "syn 2.0.79", ] diff --git a/pkgs/luwen/default.nix b/pkgs/luwen/default.nix index 0ae5065..f1ecb68 100644 --- a/pkgs/luwen/default.nix +++ b/pkgs/luwen/default.nix @@ -1,26 +1,16 @@ { pkgs }: -let - - # Upstream does not vendor a lock file so one has to created manually - # `cargo generate-lockfile` - # Use verson needed by tt-smi - # https://github.com/tenstorrent/tt-smi/blob/main/pyproject.toml#L30 - version = "0.4.9"; - - src = pkgs.fetchFromGitHub { - owner = "tenstorrent"; - repo = "luwen"; - rev = "refs/tags/v${version}"; - sha256 = "sha256-K68PjccE2fBkU4RvKv8X6jKRPYqsVhKB6jU92aajLgo="; - }; - -in - { luwen = pkgs.rustPlatform.buildRustPackage rec { pname = "luwen"; - inherit version src; + version = "unstable-2024-09-13"; + + src = pkgs.fetchFromGitHub { + owner = "tenstorrent"; + repo = "luwen"; + rev = "e4e10e95928f4b73d31ac4f41ea08cd6e3ef5573"; + sha256 = "sha256-cScaqWAyjDuvy9M2EccMfUHfDq23IWniaKeq+upHzOg="; + }; postPatch = '' ln -s ${./Cargo_0_2.lock} Cargo.lock @@ -32,7 +22,14 @@ in pyluwen = pkgs.python3.pkgs.buildPythonPackage rec { pname = "pyluwen"; - inherit version src; + version = "unstable-2024-09-13"; + + src = pkgs.fetchFromGitHub { + owner = "tenstorrent"; + repo = "luwen"; + rev = "e4e10e95928f4b73d31ac4f41ea08cd6e3ef5573"; + sha256 = "sha256-cScaqWAyjDuvy9M2EccMfUHfDq23IWniaKeq+upHzOg="; + }; postPatch = '' ln -s ${./Cargo_0_2.lock} Cargo.lock @@ -55,4 +52,39 @@ in "pyluwen" ]; }; + + pyluwen_0_1 = pkgs.python3.pkgs.buildPythonPackage rec { + pname = "pyluwen"; + version = "v0.1.0"; + + src = pkgs.fetchFromGitHub { + owner = "tenstorrent"; + repo = "luwen"; + rev = "${version}"; + sha256 = "sha256-MyOzm3dfEkL7MsVzV51DaO+Op3+QhUzsYCTDsvYsvpk="; + }; + + postPatch = '' + ln -s ${./Cargo_0_1.lock} Cargo.lock + ''; + + buildAndTestSubdir = "crates/pyluwen"; + + format = "pyproject"; + + cargoDeps = pkgs.rustPlatform.fetchCargoTarball { + inherit src postPatch; + name = "${pname}-${version}"; + hash = "sha256-ZXcj/pzQ/tAROdmi2w+AWYBvLSEZFayizxw+BmNDj70="; + }; + + nativeBuildInputs = [ + pkgs.rustPlatform.cargoSetupHook + pkgs.rustPlatform.maturinBuildHook + ]; + + pythonImportsCheck = [ + "pyluwen" + ]; + }; } diff --git a/pkgs/metal/default.nix b/pkgs/metal/default.nix index b475b28..76f5171 100644 --- a/pkgs/metal/default.nix +++ b/pkgs/metal/default.nix @@ -12,23 +12,21 @@ sfpi, hwloc, libz, - runCommand, - libexecinfo, - callPackage, + }: let llvmPackages = llvmPackages_17; depsDir = "deps"; - version = "0.53.0"; + version = "unstable-2024-10-04"; metal-deps = metal.overrideAttrs (previousAttrs: { name = "tt-metal-deps-${version}.tar.gz"; dontBuild = true; - outputHash = "sha256-hhLjEssXID+uiPQ3kexMCOVB6DB9m/eAVmfr2OleGXc="; + outputHash = "sha256-UOBBqIP2KKEn2pfv7l5v2Of9RoZY0+3TCEu94MQUVYo="; outputHashAlgo = "sha256"; cmakeFlags = [ @@ -53,9 +51,7 @@ let runHook postInstall ''; - postInstall = ""; }); - # NOTE: When changing something remember to make sure the outputHash above doesn't change, or if it changes then update it. metal = llvmPackages.libcxxStdenv.mkDerivation { pname = "tt-metal"; @@ -63,16 +59,12 @@ let src = fetchFromGitHub { owner = "tenstorrent"; repo = "tt-metal"; - rev = "154e6993aed78213446c59731e41c3617d83c1f1"; - hash = "sha256-edtlE4CVsTO4BW0PKhkN0IxdV666Tu/Y1jgZ2Exljeo="; + rev = "0fb4249a94a99714de8f91d93d338832694c09e0"; + # this takes a while and we don't need all of them fetchSubmodules = true; - fetchLFS = true; + hash = "sha256-0tcIwaJzM75S7SFKCJ2UbfElwASpFwdySmzt2LUTT4A="; }; - patches = [ - ./rpath.patch - ]; - env.NIX_CFLAGS_COMPILE = "-Wno-unused-command-line-argument"; nativeBuildInputs = [ @@ -86,9 +78,11 @@ let buildInputs = [ numactl + # umd hwloc libz + ]; postUnpack = '' @@ -98,56 +92,28 @@ let postPatch = '' cp ${cpm-cmake}/share/cpm/CPM.cmake cmake/CPM.cmake - - substituteInPlace tt_metal/CMakeLists.txt ttnn/CMakeLists.txt \ - --replace-fail "REPLACETHIS\"" "$out/lib\"" \ - --replace-warn "REPLACETHIS1" "$out/build/lib" - - substituteInPlace tt_metal/hw/CMakeLists.txt \ - --replace-fail "FetchContent_MakeAvailable(sfpi)" "" - mkdir -p runtime - ln -s ${sfpi.prebuilt} runtime/sfpi + rm -rf tt_metal/third_party/sfpi/compiler + ln -s ${sfpi.tt-gcc} tt_metal/third_party/sfpi/compiler ''; - ARCH_NAME = "wormhole_b0"; - preConfigure = '' + export ARCH_NAME=wormhole_b0 export TT_METAL_HOME=$(pwd) export PYTHONPATH=$(pwd) ''; cmakeFlags = [ "-DCPM_SOURCE_CACHE=${depsDir}" - "-DBUILD_PROGRAMMING_EXAMPLES=TRUE" ]; postInstall = '' - # Have to do this until cpp-ttnn-project-template is fixed - # ttnn-template> ninja: error: '/nix/store/-tt-metal-unstable-2024-10-04/build/lib/_ttnn.so', needed by 'sources/examples/sample_app/sample_app', missing and no known rule to make it - cp -r ../ $out - rm -rf $out/.cpmcache - ln -s $out/build/deps $out/.cpmcache - - # Nix checks for references to /build/source so these should be different but not a different size to prevent corruption - find "$out" -type f -print0 | while IFS= read -r -d $'\0' f; do - sed -i "s|/build/source|/suild/source|g" "$f" - sed -i 's|$ORIGIN/build/lib:|$ORIGIN/suild/lib:|g' "$f" - done - - # Using tt-metal tries to write to /built - # Create the built dir so a writable dir can be bind mounted to it - mkdir $out/built - mkdir $out/generated + pwd + mkdir -p $out/lib + cp lib/{_ttnn.so,libtt_metal.so} $out/lib ''; - dontPatchELF = true; - dontStrip = true; - passthru = { inherit metal-deps; - tests = { - template = callPackage ./ttnn-template.nix { inherit metal; }; - }; }; }; diff --git a/pkgs/metal/rpath.patch b/pkgs/metal/rpath.patch deleted file mode 100644 index 26d0201..0000000 --- a/pkgs/metal/rpath.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/tt_metal/CMakeLists.txt b/tt_metal/CMakeLists.txt -index cba3743fbc..e580f6696c 100644 ---- a/tt_metal/CMakeLists.txt -+++ b/tt_metal/CMakeLists.txt -@@ -55,7 +55,7 @@ set_target_properties( - tt_metal - PROPERTIES - INSTALL_RPATH -- "${PROJECT_BINARY_DIR}/lib" -+ "REPLACETHIS" - ADDITIONAL_CLEAN_FILES - "${PROJECT_BINARY_DIR}/lib;${PROJECT_BINARY_DIR}/obj" - ) -diff --git a/ttnn/CMakeLists.txt b/ttnn/CMakeLists.txt -index 45ee3dd8f8..4401f51b39 100644 ---- a/ttnn/CMakeLists.txt -+++ b/ttnn/CMakeLists.txt -@@ -683,8 +683,8 @@ TT_ENABLE_UNITY_BUILD(ttnn) - #We move the library binaries to a different path rather than PROJECT_BINARY_DIR - #in the Python wheel - set(TTNN_INSTALL_RPATH -- "${PROJECT_BINARY_DIR}/lib" -- "$ORIGIN/build/lib" -+ "REPLACETHIS" -+ "REPLACETHIS1" - ) - - #Make sure library built is _ttnn.so and that it can find all it's linked libraries diff --git a/pkgs/metal/ttnn-template.nix b/pkgs/metal/ttnn-template.nix deleted file mode 100644 index b579093..0000000 --- a/pkgs/metal/ttnn-template.nix +++ /dev/null @@ -1,119 +0,0 @@ -{ - stdenv, - fetchFromGitHub, - metal, - cmake, - ninja, - git, - cacert, - python3, - numactl, - hwloc, - libz, - llvmPackages_17, - cpm-cmake, - sfpi, - -}: - -let - version = "0"; - llvmPackages = llvmPackages_17; - depsDir = "deps"; - - ttnn-template-deps = ttnn-template.overrideAttrs (previousAttrs: { - name = "ttnn-template-deps-deps-${version}.tar.gz"; - - dontBuild = true; - - outputHash = "sha256-qt3PLKE3lwqiYQq6m06V1xk1qDOyHAtGj8lw0Q99qgE="; - outputHashAlgo = "sha256"; - - cmakeFlags = [ - "-DCPM_DOWNLOAD_ALL=ON" - "-DCPM_SOURCE_CACHE=${depsDir}" - ]; - - # Infinite recursion - postUnpack = ""; - - installPhase = '' - runHook preInstall - - # Prune the `.git` directories - find ${depsDir} -name .git -type d -prune -exec rm -rf {} \;; - # Build a reproducible tar, per instructions at https://reproducible-builds.org/docs/archives/ - tar --owner=0 --group=0 --numeric-owner --format=gnu \ - --sort=name --mtime="@$SOURCE_DATE_EPOCH" \ - -czf $out \ - ${depsDir} \ - - runHook postInstall - ''; - - postInstall = ""; - }); - - ttnn-template = llvmPackages.libcxxStdenv.mkDerivation { - pname = "ttnn-template"; - version = "0"; - src = fetchFromGitHub { - owner = "tenstorrent"; - repo = "cpp-ttnn-project-template"; - rev = "702b453aa7000daa56692b7559ec77adf407828d"; - hash = "sha256-NzcZCVujJCyHQgALAewJjoWj+6bQXncONO7nRK8zSx4="; - }; - - nativeBuildInputs = [ - cmake - #ninja - python3 - # for cpm - git - cacert - ]; - - buildInputs = [ - numactl - # umd - hwloc - libz - ]; - - ARCH_NAME = "wormhole_b0"; - TT_METAL_HOME = metal; - - postUnpack = '' - mkdir -p $sourceRoot/build - tar -xf ${ttnn-template-deps} -C $sourceRoot/build - ''; - - postPatch = '' - cp ${cpm-cmake}/share/cpm/CPM.cmake cmake/CPM.cmake - - # Upstream changed these locations and removed libfmt but the template hasn't been updated yet - # https://github.com/tenstorrent/tt-metal/pull/13788 - substituteInPlace sources/sample_lib/CMakeLists.txt \ - --replace-fail '$ENV{TT_METAL_HOME}/build/lib/_ttnn.so' '${metal}/lib/_ttnn.so' \ - --replace-fail '$ENV{TT_METAL_HOME}/build/lib/libdevice.so' '${metal}/lib/libdevice.so' \ - --replace-fail '$ENV{TT_METAL_HOME}/build/lib/libfmt.so' "" \ - --replace-fail '$ENV{TT_METAL_HOME}/build/lib/libnng.so.1' '${metal}/lib/libnng.so.1.8.0' \ - - substituteInPlace sources/sample_lib/CMakeLists.txt \ - --replace-fail '$ENV{TT_METAL_HOME}/build/lib' '${metal}/lib ${metal}/build/lib' - ''; - - # No default install target - installPhase = '' - runHook preInstall - pwd - install -D sources/examples/sample_app/sample_app $out/bin/sample_app - runHook postInstall - ''; - - cmakeFlags = [ - "-DCPM_SOURCE_CACHE=${depsDir}" - ]; - }; -in -ttnn-template diff --git a/pkgs/sfpi/default.nix b/pkgs/sfpi/default.nix index 4ceffbf..fb6f1a5 100644 --- a/pkgs/sfpi/default.nix +++ b/pkgs/sfpi/default.nix @@ -27,32 +27,5 @@ rec { ''; }; - prebuilt = pkgs.stdenv.mkDerivation rec { - pname = "tt-gcc"; - version = "5.0.0"; - - src = pkgs.fetchzip { - url = "https://github.com/tenstorrent/sfpi/releases/download/v5.0.0/sfpi-release.tgz"; - hash = "sha256-RBhJ6BWmvB06zWoELTumpzroHDMpNXU0/WC6elgAkW0="; - }; - - nativeBuildInputs = with pkgs; [ - autoPatchelfHook - ]; - - buildInputs = with pkgs; [ - libmpc - mpfr - gmp - zlib - expat - ]; - - installPhase = '' - cp -r . $out - ''; - - }; - tt-gcc = import ./tt-gcc.nix { inherit pkgs; }; } diff --git a/pkgs/smi/default.nix b/pkgs/smi/default.nix index d2ac140..d56cd33 100644 --- a/pkgs/smi/default.nix +++ b/pkgs/smi/default.nix @@ -8,13 +8,13 @@ with pkgs.python3Packages; buildPythonPackage rec { pname = "tt-smi"; - version = "3.0.5"; + version = "unstable-2024-09-27"; src = pkgs.fetchFromGitHub { owner = "tenstorrent"; repo = "tt-smi"; - rev = "refs/tags/v${version}"; - hash = "sha256-+Dw6F9aupe4VTWQFiNWGKMDOTmxwCW2bHuDQxWxluUc="; + rev = "052f1ce49b94581710744a91939121e01c24b5f2"; + hash = "sha256-IA60unZpSWVnMnDjDIC31QtURi9nIr/F7s7PGZilPcw="; }; format = "pyproject"; @@ -39,6 +39,7 @@ buildPythonPackage rec { propagatedBuildInputs = [ setuptools requests + textual black distro elasticsearch @@ -50,14 +51,5 @@ buildPythonPackage rec { importlib-resources pkgs.pre-commit tools-common - tools-common.textual ]; - - dontUsePytestCheck = true; # no tests - - installCheckPhase = '' - output=$($out/bin/tt-smi || true) - echo "tt-smi output: $output" - echo $output | grep -q "No Tenstorrent driver detected" - ''; } diff --git a/pkgs/system-tools/default.nix b/pkgs/system-tools/default.nix index 53ef49b..fa2cb62 100644 --- a/pkgs/system-tools/default.nix +++ b/pkgs/system-tools/default.nix @@ -4,9 +4,7 @@ fetchFromGitHub, makeWrapper, bash, - coreutils, pciutils, - gawk, }: # NOTE: We might not use these files if we end up doing the things it does in nix instead if possible. @@ -33,8 +31,7 @@ stdenv.mkDerivation rec { runHook preInstall install -Dm444 -t $out/lib/systemd/system/ "tenstorrent-hugepages.service" - # Defined in the module - #install -Dm444 -t $out/lib/systemd/system/ 'dev-hugepages\x2d1G.mount' + install -Dm444 -t $out/lib/systemd/system/ 'dev-hugepages\x2d1G.mount' install -Dm555 -t $out/libexec/ "hugepages-setup.sh" runHook postInstall @@ -44,17 +41,12 @@ stdenv.mkDerivation rec { substituteInPlace "$out/lib/systemd/system/tenstorrent-hugepages.service" \ --replace-fail "/opt/tenstorrent/bin/hugepages-setup.sh" "$out/libexec/hugepages-setup.sh" - mv "$out/libexec/hugepages-setup.sh" "$out/libexec/.hugepages-setup.sh-wrapped" - makeWrapper ${bash}/bin/bash "$out/libexec/hugepages-setup.sh" \ + wrapProgram "$out/libexec/hugepages-setup.sh" \ --prefix PATH : ${ lib.makeBinPath [ - coreutils - pciutils - gawk + pciutils # for lspci ] - } \ - --add-flags "-x $out/libexec/.hugepages-setup.sh-wrapped" - # add -x easier debugging + } ''; meta = { diff --git a/pkgs/tools-common/default.nix b/pkgs/tools-common/default.nix index a5706e9..a8c6114 100644 --- a/pkgs/tools-common/default.nix +++ b/pkgs/tools-common/default.nix @@ -1,37 +1,21 @@ -{ fetchFromGitHub, python3Packages }: +{ pkgs }: -let - # Can be unpinned once https://github.com/tenstorrent/tt-tools-common/blob/main/pyproject.toml#L32 - # is v1 - textual_0_82 = python3Packages.textual.overridePythonAttrs (old: rec { - version = "0.82.0"; - src = fetchFromGitHub { - owner = "Textualize"; - repo = "textual"; - rev = "refs/tags/v${version}"; - hash = "sha256-belpoXQ+CkTchK+FjI/Ur8v4cNgzX39xLdNfPCwaU6E="; - }; - disabledTests = old.disabledTests ++ [ - "test_selection" - ]; - }); -in +with pkgs.python3Packages; -python3Packages.buildPythonPackage rec { +buildPythonPackage rec { pname = "tools-common"; - # https://github.com/tenstorrent/tt-smi/blob/main/pyproject.toml#L31 - version = "1.4.11"; + version = "unstable-2024-09-27"; - src = fetchFromGitHub { + src = pkgs.fetchFromGitHub { owner = "tenstorrent"; repo = "tt-tools-common"; - rev = "refs/tags/v${version}"; - sha256 = "sha256-Q5GpT6B3pamY6bUjPbvNJ11npiR4q/6QMjRxovQ/MZ0="; + rev = "a89b2db6d086698ab0351a820ea689b4809429a3"; + sha256 = "sha256-xeiJQkWsg9p8re2XJai0mNWuP7LwJ9faj3+Z3U/KvzI="; }; format = "pyproject"; - nativeBuildInputs = with python3Packages; [ pythonRelaxDepsHook ]; + nativeBuildInputs = [ pythonRelaxDepsHook ]; pythonRelaxDeps = [ "distro" @@ -44,14 +28,14 @@ python3Packages.buildPythonPackage rec { "tqdm" ]; - propagatedBuildInputs = with python3Packages; [ + propagatedBuildInputs = [ setuptools distro elasticsearch psutil pyyaml rich - textual_0_82 + textual requests jsons tqdm @@ -61,8 +45,4 @@ python3Packages.buildPythonPackage rec { pythonImportsCheck = [ "tt_tools_common" ]; - - passthru = { - textual = textual_0_82; - }; }