-
Notifications
You must be signed in to change notification settings - Fork 48
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
zig: upgrade to 0.12.0-dev.2043+6ebeb85ab #140
Conversation
Fix the following errors when compiling to 0.12.0-dev.1879+e19219fa0: zig-wrapper.zig:431:13: error: local variable is never mutated zig-wrapper.zig:431:13: note: consider using 'const' zig-wrapper.zig:331:9: error: local variable is never mutated zig-wrapper.zig:331:9: note: consider using 'const' Otherwise version upgrade will come soon (tm).
88713d4
to
e5effb4
Compare
Notable changes: - bump glibc support from 2.34 to 2.38 - fix integration with some glibc symbols: ziglang/zig#17702 - mitigat `error: AccessDenied`, which, according to Noah Santschi-Cooney, also mitigates/fixes the dreaded `error: FileNotFound` which we sometimes see when setting up Bazel worksace. Relevant commit in Zig: ziglang/zig@6b27096 Fixes #133
e5effb4
to
13b6062
Compare
This PR breaks [email protected] built on Linux with rules_foreign_cc@2ee029a7448d578da178f232bbb14d9191a32701. The failing target is: load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake")
filegroup(
name = "all_srcs",
srcs = glob(
include = ["**"],
exclude = ["*.bazel"],
),
)
cmake(
name = "zlib-static-lib",
cache_entries = select({
"@platforms//os:linux": {
"CMAKE_C_FLAGS": "${CMAKE_C_FLAGS:-} -fPIC",
},
"//conditions:default": {},
}),
generate_args = [],
lib_source = "all_srcs",
out_static_libs = ["libz.a"],
) Error log:
cc @xytan0056 |
Can you paste the full workspace, with zlib srcs, or something where I can repro this fully? |
You can build
|
Just reproduced this without bazel:
|
Also with zlib-1.3. Also fails with zlib-1.3 and llvm lld 17 (no zig):
Works with ld.lld-16. |
Works with
With the following changes to diff --git a/src/main.zig b/src/main.zig
index 4442234bd..6c440770c 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -898,6 +898,7 @@ fn buildOutputType(
var rc_includes: Compilation.RcIncludes = .any;
var manifest_file: ?[]const u8 = null;
var linker_export_symbol_names: std.ArrayListUnmanaged([]const u8) = .{};
+ var use_lld: ?bool = null;
// Tracks the position in c_source_files which have already their owner populated.
var c_source_files_owner_index: usize = 0;
@@ -1928,6 +1929,10 @@ fn buildOutputType(
}
if (mem.eql(u8, linker_arg, "--build-id")) {
build_id = .fast;
+ } else if (mem.eql(u8, linker_arg, "--no-lld")) {
+ use_lld = false;
+ } else if (mem.eql(u8, linker_arg, "--use-lld")) {
+ use_lld = true;
} else if (mem.eql(u8, linker_arg, "--as-needed")) {
needed = false;
} else if (mem.eql(u8, linker_arg, "--no-as-needed")) {
@@ -2683,6 +2688,7 @@ fn buildOutputType(
create_module.opts.emit_llvm_ir = emit_llvm_ir != .no;
create_module.opts.emit_llvm_bc = emit_llvm_bc != .no;
create_module.opts.emit_bin = emit_bin != .no;
+ create_module.opts.use_lld = use_lld;
create_module.opts.any_c_source_files = create_module.c_source_files.items.len != 0;
const main_mod = try createModule(gpa, arena, &create_module, 0, null, zig_lib_directory); |
Seems like a workaround is here: madler/zlib#865 cc @linzhp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tested this with madler/zlib#865 in Uber. Everything passed.
Notable changes:
error: AccessDenied
, which, according to Noah Santschi-Cooney, also mitigates/fixes the dreadederror: FileNotFound
which we sometimes see when setting up Bazel worksace. Relevant commit in Zig: ziglang/zig@6b27096Fixes #133