I can't update the package to the latest version due to an error at the build-tools compilation stage.
---- Building cmd/tools ... ----------------------------------------------------------------------------------------------------------------
OK [ 1/70] C: 237.9 ms, R: 0.000 ms cmd/tools/changelog_helper.v
OK [ 2/70] C: 259.3 ms, R: 0.000 ms cmd/tools/bench/map_clear.v
......
FAIL [70/70] C: 2065.7 ms, R: 0.000 ms cmd/tools/vdoc
>> compilation failed:
/home/user/.vmodules/markdown/src/html_experimental.v:67:55: error: cannot use `u32` as `int` in argument 1 to `char.vstring_with_len`
65 | off := unsafe { attr.substr_offsets[i] }
66 | size := unsafe { attr.substr_offsets[i + 1] - off }
67 | text := unsafe { (attr.text + off).vstring_with_len(size) }
| ~~~~
68 |
69 | match typ {
--------------------------------------------------------------------------------------------------------------------------------------------
To reproduce just failure 1 run: '/home/user/code/aur/vlang/src/v-39534459885e916e2765b5b0c0ed66ce15f0ab86/v' '/home/user/code/aur/vlang/src/v-39534459885e916e2765b5b0c0ed66ce15f0ab86/cmd/tools/vdoc'
Summary for building cmd/tools: 1 failed, 69 passed, 70 total. Elapsed time: 4254 ms, on 11 parallel jobs.
==> ERROR: A failure occurred in build().
Aborting...
As far as I understand, when building vdoc, it optionally uses the markdown module, if it is installed. And the build breaks if the module itself is outdated. In theory, i can update local modules before updating vlang. But I don't think it's right that an uninstalled package gets into my user's home directory during the build. And that the build of the system package itself depends on files in the home directory. As an alternative, I suggest isolating the build in PKGBUILD, redefining the home directory. Then there will be no errors during the build. And the user will then be able to update the necessary local modules themselves.
build() {
cd "v-${_v_commit_sha}"
local tmpdir="/tmp/${pkgname}-${_v_commit_sha}"
mkdir -p "$tmpdir" || { echo "Can't create temporary directory!"; exit 1; }
# Delete directory when exiting function (even if there is an error)
trap 'rm -rf "$tmpdir"' RETURN
# Redefining HOME and TMPDIR for Isolation
export HOME="$tmpdir"
export TMPDIR="$tmpdir"
CFLAGS="" LDFLAGS="" make prod=1 local=1
# Compile all tools
LDFLAGS='' ./v build-tools
}
Then the package is built successfully.
Pinned Comments
Chewing_Bever commented on 2022-08-07 07:25 (UTC)
I have disabled the
v up
command, as it can break the installed package.v up
changes the files in the resulting package after installation, meaning Pacman can't properly track its contents anymore.