authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-06-14 11:33:27-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-06-14 11:33:27-07:00
log193c529b8c9529c4303aeb3a8864dfee9b1d2485
treecefad76a85ae260c2b49ce8a613a778de562cb30
parent5a4249fa25ab789a8c060e5ba71ca8b0358e9c8d

CLI: rename --override-lib-dir to --zig-lib-dir

This breaking change disambiguates between overriding the lib dir when performing an installation with the Zig Build System, and overriding the lib dir that the Zig installation itself uses.

10 files changed, 17 insertions(+), 17 deletions(-)

CMakeLists.txt+2-2
...@@ -782,7 +782,7 @@ set(BUILD_ZIG1_ARGS...@@ -782,7 +782,7 @@ set(BUILD_ZIG1_ARGS
782 -target "${ZIG_TARGET_TRIPLE}"782 -target "${ZIG_TARGET_TRIPLE}"
783 "-mcpu=${ZIG_TARGET_MCPU}"783 "-mcpu=${ZIG_TARGET_MCPU}"
784 --name zig1784 --name zig1
785 --override-lib-dir "${CMAKE_SOURCE_DIR}/lib"785 --zig-lib-dir "${CMAKE_SOURCE_DIR}/lib"
786 "-femit-bin=${ZIG1_OBJECT}"786 "-femit-bin=${ZIG1_OBJECT}"
787 "${ZIG1_RELEASE_ARG}"787 "${ZIG1_RELEASE_ARG}"
788 "${ZIG1_SINGLE_THREADED_ARG}"788 "${ZIG1_SINGLE_THREADED_ARG}"
...@@ -836,7 +836,7 @@ set(ZIG_SKIP_INSTALL_LIB_FILES off CACHE BOOL...@@ -836,7 +836,7 @@ set(ZIG_SKIP_INSTALL_LIB_FILES off CACHE BOOL
836836
837if(NOT ZIG_SKIP_INSTALL_LIB_FILES)837if(NOT ZIG_SKIP_INSTALL_LIB_FILES)
838 set(ZIG_INSTALL_ARGS "build"838 set(ZIG_INSTALL_ARGS "build"
839 --override-lib-dir "${CMAKE_SOURCE_DIR}/lib"839 --zig-lib-dir "${CMAKE_SOURCE_DIR}/lib"
840 "-Dlib-files-only"840 "-Dlib-files-only"
841 --prefix "${CMAKE_INSTALL_PREFIX}"841 --prefix "${CMAKE_INSTALL_PREFIX}"
842 "-Dconfig_h=${ZIG_CONFIG_H_OUT}"842 "-Dconfig_h=${ZIG_CONFIG_H_OUT}"
ci/azure/linux_script+1-1
...@@ -79,7 +79,7 @@ if [ "${BUILD_REASON}" != "PullRequest" ]; then...@@ -79,7 +79,7 @@ if [ "${BUILD_REASON}" != "PullRequest" ]; then
79 # Produce the experimental std lib documentation.79 # Produce the experimental std lib documentation.
80 mkdir -p release/docs/std80 mkdir -p release/docs/std
81 release/bin/zig test ../lib/std/std.zig \81 release/bin/zig test ../lib/std/std.zig \
82 --override-lib-dir ../lib \82 --zig-lib-dir ../lib \
83 -femit-docs=release/docs/std \83 -femit-docs=release/docs/std \
84 -fno-emit-bin84 -fno-emit-bin
8585
ci/azure/macos_arm64_script+1-1
...@@ -94,7 +94,7 @@ if [ "${BUILD_REASON}" != "PullRequest" ]; then...@@ -94,7 +94,7 @@ if [ "${BUILD_REASON}" != "PullRequest" ]; then
94 # Produce the experimental std lib documentation.94 # Produce the experimental std lib documentation.
95 mkdir -p release/docs/std95 mkdir -p release/docs/std
96 $ZIG test ../lib/std/std.zig \96 $ZIG test ../lib/std/std.zig \
97 --override-lib-dir ../lib \97 --zig-lib-dir ../lib \
98 -femit-docs=release/docs/std \98 -femit-docs=release/docs/std \
99 -fno-emit-bin99 -fno-emit-bin
100100
lib/std/build.zig+2-2
...@@ -2716,10 +2716,10 @@ pub const LibExeObjStep = struct {...@@ -2716,10 +2716,10 @@ pub const LibExeObjStep = struct {
2716 }2716 }
27172717
2718 if (self.override_lib_dir) |dir| {2718 if (self.override_lib_dir) |dir| {
2719 try zig_args.append("--override-lib-dir");2719 try zig_args.append("--zig-lib-dir");
2720 try zig_args.append(builder.pathFromRoot(dir));2720 try zig_args.append(builder.pathFromRoot(dir));
2721 } else if (self.builder.override_lib_dir) |dir| {2721 } else if (self.builder.override_lib_dir) |dir| {
2722 try zig_args.append("--override-lib-dir");2722 try zig_args.append("--zig-lib-dir");
2723 try zig_args.append(builder.pathFromRoot(dir));2723 try zig_args.append(builder.pathFromRoot(dir));
2724 }2724 }
27252725
lib/std/crypto/benchmark.zig+1-1
...@@ -3,7 +3,7 @@...@@ -3,7 +3,7 @@
3// This file is part of [zig](https://ziglang.org/), which is MIT licensed.3// This file is part of [zig](https://ziglang.org/), which is MIT licensed.
4// The MIT license requires this copyright notice to be included in all copies4// The MIT license requires this copyright notice to be included in all copies
5// and substantial portions of the software.5// and substantial portions of the software.
6// zig run benchmark.zig --release-fast --override-lib-dir ..6// zig run benchmark.zig --release-fast --zig-lib-dir ..
77
8const std = @import("../std.zig");8const std = @import("../std.zig");
9const builtin = std.builtin;9const builtin = std.builtin;
lib/std/hash/benchmark.zig+1-1
...@@ -3,7 +3,7 @@...@@ -3,7 +3,7 @@
3// This file is part of [zig](https://ziglang.org/), which is MIT licensed.3// This file is part of [zig](https://ziglang.org/), which is MIT licensed.
4// The MIT license requires this copyright notice to be included in all copies4// The MIT license requires this copyright notice to be included in all copies
5// and substantial portions of the software.5// and substantial portions of the software.
6// zig run benchmark.zig --release-fast --override-lib-dir ..6// zig run benchmark.zig --release-fast --zig-lib-dir ..
77
8const builtin = std.builtin;8const builtin = std.builtin;
9const std = @import("std");9const std = @import("std");
lib/std/os.zig+1-1
...@@ -41,7 +41,7 @@ pub const wasi = @import("os/wasi.zig");...@@ -41,7 +41,7 @@ pub const wasi = @import("os/wasi.zig");
41pub const windows = @import("os/windows.zig");41pub const windows = @import("os/windows.zig");
4242
43comptime {43comptime {
44 assert(@import("std") == std); // std lib tests require --override-lib-dir44 assert(@import("std") == std); // std lib tests require --zig-lib-dir
45}45}
4646
47test {47test {
lib/std/special/build_runner.zig+3-3
...@@ -119,9 +119,9 @@ pub fn main() !void {...@@ -119,9 +119,9 @@ pub fn main() !void {
119 warn("expected [auto|on|off] after --color, found '{s}'", .{next_arg});119 warn("expected [auto|on|off] after --color, found '{s}'", .{next_arg});
120 return usageAndErr(builder, false, stderr_stream);120 return usageAndErr(builder, false, stderr_stream);
121 };121 };
122 } else if (mem.eql(u8, arg, "--override-lib-dir")) {122 } else if (mem.eql(u8, arg, "--zig-lib-dir")) {
123 builder.override_lib_dir = nextArg(args, &arg_idx) orelse {123 builder.override_lib_dir = nextArg(args, &arg_idx) orelse {
124 warn("Expected argument after --override-lib-dir\n\n", .{});124 warn("Expected argument after --zig-lib-dir\n\n", .{});
125 return usageAndErr(builder, false, stderr_stream);125 return usageAndErr(builder, false, stderr_stream);
126 };126 };
127 } else if (mem.eql(u8, arg, "--verbose-tokenize")) {127 } else if (mem.eql(u8, arg, "--verbose-tokenize")) {
...@@ -234,7 +234,7 @@ fn usage(builder: *Builder, already_ran_build: bool, out_stream: anytype) !void...@@ -234,7 +234,7 @@ fn usage(builder: *Builder, already_ran_build: bool, out_stream: anytype) !void
234 \\Advanced Options:234 \\Advanced Options:
235 \\ --build-file [file] Override path to build.zig235 \\ --build-file [file] Override path to build.zig
236 \\ --cache-dir [path] Override path to zig cache directory236 \\ --cache-dir [path] Override path to zig cache directory
237 \\ --override-lib-dir [arg] Override path to Zig lib directory237 \\ --zig-lib-dir [arg] Override path to Zig lib directory
238 \\ --verbose-tokenize Enable compiler debug output for tokenization238 \\ --verbose-tokenize Enable compiler debug output for tokenization
239 \\ --verbose-ast Enable compiler debug output for parsing into an AST239 \\ --verbose-ast Enable compiler debug output for parsing into an AST
240 \\ --verbose-link Enable compiler debug output for linking240 \\ --verbose-link Enable compiler debug output for linking
src/main.zig+3-3
...@@ -310,7 +310,7 @@ const usage_build_generic =...@@ -310,7 +310,7 @@ const usage_build_generic =
310 \\ --show-builtin Output the source of @import("builtin") then exit310 \\ --show-builtin Output the source of @import("builtin") then exit
311 \\ --cache-dir [path] Override the local cache directory311 \\ --cache-dir [path] Override the local cache directory
312 \\ --global-cache-dir [path] Override the global cache directory312 \\ --global-cache-dir [path] Override the global cache directory
313 \\ --override-lib-dir [path] Override path to Zig installation lib directory313 \\ --zig-lib-dir [path] Override path to Zig installation lib directory
314 \\ --enable-cache Output to cache directory; print path to stdout314 \\ --enable-cache Output to cache directory; print path to stdout
315 \\315 \\
316 \\Compile Options:316 \\Compile Options:
...@@ -888,7 +888,7 @@ fn buildOutputType(...@@ -888,7 +888,7 @@ fn buildOutputType(
888 if (i + 1 >= args.len) fatal("expected parameter after {s}", .{arg});888 if (i + 1 >= args.len) fatal("expected parameter after {s}", .{arg});
889 i += 1;889 i += 1;
890 override_global_cache_dir = args[i];890 override_global_cache_dir = args[i];
891 } else if (mem.eql(u8, arg, "--override-lib-dir")) {891 } else if (mem.eql(u8, arg, "--zig-lib-dir")) {
892 if (i + 1 >= args.len) fatal("expected parameter after {s}", .{arg});892 if (i + 1 >= args.len) fatal("expected parameter after {s}", .{arg});
893 i += 1;893 i += 1;
894 override_lib_dir = args[i];894 override_lib_dir = args[i];
...@@ -2664,7 +2664,7 @@ pub fn cmdBuild(gpa: *Allocator, arena: *Allocator, args: []const []const u8) !v...@@ -2664,7 +2664,7 @@ pub fn cmdBuild(gpa: *Allocator, arena: *Allocator, args: []const []const u8) !v
2664 i += 1;2664 i += 1;
2665 build_file = args[i];2665 build_file = args[i];
2666 continue;2666 continue;
2667 } else if (mem.eql(u8, arg, "--override-lib-dir")) {2667 } else if (mem.eql(u8, arg, "--zig-lib-dir")) {
2668 if (i + 1 >= args.len) fatal("expected argument after '{s}'", .{arg});2668 if (i + 1 >= args.len) fatal("expected argument after '{s}'", .{arg});
2669 i += 1;2669 i += 1;
2670 override_lib_dir = args[i];2670 override_lib_dir = args[i];
src/stage1/zig0.cpp+2-2
...@@ -351,7 +351,7 @@ int main(int argc, char **argv) {...@@ -351,7 +351,7 @@ int main(int argc, char **argv) {
351 out_name = argv[i];351 out_name = argv[i];
352 } else if (strcmp(arg, "--dynamic-linker") == 0) {352 } else if (strcmp(arg, "--dynamic-linker") == 0) {
353 dynamic_linker = argv[i];353 dynamic_linker = argv[i];
354 } else if (strcmp(arg, "--override-lib-dir") == 0) {354 } else if (strcmp(arg, "--zig-lib-dir") == 0) {
355 override_lib_dir = argv[i];355 override_lib_dir = argv[i];
356 } else if (strcmp(arg, "--library") == 0 || strcmp(arg, "-l") == 0) {356 } else if (strcmp(arg, "--library") == 0 || strcmp(arg, "-l") == 0) {
357 if (strcmp(argv[i], "c") == 0) {357 if (strcmp(argv[i], "c") == 0) {
...@@ -433,7 +433,7 @@ int main(int argc, char **argv) {...@@ -433,7 +433,7 @@ int main(int argc, char **argv) {
433 }433 }
434434
435 if (override_lib_dir == nullptr) {435 if (override_lib_dir == nullptr) {
436 fprintf(stderr, "missing --override-lib-dir\n");436 fprintf(stderr, "missing --zig-lib-dir\n");
437 return print_error_usage(arg0);437 return print_error_usage(arg0);
438 }438 }
439439