Thanks to visit codestin.com
Credit goes to github.com

Skip to content

build_runner: Require some paths to be given#369

Merged
SuperAuguste merged 1 commit intozigtools:masterfrom
maringuu:fix_package_path
Dec 11, 2021
Merged

build_runner: Require some paths to be given#369
SuperAuguste merged 1 commit intozigtools:masterfrom
maringuu:fix_package_path

Conversation

@maringuu
Copy link
Contributor

@maringuu maringuu commented Aug 7, 2021

For the build runner we now require the following to ge given in the cli args:

  • zig_exe
  • build_root
  • cache_root
  • global_cache_root

This fixes the path for packages that use one or more from the above to place
their files.

Some examples are vulkan-zig and zig-wayland that both place their files in the zig-cache directory.

For symmetry with the original build_runner.zig I just copied over the code from it. We don't actually need global_cache_root so we might consider removing it.

Probably closes #367

@maringuu
Copy link
Contributor Author

maringuu commented Aug 8, 2021

@InfRandomness Can you test if this fixes your problem?
For me zig-vulkan works on the zig-0.8.0 branch but I didn't test master.

@ghost
Copy link

ghost commented Aug 8, 2021

@InfRandomness Can you test if this fixes your problem?
For me zig-vulkan works on the zig-0.8.0 branch but I didn't test master.

I had the problem with zig 0.9.0-dev, I will check it out a bit later

@ghost
Copy link

ghost commented Aug 9, 2021

For some reason, it does not compile with zig master @ 0.9.0-dev.755+799fedf61 :

./src/setup.zig:228:31: error: expected type 'type', found '[]u8'
    var it = std.mem.tokenize(env_path, &[_]u8{std.fs.path.delimiter});
                              ^
./src/setup.zig:68:24: note: referenced here
    var zig_exe_path = try findZig(allocator);
                       ^
./src/main.zig:1805:13: note: referenced here
            try setup.wizard(allocator);
            ^
./src/known-folders/known-folders.zig:149:38: error: expected type 'type', found '*[8192]u8'
        var line_it = std.mem.split(&read, "\n");
                                     ^
zls...The following command exited with error code 1:
/home/build/zig/build/zig build-exe /home/build/zls2/src/main.zig --pkg-begin build_options /home/build/zls2/zig-cache/zls_build_options.zig --pkg-end --cache-dir /home/build/zls2/zig-cache --global-cache-dir /home/build/.cache/zig --name zls --pkg-begin known-folders /home/build/zls2/src/known-folders/known-folders.zig --pkg-end --enable-cache
error: the following build command failed with exit code 1:
/home/build/zls2/zig-cache/o/6e3839e6ed1bb532f8b86eff3a97d46b/build /home/build/zig/build/zig /home/build/zls2 /home/build/zls2/zig-cache /home/build/.cache/zig

This also seems to happen on zls, so this might be an upstream issue

@ghost
Copy link

ghost commented Aug 9, 2021

#372 (comment)

@jbsolomon-fw
Copy link
Contributor

@InfRandomness -- just add u8 as the first parameter of the affected mem functions, since they're generic now

@ghost
Copy link

ghost commented Aug 24, 2021

Would it be okay for you to update your branch with the latest upstream changes on master ? so I can build this

@maringuu
Copy link
Contributor Author

I'll rebase on zls master once I'm back from vacation.
The rebase should be trivial, so I guess you can do it yourself meanwhile.

@maringuu
Copy link
Contributor Author

maringuu commented Sep 3, 2021

Rebased.

@maringuu
Copy link
Contributor Author

maringuu commented Sep 3, 2021

@SuperAuguste Gentle ping :)

We now require the following to ge given in the cli args:
- zig_exe
- build_root
- cache_root
- global_cache_root

This fixes the path for packages that use one or more from the above to place
their files.
@SuperAuguste
Copy link
Member

Oops sorry, will merge once ci passes:)

@SuperAuguste
Copy link
Member

LGTM!

@SuperAuguste SuperAuguste merged commit abe82f6 into zigtools:master Dec 11, 2021
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.

File size/LOC limit?

3 participants