I’ve been pretty busy in my life recently, but I finally got around writing this blog post. Hopefully, things are sorted out in my personal life and I should be able to be more regular about these updates in the future.

I’m very happy to see good progress towards rustup distribution (thanks to Kobzol again!).

  • BB_C@programming.dev
    link
    fedilink
    arrow-up
    1
    ·
    6 days ago

    @antoyo@programming.dev

    I gave this a try for the first time. Non-LTO build worked. But LTO build failed:

    x86_64-pc-linux-gnu-gcc-15.0.0: fatal error: ‘-fuse-linker-plugin’, but liblto_plugin.so not found
    

    I don’t have the time to build gcc and test. But presumably, liblto_plugin.so should be included with libgccjit.so?

    • antoyo@programming.devOP
      link
      fedilink
      arrow-up
      1
      ·
      4 days ago

      The setup to be able to use LTO is non-trivial for now (I hope to be able to fix this soon so that liblto_plugin.so is not required for the case where a linker plugin wasn’t not asked by the user, which is the default).

      You need to have in your path the gcc built with the same version as libgccjit, which contains libexec/gcc/x86_64-pc-linux-gnu/15.0.0/liblto_plugin.so.

    • BB_C@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      6 days ago

      Oh, and clean all doesn’t work reliably. Since trying to build in release mode after building in debug mode then cleaning is weirdly broken.

      And It’s not clear from the README how to build in release mode without running test --release. And the fact that all combinations of --release-sysroot and --release --sysroot and --release --release-sysroot exist doesn’t help 😉

      • antoyo@programming.devOP
        link
        fedilink
        arrow-up
        1
        ·
        5 days ago

        Thanks for reporting this! I cannot reproduce with the following:

        y prepare
        y build --release
        y build
        y clean all
        

        (it shows: Successfully ran clean all)

        Could you please provide the commands you ran to get this? (It might also be easier for me to track this if you open an issue on GitHub since I don’t come here often.)

        Also, thanks for the suggestion for better documentation: I created an issue for this.

        • BB_C@programming.dev
          link
          fedilink
          arrow-up
          1
          ·
          5 days ago

          Yeah, apologies for not communicating the issue clearly.

          cp config.example.toml config.toml
          ./y.sh prepare
          ./y.sh build --sysroot
          ./y.sh clean all
          # above commands finish with success
          # below, building succeeds, but it later fails with "error: failed to load source for dependency `rustc-std-workspace-alloc`
          ./y.sh test --release 
          

          And then trying to use the “release” build fails:

          % CHANNEL="release"  ./y.sh cargo build  --manifest-path tests/hello-world/Cargo.toml
          [BUILD] build system
              Finished `release` profile [optimized] target(s) in 0.03s
          Using `/tmp/rust/rustc_codegen_gcc/build/libgccjit/d6f5a708104a98199ac0f01a3b6b279a0f7c66d3` as path for libgccjit
             Compiling mylib v0.1.0 (/tmp/rust/rustc_codegen_gcc/tests/hello-world/mylib)
          error[E0463]: can't find crate for `std`
            |
            = note: the `x86_64-unknown-linux-gnu` target may not be installed
            = help: consider downloading the target with `rustup target add x86_64-unknown-linux-gnu`
            = help: consider building the standard library from source with `cargo build -Zbuild-std`
          
          For more information about this error, try `rustc --explain E0463`.
          error: could not compile `mylib` (lib) due to 1 previous error
          

          I will make sure to report issues directly in the future, although from account(s) not connected to this username.

          • antoyo@programming.devOP
            link
            fedilink
            arrow-up
            1
            ·
            5 days ago

            The issue here is that you didn’t provide --build-sysroot to ./y.sh test --release, so it cannot find the std crate.

            • BB_C@programming.dev
              link
              fedilink
              arrow-up
              1
              ·
              5 days ago

              But running

              ./y.sh prepare
              ./y.sh test --release
              

              does work. That’s what gave me the impression that clean all doesn’t actually clean everything!

              • antoyo@programming.devOP
                link
                fedilink
                arrow-up
                2
                ·
                3 days ago

                It does actually clean everything. You need to call ./y.sh prepare again if you ran clean all; otherwise, it will fail to find some stuff like rustc-std-workspace-alloc.

                I opened an issue to improve the documentation in this regards. Thanks for testing all this: this will help me improve the documentation.

                • BB_C@programming.dev
                  link
                  fedilink
                  arrow-up
                  1
                  ·
                  3 days ago

                  You need to call ./y.sh prepare again

                  Aha! Good to know. And yes, improved documents would be of great help.

                  Thanks again for working on this.

  • KillTheMule@programming.dev
    link
    fedilink
    arrow-up
    2
    ·
    8 days ago

    Huh haven’t heard of this for quite some time, nice it’s still going strong :)

    I hope this is the first of many contributions we’ll have between the two projects and that we can continue to collaborate with and help each other.

    Great to hear!