Opened 3 years ago
Closed 3 years ago
#65183 closed defect (fixed)
rust: Portfile can fail to parse depending on build_arch
Reported by: | jmroot (Joshua Root) | Owned by: | MarcusCalhoun-Lopez (Marcus Calhoun-Lopez) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | Cc: | herbygillot (Herby Gillot) | |
Port: | rust |
Description
For example, on macOS 12:
% port info rust build_arch=i386 Error: Unable to open port: can't read "rustc_version": no such variable
It's fine for the port to only be installable for certain archs, but the Portfile should parse validly regardless of what platform or arch it is read on. This is probably what is preventing rust from showing up on ports.macports.org.
Change History (6)
comment:1 Changed 3 years ago by herbygillot (Herby Gillot)
Cc: | herbygillot added; MarcusCalhoun-Lopez removed |
---|---|
Owner: | changed from herbygillot to MarcusCalhoun-Lopez |
comment:2 Changed 3 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Clearly, a port should always be able to parse validly regardless of platform or architecture.
Anything less should be fixed right away.
However, I cannot reproduce this error.
The command port info rust build_arch=i386
does not produce an error on my system:
macOS 10.12.6 16G2136 x86_64 Xcode 9.2 9C40b Command Line Tools 9.2.0.0.1.1510905681
So we must now figure out what is different about the system where the error does occur.
This is just a guess, but port info rust muniversal.architectures=""
did produce an error on my system.
muniversal.architectures
should not be empty, but if it were, the error could be traced as follows:
- from the end
proc rust.add_bootstrap_components
- since
rustc_version
is not set in in the for loop - since
muniversal.architectures
is empty
Is there any reason to suspect that muniversal.architectures
is empty on the system where the error occurs?
comment:3 Changed 3 years ago by jmroot (Joshua Root)
Yes, muniversal.architectures
would be empty in any case where build_arch
is empty (normal on platforms other than macOS) or set to an arch that is not supported by the current SDK.
comment:4 Changed 3 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
There is a pull request that might solve the problem.
Unfortunately, I do not know how to properly test it.
comment:5 Changed 3 years ago by jmroot (Joshua Root)
An easy way to test is to run port info rust build_arch=
. The fix looks good, thanks.
comment:6 Changed 3 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Reassigning to MarcusCalhoun-Lopez who has made massive changes to the Rust port, which look like the origin of this issue.