From owner-freebsd-ports@freebsd.org Sun Oct 6 13:09:16 2019 Return-Path: Delivered-To: freebsd-ports@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C7D2FFAAD5 for ; Sun, 6 Oct 2019 13:09:16 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 46mP8D4zTdz4Hm4 for ; Sun, 6 Oct 2019 13:09:16 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id A8FE8FAAD4; Sun, 6 Oct 2019 13:09:16 +0000 (UTC) Delivered-To: ports@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A8C0CFAAD3 for ; Sun, 6 Oct 2019 13:09:16 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46mP8D3zD0z4Hm3 for ; Sun, 6 Oct 2019 13:09:16 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1354) id 67E26B2A3; Sun, 6 Oct 2019 13:09:16 +0000 (UTC) From: Jan Beich To: ports@FreeBSD.org Subject: USES=cargo vs. workspaces Date: Sun, 06 Oct 2019 15:09:11 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Oct 2019 13:09:16 -0000 Some projects (e.g., Servo, Veloren) bundle several packages together. When dependencies also bundle packages it confuses "git" override. Any tips/workarounds that scale beyond 1 port? For example, $ cat Makefile PORTNAME= veloren DISTVERSIONSUFFIX= v DISTVERSION= 0.3.0 CATEGORIES= games USES= cargo USE_GITLAB= yes GL_COMMIT= ef049607e008223d6f9d8a021dd00e1eeef44b5e .sinclude "${.CURDIR}/Makefile.crates" .include $ make clean patch NO_CHECKSUM= $ make cargo-crates >Makefile.crates $ make makesum $ make clean all [...] ===> Configuring for veloren-0.3.0 error: failed to load source for a dependency on `conrod_core` Caused by: Unable to update WRKDIR/conrod-d603363488870eae9df91ba45ba795509c8a6ab4-d603363488870eae9df91ba45ba795509c8a6ab4 Caused by: found a virtual manifest at `WRKDIR/conrod-d603363488870eae9df91ba45ba795509c8a6ab4-d603363488870eae9df91ba45ba795509c8a6ab4/Cargo.toml` instead of a package manifest *** Error code 101 Stop. After the override `conrod_core` package path points to a directory with multiple packages defined via workspaces. If the path is refined to point to a subdirectory (where [package] is defined) then build moves on to the next error. $ rg -t toml conrod_core $(make -V WRKSRC) WRKSRC/Cargo.lock 421:name = "conrod_core" 2962: "conrod_core 0.63.0 (git+https://gitlab.com/veloren/conrod.git)", 3245:"checksum conrod_core 0.63.0 (git+https://gitlab.com/veloren/conrod.git)" = "" WRKSRC/voxygen/Cargo.toml 25:conrod_core = { path = "WRKDIR/conrod-d603363488870eae9df91ba45ba795509c8a6ab4-d603363488870eae9df91ba45ba795509c8a6ab4/conrod_core" } $ cat $(make -V WRKDIR)/conrod-*/Cargo.toml [workspace] members = [ "conrod_core", "conrod_derive", "backends/conrod_example_shared", "backends/conrod_winit", "backends/conrod_gfx", "backends/conrod_glium", "backends/conrod_piston", "backends/conrod_vulkano", ] $ sed -i.bak '/conrod_core/s,"\(.*\)","\1/conrod_core",' $(make -V WRKSRC)/voxygen/Cargo.toml $ diff $(make -V WRKSRC)/voxygen/Cargo.toml.bak $(make -V WRKSRC)/voxygen/Cargo.toml --- WRKSRC/voxygen/Cargo.toml.bak +++ WRKSRC/voxygen/Cargo.toml @@ -22,7 +22,7 @@ gfx_device_gl = { version = "0.16.1", optional = true gfx_window_glutin = "0.31.0" glutin = "0.21.0" winit = { version = "0.19.1", features = ["serde"] } -conrod_core = { path = "WRKDIR/conrod-d603363488870eae9df91ba45ba795509c8a6ab4-d603363488870eae9df91ba45ba795509c8a6ab4" } +conrod_core = { path = "WRKDIR/conrod-d603363488870eae9df91ba45ba795509c8a6ab4-d603363488870eae9df91ba45ba795509c8a6ab4/conrod_core" } conrod_winit = { path = "WRKDIR/conrod-d603363488870eae9df91ba45ba795509c8a6ab4-d603363488870eae9df91ba45ba795509c8a6ab4" } euc = "0.3.0" $ make ===> Configuring for veloren-0.3.0 error: failed to load source for a dependency on `conrod_winit` Caused by: Unable to update WRKDIR/conrod-d603363488870eae9df91ba45ba795509c8a6ab4-d603363488870eae9df91ba45ba795509c8a6ab4 Caused by: found a virtual manifest at `WRKDIR/conrod-d603363488870eae9df91ba45ba795509c8a6ab4-d603363488870eae9df91ba45ba795509c8a6ab4/Cargo.toml` instead of a package manifest *** Error code 101 Stop. Note, before and after the override the location of `conrod_core` was ambiguous i.e., neither "package" nor subdirectory was specified. $ diff $(make -V WRKSRC)/voxygen/Cargo.toml{.dist,} [...] @@ -22,8 +22,8 @@ gfx_device_gl = { version = "0.16.1", optional = true gfx_window_glutin = "0.31.0" glutin = "0.21.0" winit = { version = "0.19.1", features = ["serde"] } -conrod_core = { git = "https://gitlab.com/veloren/conrod.git" } -conrod_winit = { git = "https://gitlab.com/veloren/conrod.git" } +conrod_core = { path = "WRKDIR/conrod-d603363488870eae9df91ba45ba795509c8a6ab4-d603363488870eae9df91ba45ba795509c8a6ab4" } +conrod_winit = { path = "WRKDIR/conrod-d603363488870eae9df91ba45ba795509c8a6ab4-d603363488870eae9df91ba45ba795509c8a6ab4" } euc = "0.3.0" # ECS