第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

在具有兩個 Nix Flake 的設(shè)置中,其中一個為另一個應用程序提供插件如何解決?

在具有兩個 Nix Flake 的設(shè)置中,其中一個為另一個應用程序提供插件如何解決?

Go
拉風的咖菲貓 2022-10-24 10:15:45
我有兩個 Nix Flakes:一個包含一個應用程序,另一個包含該應用程序的插件。當我使用插件構(gòu)建應用程序時,出現(xiàn)錯誤error: path '/nix/store/3b7djb5pr87zbscggsr7vnkriw3yp21x-mainapp-go-modules' is not valid我不知道這個錯誤意味著什么以及如何修復它,但我可以在 macOS 和 Linux 上重現(xiàn)它。有問題的路徑是vendor第一步生成的目錄buildGoModule。重現(xiàn)錯誤的最小設(shè)置需要一堆文件,因此我提供了一個帶注釋的 bash 腳本,您可以在空文件夾中執(zhí)行該腳本來重新創(chuàng)建我的設(shè)置:#!/bin/bash# I have two flakes: the main application and a plugin.# the mainapp needs to be inside the plugin directory# so that nix doesn't complain about the path:mainapp# reference being outside the parent's root.mkdir -p plugin/mainapp# each is a go module with minimal setuptee plugin/mainapp/go.mod <<EOF >/dev/nullmodule example.com/mainappgo 1.16EOFtee plugin/go.mod <<EOF >/dev/nullmodule example.com/plugingo 1.16EOF# each contain minimal Go codetee plugin/mainapp/main.go <<EOF >/dev/nullpackage mainimport "fmt"func main() {    fmt.Println("Hello, World!")}EOFtee plugin/main.go <<EOF >/dev/nullpackage pluginimport logfunc init() {    fmt.Println("initializing plugin")}EOF# the mainapp is a flake that provides a function for building# the app, as well as a default package that is the app# without any plugins.tee plugin/mainapp/flake.nix <<'EOF' >/dev/null{  description = "main application";  inputs = {    nixpkgs.url = github:NixOS/nixpkgs/nixos-21.11;    flake-utils.url = github:numtide/flake-utils;  }; 您需要安裝了 Flake 支持的 Nix 來重現(xiàn)錯誤。在plugin此腳本創(chuàng)建的文件夾中,執(zhí)行$ nix buildtrace: sources at /nix/store/d5arinbiaspyjjc4ypk4h5dsjx22pcsf-mainapp-with-plugins-sourceerror: path '/nix/store/3b7djb5pr87zbscggsr7vnkriw3yp21x-mainapp-go-modules' is not valid(如果你得到散列不匹配,只需用正確的散列更新薄片;我不太確定在存儲庫之外散布薄片時散列是否可重現(xiàn)。)源目錄(由跟蹤顯示)確實存在并且看起來不錯。錯誤消息中給出的路徑也存在并且包含modules.txt預期的內(nèi)容。在文件夾mainapp中,nix build確實運行成功,它構(gòu)建了沒有插件的應用程序。那么我對使路徑無效的插件做了什么?
查看完整描述

1 回答

?
米琪卡哇伊

TA貢獻1998條經(jīng)驗 獲得超6個贊

原因是在這種情況下modules.txt,作為 vendoring 一部分生成的文件將在replace指令中包含 nix 存儲路徑。該vendor目錄是一個固定的輸出派生,因此不得依賴于任何其他派生。中的引用違反了這一點modules.txt。

這只能通過將插件的源復制到sources派生中來解決 - 這樣,replace路徑可以是相對的,因此不會引用其他 nix 存儲路徑。


查看完整回答
反對 回復 2022-10-24
  • 1 回答
  • 0 關(guān)注
  • 106 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號