Open acecilia opened 5 years ago
I'm seeing the same error.
I've tried last year 0.2 release and it did work... For some reason it seams that XCHammer is an old unsupported internal pinterest project.
@rahul-malik your feedback would be very much appreciated :)
PD: Also, did you manage to publish the part 2 of https://medium.com/pinterest-engineering/developing-fast-reliable-ios-builds-at-pinterest-part-one-cb1810407b92? I would like to know more about how you are using Bazel in Pinterest ;)
@yuriy-yarosh - XCHammer is currently used by all developers at Pinterest. The docs should be updated ideally to how we've set it up internally. We also use HEAD so feel free to track upstream closely
@acecilia - Can you try the bazel instructions in https://github.com/pinterest/xchammer/blob/master/Docs/XCHammerFAQ.md ?
@acecilia @yuriy-yarosh - I just tagged a new release for you to try. Please let me know if this works for you https://github.com/pinterest/xchammer/releases/tag/0.3
@rahul-malik thanks for your answer :) I had a look at the FAQ, but I can not make it work (I do not see any installation or setup instructions in the FAQ).
I run the script I attacked in the first comment of the issue, and I am still getting the same error: Fatal error: Missing XCHammerAssets: file Sources/XCHammer/Generator.swift, line 788
:
set -eou pipefail
# Clone XCHammer repository
tmp_dir=$(mktemp -d -t xchammer-XXXXXXXXXX)
git clone "https://github.com/pinterest/xchammer" "$tmp_dir"
cd "$tmp_dir"
git checkout tags/0.3
# Clean previous installation if needed
rm -rf /usr/local/bin/xchammer
rm -rf /usr/local/bin/xchammer.app
# Install XCHammer
make install
# Patch the makefile, so instead of using the binary from the actual directory, use it from /usr/local/bin
sed -i '' 's/$(ROOT_DIR)\/$(PRODUCT)\/Contents\/MacOS\/XCHammer/xchammer/g' "Makefile"
# Run
make run # This fails with the error 'Fatal error: Missing XCHammerAssets: file Sources/XCHammer/Generator.swift, line 776'
I can not find information about how to install xchammer
, only the indication on the readme about using make install
, which is not working for me.
@rahul-malik thanks.
So I figured out the issue and a work around. xchammer generate xchammer.yml fails because it gets installed a symlink to /usr/local/bin Which then looks for resources in /usr/local/bin
Workaround is
to call it directly
e.g.
/usr/local/bin/xchammer.app/Contents/MacOS/xchammer generate xchammer.yml
@mpalczew Yayyy that made it, thanks for the trick! Finally the following script works:
set -eou pipefail
# Clone XCHammer repository
tmp_dir=$(mktemp -d -t xchammer-XXXXXXXXXX)
git clone "https://github.com/pinterest/xchammer" "$tmp_dir"
cd "$tmp_dir"
git checkout tags/0.3
# Clean previous installation if needed
rm -rf /usr/local/bin/xchammer
rm -rf /usr/local/bin/xchammer.app
# Install XCHammer
make install
# Patch the makefile, so instead of using the binary from the actual directory, use it from /usr/local/bin
sed -i '' 's/$(ROOT_DIR)\/$(PRODUCT)\/Contents\/MacOS\/XCHammer/\/usr\/local\/bin\/xchammer.app\/Contents\/MacOS\/xchammer/g' "Makefile"
# Run
make run
I don't have permission to push a new branch, otherwise I would have a PR. Here's a patch.
diff --git a/Makefile b/Makefile
index bf78e98..de15594 100644
--- a/Makefile
+++ b/Makefile
@@ -30,7 +30,8 @@ archive: build-release
install: archive
mkdir -p $(PREFIX)/bin
ditto $(PRODUCT) $(PREFIX)/bin/$(PRODUCT)
- ln -s $(PREFIX)/bin/$(PRODUCT)/Contents/MacOS/xchammer $(PREFIX)/bin/xchammer
+ echo '#!/bin/sh\n$(PREFIX)/bin/$(PRODUCT)/Contents/MacOS/xchammer $$@\n' > $(PREFIX)/bin/xchammer
+ chmod +x /usr/local/bin/xchammer
uninstall:
unlink $(PREFIX)/bin/xchammer
As for #267 the problem is still there when generation is done with xcode_project
rule. Does someone have a pointer to understand what is going on here?
Hello:
Using xchammer from
/usr/local/bin
aftermake install
does not work. It fails with the following error:I am running macOS Mojave 10.14.6 (18G103), and I have tried this with Xcode 10.3 and 11. I have tried commit
f5fe4657eb751ababfa4ad5986afaa691910080f
from xchammer (last one at master at the time of writing).You can reproduce the issue by running the following script:
If this is not working, how are you usually using
xchammer
in Pinterest?Thanks!