Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in join: expected string for sequence element 0, got 'path' #176

Open
sgammon opened this issue Apr 12, 2021 · 3 comments
Open

Error in join: expected string for sequence element 0, got 'path' #176

sgammon opened this issue Apr 12, 2021 · 3 comments

Comments

@sgammon
Copy link

sgammon commented Apr 12, 2021

While trying to build an iOS application linked to some pods (non-vendored), I get the following error:

(16:37:49) INFO: Invocation ID: e462672e-427c-4928-8d68-e4763ee2d6ad
(16:37:53) INFO: Repository Logging instantiated at:
  /Volumes/VANTAGE/platform/WORKSPACE:307:19: in <toplevel>
  /private/var/tmp/_bazel_sam.g/.../external/rules_pods/BazelExtensions/workspace.bzl:275:14: in new_pod_repository
Repository rule pod_repo_ defined at:
  /private/var/tmp/_bazel_sam.g/.../external/rules_pods/BazelExtensions/workspace.bzl:173:28: in <toplevel>
(16:37:53) ERROR: An error occurred during the fetch of repository 'Logging':
   Traceback (most recent call last):
	File "/private/var/tmp/_bazel_sam.g/.../external/rules_pods/BazelExtensions/workspace.bzl", line 105, column 27, in _impl
		_fetch_remote_repo(
	File "/private/var/tmp/_bazel_sam.g/.../external/rules_pods/BazelExtensions/workspace.bzl", line 47, column 25, in _fetch_remote_repo
		fetch_output = _exec(repository_ctx, fetch_cmd)
	File "/private/var/tmp/_bazel_sam.g/.../external/rules_pods/BazelExtensions/workspace.bzl", line 7, column 50, in _exec
		fail("Could not exec command " + " ".join(command))
Error in join: expected string for sequence element 0, got 'path'
(16:37:53) ERROR: Error fetching repository: Traceback (most recent call last):
	File "/private/var/tmp/_bazel_sam.g/.../external/rules_pods/BazelExtensions/workspace.bzl", line 105, column 27, in _impl
		_fetch_remote_repo(
	File "/private/var/tmp/_bazel_sam.g/.../external/rules_pods/BazelExtensions/workspace.bzl", line 47, column 25, in _fetch_remote_repo
		fetch_output = _exec(repository_ctx, fetch_cmd)
	File "/private/var/tmp/_bazel_sam.g/.../external/rules_pods/BazelExtensions/workspace.bzl", line 7, column 50, in _exec
		fail("Could not exec command " + " ".join(command))
Error in join: expected string for sequence element 0, got 'path'

I figured this might be an incompatibility with Bazel 4.0.0, which we recently switched to. I saw the recent commits on master related to Bazel 4 compatibility, but when using master directly, I run into #112.

WORKSPACE:

http_archive(
    name = "rules_pods",
    urls = ["https://github.com/pinterest/PodToBUILD/releases/download/0.25.2-8a5efa0/PodToBUILD.zip"],
    sha256 = "db4256e80fda350bff752f70385f3a332ac8b93d63c3ef677b11dca075dbe1ff",
)
load("@rules_pods//BazelExtensions:workspace.bzl", "new_pod_repository")

new_pod_repository(
  name = "Logging",
  url = "https://github.com/apple/swift-log/archive/173f567a2dfec11d74588eea82cecea555bdc0bc.zip",
  podspec_url = "https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/8/d/b/Logging/1.2.0/Logging.podspec.json",
  generate_module_map = False,
  inhibit_warnings = True,
)
@sgammon
Copy link
Author

sgammon commented Apr 21, 2021

@dgcoffman i saw you applied the changes that introduced Bazel 4 compatibility. we're on 4.0 and getting this error -- any ideas?

@dgcoffman
Copy link
Contributor

Not really... the error message looks to me like it's being generated from a failure in the error handling code itself, so who knows what the actual failure was

def _exec(repository_ctx, command):
    if repository_ctx.attr.trace:
        print("__EXEC", command)
    output = repository_ctx.execute(command)
    if output.return_code != 0:
        print("__OUTPUT", output.return_code, output.stdout, output.stderr)
        fail("Could not exec command " + " ".join(command))
    elif repository_ctx.attr.trace:
        print("__OUTPUT", output.return_code, output.stdout, output.stderr)

    return output

@dgcoffman
Copy link
Contributor

The examples in this codebase are a good test harness, so if you want to go deep, you can attempt to replicate the failure in one of the examples and then you can debug workspace.bzl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants