Wednesday, August 13, 2025

benchmark compile times

Goal 

Compare rustc and cranelift compile times.
 
 
git clone https://github.com/zed-industries/zed.git

 

Building Zed for macOS

https://github.com/zed-industries/zed/discussions/24512

 

# Build CLI
cd crates/cli/
cargo build --release
# Build Editor
cd ../zed/
cargo build --release --verbose 
   Compiling env_filter v0.1.3
Compiling email_address v0.2.9
Compiling num-cmp v0.1.0
warning: webrtc-sys@0.3.7: webrtc-sys downloading webrtc to "/Users/baxter/baxdocs/rust_learn/zed/target/release/build/webrtc-sys-8cf4e81cad33241f/out/livekit/mac-arm64-release-webrtc-b99fd2c-6/mac-arm64-release"
warning: webrtc-sys@0.3.7: In file included from /Users/baxter/baxdocs/rust_learn/zed/target/release/build/webrtc-sys-8cf4e81cad33241f/out/cxxbridge/sources/webrtc-sys/src/peer_connection.rs.cc:1:
warning: webrtc-sys@0.3.7: In file included from ./include/livekit/rtc_error.h:19:
warning: webrtc-sys@0.3.7: In file included from /Users/baxter/baxdocs/rust_learn/zed/target/release/build/webrtc-sys-8cf4e81cad33241f/out/livekit/mac-arm64-release-webrtc-b99fd2c-6/mac-arm64-release/include/api/rtc_error.h:17:
warning: webrtc-sys@0.3.7: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/c++/v1/string:569:
warning: webrtc-sys@0.3.7: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/c++/v1/__algorithm/remove.h:12:
warning: webrtc-sys@0.3.7: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/c++/v1/__algorithm/find.h:13:
warning: webrtc-sys@0.3.7: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/c++/v1/__algorithm/unwrap_iter.h:14:
warning: webrtc-sys@0.3.7: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/c++/v1/__memory/pointer_traits.h:118:22: error: implicit instantiation of undefined template 'std::__pointer_traits_element_type<rust::Slice<const unsigned char>::iterator>'
warning: webrtc-sys@0.3.7: typedef typename __pointer_traits_element_type<pointer>::type element_type;
warning: webrtc-sys@0.3.7: ^
warning: webrtc-sys@0.3.7: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/c++/v1/__memory/pointer_traits.h:182:20: note: in instantiation of template class 'std::pointer_traits<rust::Slice<const unsigned char>::iterator>' requested here
warning: webrtc-sys@0.3.7: decltype((void)pointer_traits<_Pointer>::to_address(std::declval<const _Pointer&>()))
warning: webrtc-sys@0.3.7: ^
warning: webrtc-sys@0.3.7: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/c++/v1/__memory/pointer_traits.h:195:59: note: during template argument deduction for class template partial specialization '_HasToAddress<_Pointer, decltype((void)pointer_traits<_Pointer>::to_address(std::declval<const _Pointer &>()))>' [with _Pointer = rust::Slice<const unsigned char>::iterator]
warning: webrtc-sys@0.3.7: static const bool value = _HasArrow<_Pointer>::value || _HasToAddress<_Pointer>::value;
warning: webrtc-sys@0.3.7: ^
warning: webrtc-sys@0.3.7: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/c++/v1/__memory/pointer_traits.h:195:59: note: in instantiation of template class 'std::_HasToAddress<rust::Slice<const unsigned char>::iterator>' requested here
warning: webrtc-sys@0.3.7: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/c++/v1/__type_traits/conjunction.h:27:32: note: in instantiation of template class 'std::_IsFancyPointer<rust::Slice<const unsigned char>::iterator>' requested here
warning: webrtc-sys@0.3.7: __expand_to_true<__enable_if_t<_Pred::value>...> __and_helper(int);
warning: webrtc-sys@0.3.7: ^
warning: webrtc-sys@0.3.7: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/c++/v1/__type_traits/conjunction.h:38:39: note: while substituting explicitly-specified template arguments into function template '__and_helper'
warning: webrtc-sys@0.3.7: using _And _LIBCPP_NODEBUG = decltype(std::__and_helper<_Pred...>(0));
warning: webrtc-sys@0.3.7: ^
warning: webrtc-sys@0.3.7: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/c++/v1/__memory/pointer_traits.h:200:5: note: (skipping 4 contexts in backtrace; use -ftemplate-backtrace-limit=0 to see all)
warning: webrtc-sys@0.3.7: _And<is_class<_Pointer>, _IsFancyPointer<_Pointer> >::value
warning: webrtc-sys@0.3.7: ^
warning: webrtc-sys@0.3.7: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/c++/v1/__iterator/concepts.h:193:7: note: in instantiation of requirement here
warning: webrtc-sys@0.3.7: { _VSTD::to_address(__i) } -> same_as<add_pointer_t<iter_reference_t<_Ip>>>;
warning: webrtc-sys@0.3.7: ^~~~~~~~~~~~~~~~~~~~~~
warning: webrtc-sys@0.3.7: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/c++/v1/__config:897:17: note: expanded from macro '_VSTD'
warning: webrtc-sys@0.3.7: # define _VSTD std
warning: webrtc-sys@0.3.7: ^
warning: webrtc-sys@0.3.7: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/c++/v1/__iterator/concepts.h:192:3: note: while substituting template arguments into constraint expression here
warning: webrtc-sys@0.3.7: requires(const _Ip& __i) {
warning: webrtc-sys@0.3.7: ^~~~~~~~~~~~~~~~~~~~~~~~~~
warning: webrtc-sys@0.3.7: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/c++/v1/__ranges/concepts.h:122:5: note: while checking the satisfaction of concept 'contiguous_iterator<rust::Slice<const unsigned char>::iterator>' requested here
warning: webrtc-sys@0.3.7: contiguous_iterator<iterator_t<_Tp>> &&
warning: webrtc-sys@0.3.7: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
warning: webrtc-sys@0.3.7: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/c++/v1/__ranges/concepts.h:122:5: note: while substituting template arguments into constraint expression here
 

 

Can't compile ZED anymore using Vendor - error: failed to run custom build command for `webrtc-sys v0.3.5 #24512

Compilation error when compiling webrtc-sys (from zed-industries/livekit-rust-sdks clone) #23697


macos 14.7.7

Xcode 14.2 

cargo add webrtc
 Did not solve the problem.

sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -license accept

 

Solution

Install:

Xcode 15.2, command line tools for Xcode 15.2  

 

 

 

Tuesday, August 12, 2025

faster rust compiling

 How Usable is the Rust Cranelift Backend Today


A Possible New Backend for Rust


Cranelift

https://blog.rust-lang.org/inside-rust/2020/11/15/Using-rust...


Cranelift codegen backend for rust

https://github.com/rust-lang/rust/blob/master/compiler/rustc_codegen_cranelift/Readme.md

rustup component add rustc-codegen-cranelift-preview --toolchain nightly

#cranelift forum

rustup component remove rustc-codegen-cranelift-preview --toolchain nightly

 

Cranelift Examples

 

Cranelift code generation comes to Rust

$ git clone https://github.com/rust-lang/rustc_codegen_cranelift
$ cd rustc_codegen_cranelift
$ ./y.sh build

 People can now try the Cranelift backend using rustup and cargo:

$ rustup component add rustc-codegen-cranelift-preview --toolchain nightly $ export CARGO_PROFILE_DEV_CODEGEN_BACKEND=cranelift $ cargo +nightly build -Zcodegen-backend

bjorn3 latest progress report  

 
 
'rustup component' (with examples)
 
 
 

Karabiner-Elements

Keyboard short cuts.

= = = = =

Fujiyoshida, Yamanashi prefecture, Japan

*Fuji Asada City “Hotspot” Drama Turns Mount Fuji Area into Tourist Attraction


Tuesday, March 18, 2025

nix for emacs deps on macos

Emacs download site uses nix

 dcaldwell at emacsforosx.com uses nix to manage packages for his build environment.

 

6nok.org

How Fatih uses Nix on macOS

great refs:

  • My first steps with Nix on Mac OSX as Homebrew replacement by Sebastian Kurfürst
  • Using Nix on macOS by Stephen Checkoway
  • Setting up Nix on macOS by Jacek Galowicz
  • Some notes on using nix by Julia Evans
  • Use Nix as Package Manager in macOS by ntzyz
  •  
     
     
     
     
     

     

     

    Tuesday, February 11, 2025

    using apt or nala

    using apt or nala

    sudo apt update 

    apt list --upgradable

    sudo apt upgrade

     sudo apt update && sudo apt upgrade

    sudo apt autoclean && sudo apt autoremove 

     

    apt list --installed

    apt search fastfetch
    apt search gcc
    apt search python
    apt search python | grep installed

    Check dependencies of a package in Ubuntu

    show dependencies of pkgname

    apt show emacsen-common

    apt-cache depends emacsen-common

    Show pkgs that depend on pkgname

    apt-cache rdepends --installed emacsen-common

    history -w /dev/stdout | grep apt |sort |uniq >> apt_history.txt
     

    sudo add-apt-repository ppa:fastfetch/stable
    sudo add-apt-repository ppa:zhangsongcui3371/fastfetch
    sudo apt install fastfetch

    sudo apt remove tlp
     

    sudo nala search

     

    Show language locales installed:

    dpkg --get-selections | grep -v deinstall | egrep "^myspell-|^hunspell-"

    Build and run Redox OS macos m1

     Build and run Redox OS macos m1

     

    https://doc.redox-os.org/book/aarch64.html

    https://gist.github.com/willnode/88da35d0c0542276b4631746d8fc3de1

     

     

    Wednesday, December 11, 2024

    homebrew hints

    homebrew hints

    homebrew is unuable; it is taking hours to install the prerequisites for emacs29.  Macport is quick in comparison.

     

     


    https://apple.stackexchange.com/questions/198623/uninstall-all-programs-installed-by-homebrew

    I usually just do: 
    brew remove --force $(brew list --formula)
    

    and

    brew remove --cask --force $(brew list)
    

     

     

    https://mac.install.guide/homebrew/4

     

    Interview: Max Howell, homebrew

    https://sourcegraph.com/podcast/max-howell

     






    Friday, December 6, 2024

    Ubuntu Multipass for x86 MBP

     

    Ubuntu multipass

     
    First download the tiny installer:
    https://github.com/canonical/multipass/releases 
    newer versions don't work on macos Monterey 12.6.7

    Docs:

    https://oscarchou.com/posts/handbook/multipass-command-cheatsheet/
    https://medium.com/@karan.bk/modify-multipass-instances-update-resources-and-share-data-with-instance-c17315dd33d0
     https://medium.com/@karan.bk/a-beginners-guide-to-create-and-manage-ubuntu-vms-in-minutes-caa1684d9375
     

    https://blog.humphd.org/multipass-on-macos/
    https://fromanegg.com/post/2020/02/28/use-ubuntu-on-mac-os-with-multipass/
    launch failed: multipass socket access denied

     https://github.com/canonical/multipass/issues/1437

     
     FYI, the new command is multipass auth. Note you must first issue multipass set local.passphrase as admin to set passphrase (and then enter this same passphrase when issuing the auth command).

    H...Gi...4...!
     
     
    https://discourse.ubuntu.com/t/ubuntu-frame-on-macos-including-apple-silicon-m1/28534 

    Juju charms

    charm-dev

    Getting started with Juju 5