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 摘要。