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

pallet-revive: Use custom target to build test fixtures #6266

Merged
merged 13 commits into from
Oct 29, 2024

Conversation

athei
Copy link
Member

@athei athei commented Oct 28, 2024

This removes the need to use a custom toolchain to build the contract test fixtures. Instead, we supply a custom target and use the currently in use upstream toolchain.

@athei athei added the R0-silent Changes should not be mentioned in any release notes label Oct 28, 2024
@athei athei requested review from koute and pgherveou and removed request for koute October 28, 2024 18:06
@pgherveou
Copy link
Contributor

can we get rid of the riscv features as well now that we have these changes?

@athei
Copy link
Member Author

athei commented Oct 28, 2024

Yes we don't need the feature anymore. But this can be a follow up. Not sure why the prdoc bot doesn't work.

"data-layout": "e-m:e-p:32:32-i64:64-n32-S32",
"eh-frame-header": false,
"emit-debug-gdb-scripts": false,
"features": "+e,+m,+a,+c,+lui-addi-fusion,+fast-unaligned-access,+xtheadcondmov",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"features": "+e,+m,+a,+c,+lui-addi-fusion,+fast-unaligned-access,+xtheadcondmov",
"features": "+e,+m,+a,+c,+lui-addi-fusion,+unaligned-scalar-mem,+xtheadcondmov",

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

+fast-unaligned-access isn't a feature for the target and it won't have any effect. +fast-unaligned-access seems to be an older artifact.

https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/RISCV/RISCVFeatures.td#L1358-L1361

Copy link
Member

@xermicus xermicus Oct 29, 2024

Choose a reason for hiding this comment

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

Ah okay it still called +fast-unaligned-access in LLVM 18.X. Rust 1.82.0 (latest stable) however uses LLVM 19:

rustc -vV
rustc 1.82.0 (f6e511eec 2024-10-15)
binary: rustc
commit-hash: f6e511eec7342f59a25f7c0534f1dbea00d01b14
commit-date: 2024-10-15
host: x86_64-unknown-linux-gnu
release: 1.82.0
LLVM version: 19.1.1

What toolchain do we expect?

Copy link
Member Author

@athei athei Oct 29, 2024

Choose a reason for hiding this comment

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

It uses whatever you build the repository with unless you override it. Our CI is on 1.81.

@athei
Copy link
Member Author

athei commented Oct 29, 2024

/cmd prdoc --audience runtime_dev --bump major --clean

@github-actions github-actions bot deleted a comment from athei Oct 29, 2024
@github-actions github-actions bot deleted a comment from athei Oct 29, 2024
@github-actions github-actions bot deleted a comment from athei Oct 29, 2024
Copy link

Command "prdoc --audience runtime_dev --bump major --clean" has failed ❌! See logs here

@athei
Copy link
Member Author

athei commented Oct 29, 2024

bot fmt

@command-bot
Copy link

command-bot bot commented Oct 29, 2024

@athei https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7662925 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh". Check out https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment bot cancel 7-9a99b414-84f0-4362-afa4-d63583e3b656 to cancel this command or bot cancel to cancel all commands in this pull request.

@command-bot
Copy link

command-bot bot commented Oct 29, 2024

@athei Command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh" has finished. Result: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7662925 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7662925/artifacts/download.

@athei
Copy link
Member Author

athei commented Oct 29, 2024

So this will break for newer toolchains? Cause +fast-unaligned-access doesn't exist there?

@xermicus
Copy link
Member

xermicus commented Oct 29, 2024

No, it'll just be a (suppressed) warning. You can set anything there, if it's not known to the target it's just ignored.

'+fast-unaligned-access' is not a recognized feature for this target (ignoring feature)

I mean unless of we'd rely on that (corresponding) feature always set which shouldn't be the case anyways.

@athei athei added this pull request to the merge queue Oct 29, 2024
Merged via the queue into master with commit db40a66 Oct 29, 2024
199 of 200 checks passed
@athei athei deleted the at/remove-toolchain branch October 29, 2024 17:16
mordamax pushed a commit to paritytech-stg/polkadot-sdk that referenced this pull request Oct 29, 2024
)

This removes the need to use a custom toolchain to build the contract
test fixtures. Instead, we supply a custom target and use the currently
in use upstream toolchain.

---------

Co-authored-by: Jan Bujak <[email protected]>
Co-authored-by: Cyrill Leutwiler <[email protected]>
Co-authored-by: command-bot <>
mordamax pushed a commit to paritytech-stg/polkadot-sdk that referenced this pull request Oct 29, 2024
)

This removes the need to use a custom toolchain to build the contract
test fixtures. Instead, we supply a custom target and use the currently
in use upstream toolchain.

---------

Co-authored-by: Jan Bujak <[email protected]>
Co-authored-by: Cyrill Leutwiler <[email protected]>
Co-authored-by: command-bot <>
@jarkkojs
Copy link

Resolved my conversation :-) Sorry for confusion was not meant as arguments. More like notes of my findings what can be done with just build.rs and rust-toolchain.xml targets-section.

The link from Google's blog showed that what they are doing is just passing --target i.e. same as here, so all good.

kevin-valerio added a commit to kevin-valerio/polkadot-sdk-killed that referenced this pull request Oct 30, 2024
@athei athei mentioned this pull request Oct 30, 2024
github-merge-queue bot pushed a commit that referenced this pull request Oct 31, 2024
Since #6266 we no longer
require a custom toolchain to build the `pallet-revive-fixtures`. Hence
we no longer have to guard the build behind a feature flag.

---------

Co-authored-by: GitHub Action <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R0-silent Changes should not be mentioned in any release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants