ziglang / zig

General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
https://ziglang.org
MIT License
33.62k stars 2.46k forks source link

Multiple compiler errors in std #20505

Open PauloCampana opened 2 months ago

PauloCampana commented 2 months ago

All lines inside the test below are individual compiler errors, commented ones have been fixed by these PRs:

19494

20526

20734

20756

const std = @import("std");

test {
    // _ = &std.ArrayHashMap(void, void, void, true).move;
    // _ = &std.Build.Cache.Path.makeOpenPath;
    // _ = &std.coff.SectionHeader.setAlignment;
    // _ = &std.crypto.stream.chacha.ChaCha8With64BitNonce.stream;
    // _ = &std.crypto.pwhash.bcrypt.pbkdf;
    _ = &std.os.windows.GetFileAttributes;
    _ = &std.os.windows.MoveFileEx;
    _ = &std.valgrind.innerThreads;
    _ = &std.valgrind.monitorCommand;
    _ = &std.valgrind.memcheck.doAddedLeakCheck;
    _ = &std.valgrind.memcheck.doChangedLeakCheck;
    _ = &std.valgrind.memcheck.doLeakCheck;
    _ = &std.valgrind.memcheck.doQuickLeakCheck;
    _ = &std.valgrind.memcheck.getVbits;
    _ = &std.valgrind.memcheck.setVbits;

    _ = &std.fs.createFileAbsoluteW;
    _ = &std.fs.deleteDirAbsoluteW;
    _ = &std.fs.deleteFileAbsoluteW;
    _ = &std.fs.makeDirAbsoluteW;
    _ = &std.fs.readlinkAbsoluteW;
    _ = &std.fs.renameW;
    _ = &std.fs.symLinkAbsoluteW;
    _ = &std.fs.Dir.makeDirW;
    _ = &std.fs.Dir.renameW;

    _ = &std.crypto.Certificate.Parsed.pubKeySigAlgo;
    // _ = &std.crypto.onetimeauth.Poly1305.pad;
    _ = &std.crypto.ecc.P256.subMixed;
    _ = &std.crypto.ecc.P384.subMixed;
    _ = &std.crypto.ecc.Secp256k1.subMixed;

    _ = &std.Build.Step.Compile.dependsOnSystemLibrary;
    // _ = &std.Build.Step.TranslateC.defineCMacro;
    // _ = &std.DynLib.openZ;
    _ = &std.heap.alignPageAllocLen;
    _ = &std.process.changeCurDirC;

    _ = &std.fmt.Parser.peek;
    _ = &std.fmt.Parser.until;

    _ = &std.debug.UnwindError;
}

first block are simple fixes, they have typos, missing cast, wrong error set, uses non-pub fn or mismatch type

the std.fs ones are simple fixes but i'd like someone to take a closer look

the std.crypto ones seems to reference stuff that is not implemented yet, or under a different name

the next block needs a deeper look too

std.fmt ones are because these functions are only called at comptime where otherwise it's not valid, could be fixed by marking the inputs as comptime and some other touches, but not necessary for functionality

the last one is very cryptic, dependency loop in the creation of the error set, i have no idea whats going on

SilasLock commented 1 month ago

Now that #20526 has been merged, it would be a good idea to document which of the compiler errors described in this issue were fixed by it. That way future contributors know which ones still need to be patched! Could we update the giant test block in the original issue post to only contain lines which still produce individual compiler errors?

PauloCampana commented 1 month ago

I edited the original message to mark fixed ones, saw that PR when it came out but didn't realize it got merged.