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

average-cpu-49873

08/12/2019, 6:04 PM
Let me know if there's a better channel to post this question. If I were wanting to use a different version of yarn package manager, how would I point Pants to use a binary hosted at an endpoint such as
<https://github.com/yarnpkg/yarn/releases/download/<version>/yarn-<version>.tar.gz>
, where the
<version>
is specified in the Pants options like so?
Copy code
binaries_baseurls: +[
    '<https://binaries.pantsbuild.org>',
    '<https://github.com/yarnpkg/yarn/releases/download>',
  ]

[yarnpkg-distribution]
version: v1.17.3
The root of the issue is that Pants is expecting a specific folder structure
<https://github.com/yarnpkg/yarn/releases/download/bin/yarnpkg/mac/10.13/v1.17.3/yarnpkg.tar.gz>
, and I'm wondering if there is a way to circumvent that.
g

gentle-wolf-58752

08/12/2019, 8:23 PM
Hm… not sure if there’s a way to pin that in the way you’re looking to, seems like we could update
YarnpkgDistribution
similar to how we did for
node
in https://github.com/pantsbuild/pants/commit/6739a81b6008274bfb4abd3436d9adb543a19e5a to permit it though
a

average-cpu-49873

08/12/2019, 8:52 PM
Yeah, similar functionality to that would work! Should I open a feature request / enhancement? And as a workaround, would using an internal binaries repo with the correct folder structure that we point to work or can you think of any complications to to that?
g

gentle-wolf-58752

08/12/2019, 8:57 PM
Yeah I’ve seen that work (patching the
binaries
repo for the a version not currently supported and point to that in your
pants.ini
)
A feature req would be helpful, but I haven’t dug into the
yarn
side in a bit so I could be missing something
Hrm, @average-cpu-49873 are you seeing an error when adding the
yarnpkg-distribution
in your
pants.ini
?
I just tried specifying
1.17.3
there and saw things run as expected, same with a version I didn’t have installed previously (1.16.0) in my `pants.ini`:
Copy code
[yarnpkg-distribution]
version: v1.17.3
a

average-cpu-49873

08/12/2019, 9:46 PM
My error is below and occurs when I
bundle
Copy code
21:44:31 [INFO] Attempting to fetch yarnpkg.tar.gz binary from: <https://binaries.pantsbuild.org/bin/yarnpkg/mac/10.13/v1.17.3/yarnpkg.tar.gz> ...
21:44:32 [INFO] Attempting to fetch yarnpkg.tar.gz binary from: <https://github.com/yarnpkg/yarn/releases/download/bin/yarnpkg/mac/10.13/v1.17.3/yarnpkg.tar.gz> ...

16:44:31 00:02       [install]
FAILURE: (u'Error resolving binary request BinaryRequest(supportdir=bin/yarnpkg, version=v1.17.3, name=yarnpkg, platform_dependent=True, external_url_generator=None, archiver=<pants.fs.archive.TarArchiver object at 0x10d388b90>): Failed to fetch yarnpkg.tar.gz binary from any source: (Failed to fetch binary from <https://binaries.pantsbuild.org/bin/yarnpkg/mac/10.13/v1.17.3/yarnpkg.tar.gz>: Fetch of <https://binaries.pantsbuild.org/bin/yarnpkg/mac/10.13/v1.17.3/yarnpkg.tar.gz> failed with status code 404, Failed to fetch binary from <https://github.com/yarnpkg/yarn/releases/download/bin/yarnpkg/mac/10.13/v1.17.3/yarnpkg.tar.gz>: Fetch of <https://github.com/yarnpkg/yarn/releases/download/bin/yarnpkg/mac/10.13/v1.17.3/yarnpkg.tar.gz> failed with status code 404)', BinaryNotFound(u'Failed to fetch yarnpkg.tar.gz binary from any source: (Failed to fetch binary from <https://binaries.pantsbuild.org/bin/yarnpkg/mac/10.13/v1.17.3/yarnpkg.tar.gz>: Fetch of <https://binaries.pantsbuild.org/bin/yarnpkg/mac/10.13/v1.17.3/yarnpkg.tar.gz> failed with status code 404, Failed to fetch binary from <https://github.com/yarnpkg/yarn/releases/download/bin/yarnpkg/mac/10.13/v1.17.3/yarnpkg.tar.gz>: Fetch of <https://github.com/yarnpkg/yarn/releases/download/bin/yarnpkg/mac/10.13/v1.17.3/yarnpkg.tar.gz> failed with status code 404)',))
I was at Pants v1.11.0, but I also tried at v1.18.0.dev0 and got the same error. I’m also setting the following config for node:
Copy code
[node-distribution.bundle.node]
version: v12.7.0
package_manager: yarn
eslint_config: app/web/.eslintrc
👍 1
g

gentle-wolf-58752

08/12/2019, 9:47 PM
Got it, thanks. I’m now seeing it elsewhere - curious that it didn’t cause issue on my mac
👍 1
a

average-cpu-49873

08/13/2019, 3:19 PM
That was fast, and looks like exactly what I need. 😄 Thank you!
metal 1
4 Views