Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows Dev Kit: ability for it to upgrade itself #7392

Open
ehaas opened this issue Dec 11, 2020 · 4 comments
Open

Windows Dev Kit: ability for it to upgrade itself #7392

ehaas opened this issue Dec 11, 2020 · 4 comments
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. os-windows
Milestone

Comments

@ehaas
Copy link
Sponsor Contributor

ehaas commented Dec 11, 2020

Ran into this building Zig on Windows using the compiler dev kit tarball, on a system that does have MSVC installed (not sure if that matters)

According to git bisect the problem was introduced in commit a579f8a

dev kit: zig+llvm+lld+clang-x86_64-windows-gnu-0.7.0+1afea36a1

 C:\Users\Evan\Downloads\zig+llvm+lld+clang-x86_64-windows-gnu-0.7.0+1afea36a1\bin\zig.exe build -Dstage1 -Dtarget=native-native-gnu --search-prefix C:\Users\Evan\Downloads\zig+llvm+lld+clang-x86_64-windows-gnu-0.7.0+1afea36a1
.\src\link\MachO.zig:1819:34: error: container 'std.macho' has no member called 'EXPORT_SYMBOL_FLAGS_KIND_REGULAR'
            .export_flags = macho.EXPORT_SYMBOL_FLAGS_KIND_REGULAR,
                                 ^
.\src\link\MachO.zig:315:13: note: referenced here
            try self.writeExportTrie();
            ^
.\src\link.zig:479:13: note: referenced here
            try base.flushModule(comp);
            ^
.\src\Compilation.zig:1249:5: note: referenced here
    try self.bin_file.flush(self);
    ^
.\src\main.zig:1927:5: note: referenced here
    try comp.update();
    ^
.\src\main.zig:1789:49: note: referenced here
    updateModule(gpa, comp, zir_out_path, hook) catch |err| switch (err) {
                                                ^
@andrewrk
Copy link
Member

ok so the unsolved problem with the dev kit is that every time we update the compiler in certain ways, you have to refresh the dev kit in order to keep it working. I have some ideas on how to improve this, but for now the solution is that I need to upload a new dev kit .zip file.

@andrewrk
Copy link
Member

FYI the dev kit link is updated: https://github.com/ziglang/zig/wiki/Building-Zig-on-Windows

It solves this particular problem, but I'm going to keep the issue open to track the fact that we don't have a way to update the dev kit using the dev kit.

@andrewrk andrewrk added enhancement Solving this issue will likely involve adding new logic or components to the codebase. os-windows labels Dec 11, 2020
@andrewrk andrewrk added this to the 0.8.0 milestone Dec 11, 2020
@andrewrk andrewrk changed the title error: container 'std.macho' has no member called 'EXPORT_SYMBOL_FLAGS_KIND_REGULAR' Windows Dev Kit: ability for it to upgrade itself Dec 11, 2020
@ehaas
Copy link
Sponsor Contributor Author

ehaas commented Dec 12, 2020

One workaround for now is to additionally pass --override-lib-dir path\to\zig checkout\lib (e.g. --override-lib-dir C:\Users\Evan\projects\zig\lib) when using the compiler kit. This will work if trying to compile Zig when it uses new standard library features. It may not help if the compiler or build tools change in other ways though.

I confirmed that this workaround allows compiler kit 8076894d8 to build latest master 6ab5beb (without the additional flag it breaks due to missing std.fs.path.extension

@andrewrk
Copy link
Member

I updated the wiki instructions to suggest the --override-lib-dir tip.

@andrewrk andrewrk modified the milestones: 0.8.0, 0.9.0 Jun 4, 2021
@andrewrk andrewrk modified the milestones: 0.9.0, 0.10.0 Nov 24, 2021
@andrewrk andrewrk modified the milestones: 0.10.0, 0.11.0 Apr 16, 2022
@andrewrk andrewrk modified the milestones: 0.11.0, 0.12.0 Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. os-windows
Projects
None yet
Development

No branches or pull requests

2 participants