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

Reduce wasm binary size with cargo-xbuild & removing rlib crate-type #33

Merged
merged 99 commits into from
Feb 26, 2020
Merged
Changes from 1 commit
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
2cda649
WIP: building wasm with xargo
ascjones Feb 5, 2020
efa20d3
Fix compilation errors
ascjones Feb 6, 2020
16d34e0
Fmt
ascjones Feb 6, 2020
9502f62
Run commands with `rustup run nightly`
ascjones Feb 6, 2020
e61035b
Pass separate link-args in rustflags for xargo compat
ascjones Feb 6, 2020
7ecfc46
Warn user if 'rlib' crate type
ascjones Feb 6, 2020
fcc7157
Colourise printed error
ascjones Feb 6, 2020
cd1658b
Ignore Xargo.toml in template
ascjones Feb 6, 2020
e85fe45
Refactor Xargo file generation, only remove if generated.
ascjones Feb 6, 2020
416f210
WIP: Add rlib crate-type when generating metadata
ascjones Feb 6, 2020
dbb93fe
Add rlib when building metadata, remove when building wasm
ascjones Feb 7, 2020
d8bbc91
Fmt
ascjones Feb 7, 2020
9998a1f
Make error bright red
ascjones Feb 7, 2020
9a0b0dc
Fix generating without modified Cargo.toml
ascjones Feb 7, 2020
8ddb26d
Don't need to check nightly installed, the command will fail
ascjones Feb 7, 2020
3c34994
Only load toml when ready to modify: allow for multi usage
ascjones Feb 7, 2020
82c64b3
Fmt
ascjones Feb 7, 2020
3568343
Show error context
ascjones Feb 10, 2020
2c70524
Debug crate metadata
ascjones Feb 10, 2020
4a092ea
Disable rlib by default for template
ascjones Feb 10, 2020
0067ce7
Use correct working dir, not workspace root
ascjones Feb 10, 2020
00e7fa6
Use `cargo-xbuild` as lib
ascjones Feb 12, 2020
3230d89
Check for nightly channel
ascjones Feb 12, 2020
17e0680
Check for correct xbuild configuration
ascjones Feb 13, 2020
1f48c07
Add xbuild config to template
ascjones Feb 13, 2020
9c3c4e1
Fix xbuild config check and use latest xbuild version
ascjones Feb 13, 2020
4ff2971
Fmt
ascjones Feb 13, 2020
436077d
Restore tempfile dev dependency
ascjones Feb 13, 2020
fe27fee
Move xbuild config to the end of the file
ascjones Feb 13, 2020
4ace9b3
Enable rlib by default in template
ascjones Feb 13, 2020
9b49dbe
Don't need nightly for generating the metadata
ascjones Feb 13, 2020
b4ab11e
Actually do need nightly, and just run plain cargo
ascjones Feb 13, 2020
f38c6e3
Not verbose: need to pass that flag through properly
ascjones Feb 13, 2020
8c00f0d
Fmt
ascjones Feb 13, 2020
3aa17bf
Fix tests
ascjones Feb 13, 2020
2c53aeb
Error when xbuild config not present, and update README
ascjones Feb 13, 2020
9d056ac
Fix tests
ascjones Feb 13, 2020
90f1485
Remove references to xargo and update readmes
ascjones Feb 13, 2020
be57190
Fmt
ascjones Feb 13, 2020
4e42146
Add error context to cargo invocation
ascjones Feb 13, 2020
3d44090
Fix tests compilation
ascjones Feb 13, 2020
7f5f356
Fmt
ascjones Feb 13, 2020
98d2101
Nightly toolchain for CI
ascjones Feb 14, 2020
1919afa
Add docs for nightly toolchain requirement
ascjones Feb 14, 2020
dab7d85
Link to nightly docs
ascjones Feb 14, 2020
8973138
Disable backtrace on CI
ascjones Feb 14, 2020
3a67388
Make tests pass
ascjones Feb 14, 2020
4b689ff
Install rust-src
ascjones Feb 14, 2020
631ca91
Disable backtrace to make tests pass
ascjones Feb 14, 2020
c36bb60
Move args closer to invocation
ascjones Feb 14, 2020
d2e0693
Create temporary Cargo.toml
ascjones Feb 17, 2020
67ee4c7
Rework temp manifest api
ascjones Feb 17, 2020
fb75207
Target dir is already absolute
ascjones Feb 17, 2020
2acc79d
temp dir prefix
ascjones Feb 18, 2020
afe99ab
xbuild config with sysroot path and explicit args
ascjones Feb 18, 2020
4bc56fc
Use custom xbuild branch
ascjones Feb 18, 2020
407a548
Remove check for xbuild config
ascjones Feb 18, 2020
dc0351f
Rewrite relatives paths when using temp file
ascjones Feb 18, 2020
2fd59a6
Fix dependency path rewrite
ascjones Feb 18, 2020
afa76ab
Update cargo-xbuild
ascjones Feb 19, 2020
90e7564
workspaces: parse workspace member manifests
ascjones Feb 19, 2020
f039b79
Merge branch 'master' into aj-xargo
ascjones Feb 20, 2020
bc4060e
WIP workspaces
ascjones Feb 20, 2020
cd1b69c
Implement temp workspace copy
ascjones Feb 20, 2020
9df4691
Fmt
ascjones Feb 20, 2020
2da47dc
Rewrite bin relative path
ascjones Feb 21, 2020
52b82cb
Handle package rename for contracts
ascjones Feb 21, 2020
9aff20d
Fmt
ascjones Feb 21, 2020
3480057
Pass rustflags by setting env var
ascjones Feb 21, 2020
963cd34
Fmt
ascjones Feb 21, 2020
6f5f759
Use abs path for lib default
ascjones Feb 21, 2020
67e30a0
Add 1 decimal place to file size
ascjones Feb 24, 2020
b85ad22
Make generate-metadata work, introduces ManifestPath
ascjones Feb 24, 2020
7103d60
Fmt
ascjones Feb 24, 2020
e02c5c9
cargo update
ascjones Feb 24, 2020
81db473
Rename manifest to workspace
ascjones Feb 24, 2020
a3af596
Fix test compilation and fmt
ascjones Feb 24, 2020
0310ce9
Fix link
ascjones Feb 24, 2020
7cf71c7
Add prerequisites section to readme
ascjones Feb 24, 2020
c5eba00
Remove rust-src component (added to image)
ascjones Feb 24, 2020
e8b227d
Fix deploy build
ascjones Feb 24, 2020
4b82756
Use builder like method for amending root manifest
ascjones Feb 24, 2020
ca3a8e9
List installed components
ascjones Feb 24, 2020
bde09c7
Show active-toolchain and whether rust-src installed
ascjones Feb 24, 2020
f4fff3a
Install nightly rust-src (temporary)
ascjones Feb 24, 2020
5aae77b
Fix metadata test
ascjones Feb 24, 2020
a3b0e6d
Fmt
ascjones Feb 24, 2020
8a2cfeb
Remove manual install of rust-src and diagnostics
ascjones Feb 24, 2020
fb6722a
More doc comments
ascjones Feb 25, 2020
5bba2f1
Add verbosity flags
ascjones Feb 25, 2020
c73dab7
Add verbosity flags to metadata command
ascjones Feb 25, 2020
6579826
Fix working dir for generate-metadata
ascjones Feb 25, 2020
848197a
Add verbosity to tests
ascjones Feb 25, 2020
6c7a8cd
Add verbosity to tests
ascjones Feb 25, 2020
24d085c
Make url optional and cargo update
ascjones Feb 25, 2020
7897f8f
Remove bk file from gitignore
ascjones Feb 25, 2020
4db24be
Bump version
ascjones Feb 25, 2020
574ee00
Fix comment and formatting
ascjones Feb 26, 2020
ab40adb
Add CHANGELOG.md
ascjones Feb 26, 2020
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
Prev Previous commit
Next Next commit
Add xbuild config to template
  • Loading branch information
ascjones committed Feb 13, 2020
commit 1f48c0711a35a7670cd634fb63bef75f361a2ab0
6 changes: 6 additions & 0 deletions template/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ version = "0.1.0"
authors = ["[your_name] <[your_email]>"]
edition = "2018"

# Configuration for `cargo-xbuild`, used by [`cargo-contract`](https://github.com/paritytech/cargo-contract)
[package.metadata.cargo-xbuild]
# Prevents panic strings and formatting code from `core` being included in final binary
# See https://github.com/johnthagen/min-sized-rust#remove-panic-string-formatting-with-panic_immediate_abort
panic_immediate_abort = true

[dependencies]
ink_abi = { git = "https://github.com/paritytech/ink", package = "ink_abi", default-features = false, features = ["derive"], optional = true }
ink_primitives = { git = "https://github.com/paritytech/ink", package = "ink_primitives", default-features = false }
Expand Down