Skip to content

Conversation

@bernardassan
Copy link
Contributor

currently just done enough changes to get examples and tests passing

Enable llvm for building exe's to prevent error: undefined symbol: tardy_swap_frame

Pass args to examples in build.zig

@bernardassan bernardassan force-pushed the zig-0.15.1 branch 2 times, most recently from 49e1bef to 687ce3d Compare August 28, 2025 08:46
@bernardassan bernardassan marked this pull request as ready for review August 28, 2025 08:47
@bernardassan
Copy link
Contributor Author

@mookums, instead of making this PR very big, I will make it small and do consecutive updates for the new Io API after this.

I would appreciate it if you could review this PR at your earliest convenience.

@mookums
Copy link
Collaborator

mookums commented Aug 30, 2025

Hi, would prefer if we could have one PR for upgrading to 0.15.1. I can take a look at this one now but would prefer to take one look at the end.

@bernardassan
Copy link
Contributor Author

Okay then, I will move the Reader & Writer updates to this PR

impl enough changes to get examples and tests passing

Enable llvm for building exe's to prevent error: undefined symbol: tardy_swap_frame

Pass args to examples in build.zig

Signed-off-by: Bernard Assan <mega.alpha100@gmail.com>
Start adopting new Reader & Writer Io interface

Signed-off-by: Bernard Assan <mega.alpha100@gmail.com>

Update Reader|Writer interface to match std

disable unimplemented methods for now
Remove deprecated Reader|Writer

debug cat example it isn't giving the expected output
I think I forgot to flush (hahahaha)

Signed-off-by: Bernard Assan <mega.alpha100@gmail.com>

get cat example working correctly

investigate why readSliceShort and readVec behave differently

Replace stream interface with a stream method

TODO: fix all examples for correctness
Signed-off-by: Bernard Assan <mega.alpha100@gmail.com>

Fix readSliceShort for files and sockets

rename stream to stream_to with updated Io API

remove mode field in file and simplify code

Remove unimplemented functions

Signed-off-by: Bernard Assan <mega.alpha100@gmail.com>

fix socket reading and detection of end of file

Signed-off-by: Bernard Assan <mega.alpha100@gmail.com>

more idiomatic Zig updates

use smp_allocator in multithreaded context
use the `t` format spec for enum
use result location types for initialization
replace Stream type with stream_to in socket and file

Signed-off-by: Bernard Assan <mega.alpha100@gmail.com>

Use zls's organize imports to organize imports

Signed-off-by: Bernard Assan <mega.alpha100@gmail.com>
@bernardassan
Copy link
Contributor Author

@mookums, this PR is Ready for review

@mookums
Copy link
Collaborator

mookums commented Sep 12, 2025

@bernardassan Just saw this, will review tomorrow afternoon 🎆

@bernardassan
Copy link
Contributor Author

That'd be nice

@mookums
Copy link
Collaborator

mookums commented Sep 14, 2025

@bernardassan e2e test seems to work locally (on Linux) so that's a good sign!

  1. You should update the CI workflow to use the 0.15.1 zig verison, that way the tests will properly run.
  2. You should also update the flake.nix to use the proper dependencies for 0.15.1. Here is a correct one:
{
  description = "an asynchronous runtime for Zig";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/release-25.05";

    zigPkgs.url = "github:mitchellh/zig-overlay";
    zigPkgs.inputs.nixpkgs.follows = "nixpkgs";

    zlsPkg.url = "github:zigtools/zls/0.15.0";
    zlsPkg.inputs.zig-overlay.follows = "zigPkgs";
    zlsPkg.inputs.nixpkgs.follows = "nixpkgs";

    flake-utils.url = "github:numtide/flake-utils";
  };

  outputs =
    {
      nixpkgs,
      zigPkgs,
      zlsPkg,
      flake-utils,
      ...
    }:
    flake-utils.lib.eachDefaultSystem (
      system:
      let
        overlays = [
          (final: prev: {
            zigpkgs = zigPkgs.packages.${prev.system};
            zls = zlsPkg.packages.${prev.system}.default;
          })
        ];
        pkgs = import nixpkgs { inherit system overlays; };
      in
      {
        devShells.default = pkgs.mkShell {
          packages = with pkgs; [
            zigpkgs."0.15.1"
            zls
            openssl
            inetutils
            wrk
          ];
        };
      }
    );
}

@mookums mookums self-assigned this Sep 14, 2025
update flake.nix

Co-authored-by: Muki <muki@muki.gg>

Signed-off-by: Bernard Assan <mega.alpha100@gmail.com>
@mookums mookums merged commit d4a0f9b into tardy-org:main Sep 17, 2025
7 checks passed
@bernardassan bernardassan deleted the zig-0.15.1 branch September 17, 2025 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants