Changes required for > v0.14.0?

未关闭
#8 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
python, zig
领域
build-system

调研方向

首先,使用所示的 build.zig.zon 和 build.zig,在 Zig 0.15.1 和目标 x86_64-linux-musl 下重现报告中的命令。然后检查错误中指出的依赖项 build.zig 位置,包括 ConfigHeader 和 zlib 的集成位置。依赖项成功构建,并且示例项目针对该目标完成 zig build,即表示完成。

由索引模型根据 Issue 内容生成。

描述

I want to pull in this dependency in my project so my program can ingest python scripts and run them with some behaviour added. But just trying to get a basic version of this dependency pulled in on zig v0.15.1 doesn't work. Here is the basic and relevant examples:

build.zig.zon:

.{
    .minimum_zig_version = "0.15.1",
    .dependencies = .{
        .cpython = .{
            .url = "git+https://github.com/allyourcodebase/cpython.git#b9871b745dd11dd9b08e7ad1c8493403149a6f08",
            .hash = "cpython-0.0.0-FN2rG3bEAQBfgfSVEVG1RkY4uwykTHwl6wM2gOD9xHMD",
        },
    },
}

build.zig:

const std = @import("std");

pub fn build(b: *std.Build) void {
    const target = b.standardTargetOptions(.{});
    const optimize = b.standardOptimizeOption(.{});

    const cpython_dep = b.dependency("cpython", .{
        .target = target,
        .optimize = optimize,
    });
    const cpython_module = cpython_dep.module("cpython");

    const exe = b.addExecutable(.{
        .name = "testing",
        .root_module = b.createModule(.{
            .root_source_file = b.path("src/main.zig"),
            .target = target,
            .optimize = optimize,
        }),
    });

    exe.root_module.addImport("cpython", cpython_module);

    b.installArtifact(exe);
}

the command im running and zig version:

ash@minty:~/git/personal/testing$ zig version
0.15.1
ash@minty:~/git/personal/testing$ zig build -Dtarget=x86_64-linux-musl
/home/ash/.cache/zig/p/cpython-0.0.0-FN2rG3bEAQBfgfSVEVG1RkY4uwykTHwl6wM2gOD9xHMD/build.zig:1238:22: error: no field named 'autoconf' in union 'Build.Step.ConfigHeader.Style'
        .style = .{ .autoconf = upstream.path("pyconfig.h.in") },
                     ^~~~~~~~
/usr/local/zig/lib/std/Build/Step/ConfigHeader.zig:7:19: note: union declared here
pub const Style = union(enum) {
                  ^~~~~
referenced by:
    build: /home/ash/.cache/zig/p/cpython-0.0.0-FN2rG3bEAQBfgfSVEVG1RkY4uwykTHwl6wM2gOD9xHMD/build.zig:96:42
    runBuild__anon_76637: /usr/local/zig/lib/std/Build.zig:2215:44
    10 reference(s) hidden; use '-freference-trace=12' to see all references
/home/ash/.cache/zig/p/zlib-1.3.1-ZZQ7lVgMAACwO4nUUd8GLhsuQ5JQq_VAhlEiENJTUv6h/build.zig:5:18: error: no field or member function named 'addStaticLibrary' in 'Build'
    const lib = b.addStaticLibrary(.{
                ~^~~~~~~~~~~~~~~~~
/usr/local/zig/lib/std/Build.zig:1:1: note: struct declared here
const std = @import("std.zig");
^~~~~
/home/ash/.cache/zig/p/zlib-1.3.1-ZZQ7lVgMAACwO4nUUd8GLhsuQ5JQq_VAhlEiENJTUv6h/build.zig:5:18: note: method invocation only supports up to one level of implicit pointer dereferencing
/home/ash/.cache/zig/p/zlib-1.3.1-ZZQ7lVgMAACwO4nUUd8GLhsuQ5JQq_VAhlEiENJTUv6h/build.zig:5:18: note: use '.*' to dereference pointer

If this is something different and this is actually a me problem i apologise but would very much appreciate you pointing me in the right direction. I have not been able to figure this out and grok is suggesting is incompatibility with my zig version.

主要语言
Zig
星标
19
派生
7
PR 合并指标
30 天内没有已合并 PR

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

allyourcodebase/cpython 的其他 Issue

查看 allyourcodebase/cpython 的全部 Issue

相似的 Issue

更多 Build System Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。