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

xdrgen: remove gemfile and rakefile to just use docker for the xdrgen #4366

Merged
merged 8 commits into from
May 3, 2022
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions Gemfile

This file was deleted.

82 changes: 0 additions & 82 deletions Gemfile.lock

This file was deleted.

22 changes: 19 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ xdr/Stellar-overlay.x \
xdr/Stellar-transaction.x \
xdr/Stellar-types.x

.PHONY: xdr
.PHONY: xdr xdr-clean xdr-update

keystore:
$(MAKE) -C services/keystore/ docker-build
Expand All @@ -32,7 +32,23 @@ gxdr/xdr_generated.go: $(XDRS)
go run github.com/xdrpp/goxdr/cmd/goxdr -p gxdr -enum-comments -o $@ $(XDRS)
go fmt $@

xdr/xdr_generated.go: $(XDRS) Rakefile Gemfile.lock
bundle exec rake xdr:generate
xdr/%.x:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does the %.x work here? If you delete the .x files, then run this, does it still pick them up from XDRS somehow?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is like a "resolver". So when xdr/xdr_generated.go requires them as dependencies, the files will be downloaded.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is what the xdr-update rule uses to update them. Delete them all, and build xdr/xdr_generated.go. That implicitly downloads them.

curl -Lsf -o $@ https://raw.githubusercontent.com/stellar/stellar-core/master/src/$@

xdr/xdr_generated.go: $(XDRS)
paulbellamy marked this conversation as resolved.
Show resolved Hide resolved
docker run -it --rm -v $$PWD:/wd -w /wd ruby /bin/bash -c '\
gem install specific_install -v 0.3.7 && \
gem specific_install https://github.com/stellar/xdrgen.git -b master && \
paulbellamy marked this conversation as resolved.
Show resolved Hide resolved
xdrgen \
--language go \
--namespace xdr \
--output xdr/ \
$(XDRS)'
go fmt $@

xdr: gxdr/xdr_generated.go xdr/xdr_generated.go

xdr-clean:
rm xdr/*.x || true

xdr-update: xdr-clean xdr
61 changes: 0 additions & 61 deletions Rakefile

This file was deleted.

1 change: 1 addition & 0 deletions xdr/xdr_generated.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//lint:file-ignore S1005 The issue should be fixed in xdrgen. Unfortunately, there's no way to ignore a single file in staticcheck.
//lint:file-ignore U1000 fmtTest is not needed anywhere, should be removed in xdrgen.

// Package xdr is generated from:
//
// xdr/Stellar-SCP.x
Expand Down