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

Add deterministic linux amd64 build system #1128

Closed
wants to merge 1 commit into from

Conversation

pinosu
Copy link
Contributor

@pinosu pinosu commented Dec 16, 2022

Resolves #268

Reference osmosis makefile

@pinosu pinosu requested a review from alpe as a code owner December 16, 2022 13:10
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@codecov
Copy link

codecov bot commented Dec 16, 2022

Codecov Report

Merging #1128 (65c482b) into main (b8c5724) will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1128      +/-   ##
==========================================
- Coverage   57.53%   57.51%   -0.03%     
==========================================
  Files          53       53              
  Lines        7289     7289              
==========================================
- Hits         4194     4192       -2     
- Misses       2800     2801       +1     
- Partials      295      296       +1     
Impacted Files Coverage Δ
x/wasm/keeper/keeper.go 87.40% <0.00%> (-0.32%) ⬇️

Copy link
Contributor

@alpe alpe left a comment

Choose a reason for hiding this comment

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

Very nice!
I got sha256 ec2555521cab6bd8e7b7d89b83a33566550af1cbbfcb69b5605d0c4a687abfee for the built binary on your branch (65c482b). Feel free to merge when you can confirm this

@webmaster128
Copy link
Member

Please also note this part of the Osmosis Makefile:

# Cross-building for arm64 from amd64 (or viceversa) takes
# a lot of time due to QEMU virtualization but it's the only way (afaik)
# to get a statically linked binary with CosmWasm

What is happening here is that a statically linked binary created on and created for Alpine linux is pulled out of the Alpine system to be used on other linuxes. I did this manually as well in the past and it worked. However, I would be very careful recommending that. I think it can break any time due to incompatibilities of C libraries or kernals. Cross-building is not what Linux is designed for (in contrast to Windows where you can run binaries decades after they were compiled). You build on your machine because all the code is open source.

@@ -73,6 +74,23 @@ ldflags := $(strip $(ldflags))

BUILD_FLAGS := -tags "$(build_tags_comma_sep)" -ldflags '$(ldflags)' -trimpath

build-reproducible-amd64: go.sum $(BUILDDIR)/
Copy link
Contributor

Choose a reason for hiding this comment

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

make: *** No rule to make target wasmd/build', needed by build-reproducible-amd64'. Stop.

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

Successfully merging this pull request may close these issues.

Add deterministic build system
3 participants