You are not logged in.

#1 2021-02-15 19:10:20

corvid
Member
Registered: 2021-02-13
Posts: 10

[SOLVED] 'fetch: command not found' during v8 makepkg

Hello, I'm trying to install v8 (because rstan depends on it). I first installed depot_tools, and followed the instructions to export the path and change the permissions (see: https://aur.archlinux.org/packages/depo … nt-773146). Then cloned v8 from the AUR, but when I tried to makepkg, I got the following error:


harold@archlinux v8]$ makepkg -si
==> Making package: v8 8.7.220.25-1 (Mon 15 Feb 2021 10:20:06 AM PST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found v8.pc
  -> Found d8
==> Validating source files with sha512sums...
    v8.pc ... Passed
    d8 ... Passed
==> Extracting sources...
==> Starting prepare()...
/home/harold/v8/PKGBUILD: line 54: fetch: command not found
==> ERROR: A failure occurred in prepare().
    Aborting...


fetch seems to be a command in depot_tools.  I verified that depot tools is on my $PATH. Any suggestions on how to proceed would be much appreciated!  Perhaps I'm setting the wrong path? Or the path that I'm setting isn't available to makepkg? Thank you!

Last edited by corvid (2021-02-16 00:43:05)

Offline

#2 2021-02-15 20:14:56

loqs
Member
Registered: 2014-03-06
Posts: 13,005

Re: [SOLVED] 'fetch: command not found' during v8 makepkg

What is the output of the following?

echo $PATH
type -a fetch

Did you follow all the of the steps from https://aur.archlinux.org/packages/depo … ned-773146?
Please use code tags for commands and their outputs.

Offline

#3 2021-02-15 20:40:18

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 10,201
Website

Re: [SOLVED] 'fetch: command not found' during v8 makepkg

Mod note: Moving to AUR Issues


Sakura:-
Mobo: MSI X299 TOMAHAWK ARCTIC // Processor: Intel Core i7-7820X 3.6GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 5x 1TB HDD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#4 2021-02-15 20:43:43

corvid
Member
Registered: 2021-02-13
Posts: 10

Re: [SOLVED] 'fetch: command not found' during v8 makepkg

 $ echo $PATH
/opt/depot_tools:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl 

(EDIT -- corrected typo in output)

and

$ type -a fetch
bash: type: fetch: not found

Yes, I followed the directions on that link (without errors).  And it seems like it successfully set up an alternate access method:

$ sudo ls -l /opt
total 20
drwxrwxr-x+ 14 root root 12288 Feb 15 10:09 depot_tools

Thanks for the formatting tips!

Last edited by corvid (2021-02-15 21:21:32)

Offline

#5 2021-02-15 21:11:39

loqs
Member
Registered: 2014-03-06
Posts: 13,005

Re: [SOLVED] 'fetch: command not found' during v8 makepkg

$ echo $PATH
opt/depot_tools:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl

Missing / before opt.
Although the PKGBUILD for v8 adds /opt/depot_tools to the path itself.
Edit:
Fails miserably in a clean chroot trying to write to /opt/depot_tools but that is not your issue.

Last edited by loqs (2021-02-15 21:22:30)

Offline

#6 2021-02-15 21:22:45

corvid
Member
Registered: 2021-02-13
Posts: 10

Re: [SOLVED] 'fetch: command not found' during v8 makepkg

Realized that the missing / in my output was a typo. Sorry -- just corrected it in my post.

Last edited by corvid (2021-02-15 21:22:57)

Offline

#7 2021-02-15 21:37:10

loqs
Member
Registered: 2014-03-06
Posts: 13,005

Re: [SOLVED] 'fetch: command not found' during v8 makepkg

type could not find it,  though the path looks correct.

getfacl /opt/depot_tools/fetch

This fixed my different issue although it probably would be better to drop the depot-tools package from depends and add it as a source:

diff --git a/PKGBUILD b/PKGBUILD
index 2859d63..9476b31 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -30,9 +30,10 @@ esac
 OUTDIR="out/$V8_ARCH.release/"
 
 # Add depot_tools and python2 to $PATH
-TEMPDIR=$(mktemp -d)
-ln -s $(which python2) "$TEMPDIR/python"
-export PATH=/opt/depot_tools:$TEMPDIR:$PATH
+TEMPDIR=$(mktemp -d -p "$PWD")
+ln -s /usr/bin/python2 "$TEMPDIR/python"
+cp -r /opt/depot_tools/* "$TEMPDIR"
+export PATH=$TEMPDIR:$PATH
 
 prepare() {
        cd "$srcdir/"

Offline

#8 2021-02-15 22:16:30

corvid
Member
Registered: 2021-02-13
Posts: 10

Re: [SOLVED] 'fetch: command not found' during v8 makepkg

Thanks for your help. I changed the PKGBUILD file in my v8 directory as you suggested, but there still seems to be an error in my permissions:

$ makepkg -si
cp: cannot stat '/opt/depot_tools/*': Permission denied
==> Making package: v8 8.7.220.25-1 (Mon 15 Feb 2021 02:00:31 PM PST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found v8.pc
  -> Found d8
==> Validating source files with sha512sums...
    v8.pc ... Passed
    d8 ... Passed
==> Extracting sources...
==> Starting prepare()...
/home/harold/v8/PKGBUILD: line 58: fetch: command not found
==> ERROR: A failure occurred in prepare().
    Aborting...

Based on the following output though, it seems like I have permission to execute fetch:

$ sudo getfacl /opt/depot_tools/fetch
getfacl: Removing leading '/' from absolute path names
# file: opt/depot_tools/fetch
# owner: root
# group: root
user::rwx
group::r-x
other::r-x

Offline

#9 2021-02-15 22:28:21

loqs
Member
Registered: 2014-03-06
Posts: 13,005

Re: [SOLVED] 'fetch: command not found' during v8 makepkg

Add more output:

diff --git a/PKGBUILD b/PKGBUILD
index 2859d63..53d1e92 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -30,9 +30,12 @@ esac
 OUTDIR="out/$V8_ARCH.release/"
 
 # Add depot_tools and python2 to $PATH
-TEMPDIR=$(mktemp -d)
-ln -s $(which python2) "$TEMPDIR/python"
-export PATH=/opt/depot_tools:$TEMPDIR:$PATH
+TEMPDIR=$(mktemp -d -p "$PWD")
+ln -s /usr/bin/python2 "$TEMPDIR/python"
+cp -r /opt/depot_tools/* "$TEMPDIR"
+export PATH="$TEMPDIR:$PATH"
+echo "$PATH"
+stat "$TEMPDIR/fetch"
 
 prepare() {
        cd "$srcdir/"

Last edited by loqs (2021-02-15 22:42:22)

Offline

#10 2021-02-15 22:46:26

corvid
Member
Registered: 2021-02-13
Posts: 10

Re: [SOLVED] 'fetch: command not found' during v8 makepkg

$ makepkg -si
cp: cannot stat '/opt/depot_tools/*': Permission denied
/home/harold/v8/tmp.cqcCuBi8ZO:/opt/depot_tools:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
stat: cannot statx '/home/harold/v8/tmp.cqcCuBi8ZO/fetch': No such file or directory
==> Making package: v8 8.7.220.25-1 (Mon 15 Feb 2021 02:44:26 PM PST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found v8.pc
  -> Found d8
==> Validating source files with sha512sums...
    v8.pc ... Passed
    d8 ... Passed
==> Extracting sources...
==> Starting prepare()...
/home/harold/v8/PKGBUILD: line 61: fetch: command not found
==> ERROR: A failure occurred in prepare().
    Aborting...

Offline

#11 2021-02-15 22:50:54

loqs
Member
Registered: 2014-03-06
Posts: 13,005

Re: [SOLVED] 'fetch: command not found' during v8 makepkg

cp: cannot stat '/opt/depot_tools/*': Permission denied

Well that is the problem.  Do not use sudo for the next commands

getfacl /opt/depot_tools
getfacl /opt/depot_tools/fetch

Offline

#12 2021-02-15 23:03:10

corvid
Member
Registered: 2021-02-13
Posts: 10

Re: [SOLVED] 'fetch: command not found' during v8 makepkg

Both require root permission:

$ getfacl /opt/depot_tools
getfacl: /opt/depot_tools: Permission denied
$ getfacl /opt/depot_tools/fetch
getfacl: /opt/depot_tools/fetch: Permission denied

Offline

#13 2021-02-15 23:16:23

loqs
Member
Registered: 2014-03-06
Posts: 13,005

Re: [SOLVED] 'fetch: command not found' during v8 makepkg

Permissions on /opt are the issue then,  again without sudo

$ getfacl /opt/

Offline

#14 2021-02-15 23:19:56

corvid
Member
Registered: 2021-02-13
Posts: 10

Re: [SOLVED] 'fetch: command not found' during v8 makepkg

That one is fine:

$ getfacl /opt/
getfacl: Removing leading '/' from absolute path names
# file: opt/
# owner: root
# group: root
user::---
group::---
other::---

Last edited by corvid (2021-02-15 23:20:11)

Offline

#15 2021-02-15 23:25:05

loqs
Member
Registered: 2014-03-06
Posts: 13,005

Re: [SOLVED] 'fetch: command not found' during v8 makepkg

Compare with my system

getfacl /opt
getfacl: Removing leading '/' from absolute path names
# file: opt
# owner: root
# group: root
user::rwx
group::r-x
other::r-x

Your system allows no access to anyone,  root can bypass the permissions check so is not affected.

# chmod 755 /opt

Edit:
The following would work as well by not using the depot-tools package instead downloading it in the same manner as electron

diff --git a/PKGBUILD b/PKGBUILD
index 2859d63..fbf6731 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -14,13 +14,15 @@ url="https://v8.dev/"
 license=('BSD')
 depends=(icu)
 optdepends=('rlwrap: readline support')
-makedepends=(depot-tools-git python2)
+makedepends=(python2 git)
 conflicts=(v8-3.14 v8-3.14-bin v8-6.7-static v8-6.8 v8-r v8-static-gyp v8-static-gyp-5.4)
 # TODO: Dynamic library
 options=(staticlibs)
-source=("$pkgname.pc" d8)
+source=("$pkgname.pc" d8
+        'git+https://chromium.googlesource.com/chromium/tools/depot_tools.git')
 sha512sums=('25b44dfc7b0525a6396990149478cfd8bfcddbe2cdd1af99263bd116b774206fcec920294515b036576721c4da89150610ea26e99987a640d73cb7211dfd4934'
-            '5aa6fea4a6d2f84bdba2032dcc00a79e3169c49066cc055a5106f858834db38dec3257f7a435aa518eb57eb4dfe4a3e092e2486c522362d49a61dfd92fba5717')
+            '5aa6fea4a6d2f84bdba2032dcc00a79e3169c49066cc055a5106f858834db38dec3257f7a435aa518eb57eb4dfe4a3e092e2486c522362d49a61dfd92fba5717'
+            'SKIP')
 
 case "$CARCH" in
 	'x86_64') V8_ARCH='x64' ;;
@@ -29,12 +31,11 @@ esac
 
 OUTDIR="out/$V8_ARCH.release/"
 
-# Add depot_tools and python2 to $PATH
-TEMPDIR=$(mktemp -d)
-ln -s $(which python2) "$TEMPDIR/python"
-export PATH=/opt/depot_tools:$TEMPDIR:$PATH
-
 prepare() {
+	mkdir -p "${srcdir}"/python2-path
+	ln -sf /usr/bin/python2 "${srcdir}/python2-path/python"
+	export PATH="${srcdir}/python2-path:${PATH}:${srcdir}/depot_tools"
+	export DEPOT_TOOLS_UPDATE=0
 	cd "$srcdir/"
 
 	# Fill pkg-config fields

Last edited by loqs (2021-02-15 23:27:57)

Offline

#16 2021-02-16 00:03:23

corvid
Member
Registered: 2021-02-13
Posts: 10

Re: [SOLVED] 'fetch: command not found' during v8 makepkg

I tried the chmod solution (Thank you!), and that seemed to solve the initial issue. Now it runs for about 15 minutes, but seems not to be able to access Google's protobuf, and struggles with duplicate directories.  Here's the full output: http://codepad.org/qgh7gpSd

Offline

#17 2021-02-16 00:09:06

loqs
Member
Registered: 2014-03-06
Posts: 13,005

Re: [SOLVED] 'fetch: command not found' during v8 makepkg

Try the following to revert to the PKGBUILD from AUR not the initial issue is resolved:

git reset --hard

Then run makepkg again see if the network issue was an intermittent fault.  I did not encounter it during testing,  although check failed I did not investigate that.

Last edited by loqs (2021-02-16 00:09:37)

Offline

#18 2021-02-16 00:22:01

corvid
Member
Registered: 2021-02-13
Posts: 10

Re: [SOLVED] 'fetch: command not found' during v8 makepkg

Reverting back to the vanilla PKGBUILD resulted in permission issues. It seems that it's trying to write in /opt/depot_tools/...
but it doesn't have write permission. I thought it would just need to execute files from /opt/ and wouldn't need to write, or maybe I'm misreading the error.

Thank you so much for your patience and help!

$ makepkg -si
==> Making package: v8 8.7.220.25-1 (Mon 15 Feb 2021 04:16:29 PM PST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found v8.pc
  -> Found d8
==> Validating source files with sha512sums...
    v8.pc ... Passed
    d8 ... Passed
==> Extracting sources...
==> Starting prepare()...
HEAD is now at 3337e3b9f9 [sparkplug] Drop v8:11429 from LazyNode<Context|FBV> ideas
mktemp: failed to create file via template ‘/opt/depot_tools/.cipd_client.XXXXXXX’: Permission denied
curl: (23) Failure writing output to destination
mktemp: failed to create file via template ‘/opt/depot_tools/.cipd_client.XXXXXXX’: Permission denied
curl: (23) Failure writing output to destination
/opt/depot_tools/bootstrap_python3: line 32: bootstrap-3.8.0.chromium.8_bin/python3/bin/python3: No such file or directory
mktemp: failed to create file via template ‘/opt/depot_tools/.cipd_client.XXXXXXX’: Permission denied
curl: (23) Failure writing output to destination
/opt/depot_tools/bootstrap_python3: line 32: bootstrap-3.8.0.chromium.8_bin/python3/bin/python3: No such file or directory
cat: /opt/depot_tools/python3_bin_reldir.txt: No such file or directory
/opt/depot_tools/vpython3: line 52: /opt/depot_tools/.cipd_bin/vpython3: No such file or directory
==> ERROR: A failure occurred in prepare().
    Aborting...

Offline

#19 2021-02-16 00:30:04

loqs
Member
Registered: 2014-03-06
Posts: 13,005

Re: [SOLVED] 'fetch: command not found' during v8 makepkg

Without sudo:

$ getfacl /opt/depot_tools
$ groups

or try the fix in my edit to post #15

Offline

#20 2021-02-16 00:42:01

corvid
Member
Registered: 2021-02-13
Posts: 10

Re: [SOLVED] 'fetch: command not found' during v8 makepkg

Thanks everyone for help figuring this out. I found a workaround to avoid having to deal with v8's dependency issues.

There's now an option to install a static build of v8 via an R package. This avoids all of the issues I've been experiencing, and enables me to now download and run rstan.
Hopefully the issues I was having were isolated, but If other Arch users run into this issue installing v8 from AUR,  and just want v8 to use rstan, then start an R console and run:

# For Linux: download libv8 during installation
Sys.setenv(DOWNLOAD_STATIC_LIBV8=1)
install.packages("V8")

After that you should be able to install rstan.

Here are more details: https://ropensci.org/blog/2020/11/12/installing-v8/

Last edited by corvid (2021-02-16 00:43:39)

Offline

Board footer

Powered by FluxBB