https://pantsbuild.org/ logo
#development
Title
# development
a

ancient-vegetable-10556

09/27/2021, 3:36 PM
I’m getting this error when bootstrapping Pants (I don’t have a go toolchain installed, it looks like we’re assuming one):
Copy code
$ GOPATH=/var/folders/0m/h2n902qn38b8555xq8z0w_h40000gn/T/tmpi5pul2c_ go get -d
  error: [Errno 2] No such file or directory: 'go'
  ----------------------------------------
  ERROR: Failed building wheel for dockerfile
f

fast-nail-55400

09/27/2021, 3:39 PM
Can you paste full log?
a

ancient-vegetable-10556

09/27/2021, 3:39 PM
Copy code
ERROR: Command errored out with exit status 1:
     command: /Users/chrisjrn/.cache/pants/pants_dev_deps/Darwin.arm64.arm.py39.venv/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/0m/h2n902qn38b8555xq8z0w_h40000gn/T/pip-install-_jvjn7pm/dockerfile_de31e4d181c743b0b4f4ea38511cb7bf/setup.py'"'"'; __file__='"'"'/private/var/folders/0m/h2n902qn38b8555xq8z0w_h40000gn/T/pip-install-_jvjn7pm/dockerfile_de31e4d181c743b0b4f4ea38511cb7bf/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/0m/h2n902qn38b8555xq8z0w_h40000gn/T/pip-record-372_50ar/install-record.txt --single-version-externally-managed --compile --install-headers /Users/chrisjrn/.cache/pants/pants_dev_deps/Darwin.arm64.arm.py39.venv/include/site/python3.9/dockerfile
         cwd: /private/var/folders/0m/h2n902qn38b8555xq8z0w_h40000gn/T/pip-install-_jvjn7pm/dockerfile_de31e4d181c743b0b4f4ea38511cb7bf/
    Complete output (5 lines):
    running install
    running build
    running build_ext
    $ GOPATH=/var/folders/0m/h2n902qn38b8555xq8z0w_h40000gn/T/tmpmb3p0tf7 go get -d
    error: [Errno 2] No such file or directory: 'go'
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/chrisjrn/.cache/pants/pants_dev_deps/Darwin.arm64.arm.py39.venv/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/0m/h2n902qn38b8555xq8z0w_h40000gn/T/pip-install-_jvjn7pm/dockerfile_de31e4d181c743b0b4f4ea38511cb7bf/setup.py'"'"'; __file__='"'"'/private/var/folders/0m/h2n902qn38b8555xq8z0w_h40000gn/T/pip-install-_jvjn7pm/dockerfile_de31e4d181c743b0b4f4ea38511cb7bf/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/0m/h2n902qn38b8555xq8z0w_h40000gn/T/pip-record-372_50ar/install-record.txt --single-version-externally-managed --compile --install-headers /Users/chrisjrn/.cache/pants/pants_dev_deps/Darwin.arm64.arm.py39.venv/include/site/python3.9/dockerfile Check the logs for full command output.
WARNING: You are using pip version 21.1.3; however, version 21.2.4 is available.
You should consider upgrading via the '/Users/chrisjrn/.cache/pants/pants_dev_deps/Darwin.arm64.arm.py39.venv/bin/python3.9 -m pip install --upgrade pip' command.

Failed to install requirements from /Users/chrisjrn/src/pants/3rdparty/python/requirements.txt.
f

fast-nail-55400

09/27/2021, 3:40 PM
looks like it is trying to build
dockerfile
PyPi package?
that could be 🤔 but is probably just 🤦
a

ancient-vegetable-10556

09/27/2021, 3:42 PM
It’s not entirely shocking that it would depend on Go code I guess
I’ll flag a ticket for this, and in the meantime install a go sdk on my own machine
I guess it’s either a matter of removing that dependency or updating our bootstrapper so that we have a go sdk installed
c

curved-television-6568

09/27/2021, 3:45 PM
I recently introduced the dependency on dockerfile. Thought the wheel included binaries so it wouldn't have to build the go code. Will look into it.
a

ancient-vegetable-10556

09/27/2021, 3:45 PM
I’m on an M1 mac, and they may not have built the ARM binaries
👍 1
c

curved-television-6568

09/27/2021, 3:45 PM
Ah..
a

ancient-vegetable-10556

09/27/2021, 3:45 PM
(and macos/aarch64 is a supported Pants platform now)
brew install golang
has fixed it for me on this machine
💯 1
e

enough-analyst-54434

09/27/2021, 3:56 PM
To be fair macos/aarch64 is only partly supported. Wheel publishing is fly by night, and - as in this case - the wider ecosystem doesn't support it well since it has not had time to catch up since macstadium, et. al have taken a while to catch up.
👍 1
h

hundreds-father-404

09/28/2021, 2:36 AM
Hmm this will impact all M1 users regardless of using Docker. Even if they don't have full support it would be great to avoid. @curved-television-6568 there is an alternative, install
dockerfile
via
PythonToolBase
and run the import parsing as a
Process
. See https://github.com/pantsbuild/pants/pull/12916 for an example with Terraform. Wdyt? (It also slows down the install for everyone because Pants has a new dependency. This impacts CI, which often clean installs Pants every time)
👍 1
c

curved-television-6568

09/28/2021, 5:25 AM
Yeah, sounds like a good idea. Will fix.
@hundreds-father-404 looking at the terraform module, I’m wondering why it is split up into three different libraries?
Just a little notice, that I’m a little stuck on https://github.com/pantsbuild/pants/pull/13027 so when there is a breather, any pointers would be welcome 🙂
👀 1
h

hundreds-father-404

09/28/2021, 6:11 PM
Hm @curved-television-6568 is there more to the error? So long as all you're doing is running
generate_all_lockfiles.sh
, it does not expect the lockfile to actually exist. Pants will do it for you. You could fwit run
./pants generate-lockfiles --resolve=dockerfile-parser
directly in the CLI, altho you'd need to set a couple options like
--backend-packages=pants.backend.experimental.docker
and
--dockerfile-parser-lockfile=<path>
🎯 1
c

curved-television-6568

09/28/2021, 6:13 PM
tried that first, but it started complaining, but that was without all the extra options for backend and versions etc.. perhaps it will work properly after running that dedicated generate-lockfiles first..
I’ll try..
OK, I managed to get the lockfile, with this crafty command line (wasn’t aware I had to pass all those options…
Copy code
$ ./pants --backend-packages="+['pants.backend.experimental.docker']" generate-lockfiles --resolve=dockerfile-parser --dockerfile-parser-version=dockerfile==3.2.0 --dockerfile-parser-interpreter-constraints="['>=3.6.1']" --dockerfile-parser-lockfile=src/python/pants/backend/docker/dockerfile_lockfile.txt
Perhaps not all of them are required, but some were, or I’d get issues.. like this one:
ValueError: You requested to generate a lockfile for dockerfile-parser because you included it in
--generate-lockfiles-resolve
, but
[dockerfile-parser].lockfile
is set to
<default>
so a lockfile will not be generated.
If you would like to generate a lockfile for dockerfile-parser, please set
[dockerfile-parser].lockfile
to the path where it should be generated and run again.
Thanks, I’ll cont. my work on this on my end now… 😉
h

hundreds-father-404

09/28/2021, 6:28 PM
Okay good, but still weird the script failed..it roughly does what you're running directly
c

curved-television-6568

09/28/2021, 6:33 PM
Yeah, well, the gen all script seems to work now that there is a file to begin with.. so a bootstrap issue, it would seem…