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

chore: build noctilucent WASM library in a container #26123

Merged
merged 7 commits into from
Jun 28, 2023
Merged

Conversation

HBobertz
Copy link
Contributor

@HBobertz HBobertz commented Jun 26, 2023

Due to the addition of noctilucent to cdk, contributors needed to download rust/rustup to be able to build the cdk.

This uses the pre-existing dependency on Docker/Finch to containerize the process in order to not incur any further dependencies for contributors to manage.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@gitpod-io
Copy link

gitpod-io bot commented Jun 26, 2023

@github-actions github-actions bot added the p2 label Jun 26, 2023
@aws-cdk-automation aws-cdk-automation requested a review from a team June 26, 2023 16:37
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Jun 26, 2023
@HBobertz HBobertz marked this pull request as ready for review June 26, 2023 16:37
@HBobertz HBobertz changed the title chore: add rust dependency to contributing docs(contributing): add rust dependency Jun 26, 2023
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jun 26, 2023
CONTRIBUTING.md Outdated
@@ -64,6 +64,7 @@ The following tools need to be installed on your system prior to installing the
- [Python >= 3.6.5, < 4.0](https://www.python.org/downloads/release/python-365/)
- [Docker >= 19.03](https://docs.docker.com/get-docker/)
- the Docker daemon must also be running
- [Rust >= 1.68, rustup >= 1.25.2](https://www.rust-lang.org/tools/install)
Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for adding this.

How would users be informed of this change? I think an issue can be created and pinned informing the users about this, WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

Added a prerequisite test to inform users.

Naumel
Naumel previously requested changes Jun 27, 2023
Copy link
Contributor

@Naumel Naumel left a comment

Choose a reason for hiding this comment

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

I think there's an extra \d*
we need to check > 2.5, meaning there is only one digit after the 6-9, before it flips from 2.* to 3.*.
the dot is before the 2, not after 👍

check_which $app $app_min
app_v=$(${app} --version 2>/dev/null)
echo -e "Checking rustup version... \c"
if [ $(echo $app_v | grep -c -E "^1\.(2(5\.[2-9]\d*|[6-9]\d*\.\d*)|[3-9]\d+\.\d+)") -eq 1 ]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if [ $(echo $app_v | grep -c -E "^1\.(2(5\.[2-9]\d*|[6-9]\d*\.\d*)|[3-9]\d+\.\d+)") -eq 1 ]
if [ $(echo $app_v | grep -c -E "^1\.(2(5\.[2-9]\d*|[6-9]\.\d*)|[3-9]\d+\.\d+)") -eq 1 ]

Copy link
Contributor

Choose a reason for hiding this comment

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

Here's a railroad diagram of the original (i.e: my) version of the expression (courtesy of https://regexper.com):

image

Copy link
Contributor Author

@HBobertz HBobertz Jun 27, 2023

Choose a reason for hiding this comment

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

cool site. Based on this it seems romains expression works. Requested elena's re-review just to make sure we're all on the same page

Copy link
Contributor

@rix0rrr rix0rrr left a comment

Choose a reason for hiding this comment

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

I don't think I'm cool with adding this dependency. Contributing is already hard, and this will make it even harder.

Why do we need it, exactly, and why can that not be addressed another way?

@RomainMuller
Copy link
Contributor

Rust is already in jsii/superchain, and has been for a LONG while because some Python cryptography module that we transitively depend on needs to be built from it's rust source... I didn't think this would be much of a problem since it's already a host prerequisite in many cases...

I guess we can instead leverage the existing docker dependency instead and do this stuff within a container if you'd prefer that...

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jun 27, 2023
@RomainMuller RomainMuller changed the title docs(contributing): add rust dependency chore: build noctilucent WASM library in a container Jun 27, 2023
Comment on lines +23 to +24
echo "⏭️ Noctilucent WASM binary is up-to date, skipping build..."
echo "ℹ️ Delete lib/vendor/noctilucent/.version to force a rebuild."
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️ clever

Copy link
Contributor

Choose a reason for hiding this comment

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

But: wouldn't a git submodule do the same trick, and/or releasing the Noctilucent WASM package to NPMJS by itself?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we were originally using git submodules but it turned out codepipeline didn't like that very much so we had to just get it ourselves

Copy link
Contributor

Choose a reason for hiding this comment

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

Submodules come with their own set of issues. If it's required for a build, we should not put it into a submodule.

The noctilucent-wasm npm package is still an option.

@rix0rrr rix0rrr added the pr/do-not-merge This PR should not be merged at this time. label Jun 27, 2023
@HBobertz HBobertz removed the pr/do-not-merge This PR should not be merged at this time. label Jun 27, 2023
)
# Build noctilucent package in a Docker/Finch VM
NOCTILUCENT_GIT="https://github.com/iph/noctilucent.git"
NOCTILUCENT_COMMIT_ID="6da7c9fade55f8443bba7b8fdfcd4ebfe5208fb1"
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with @rix0rrr this feels like we are reinventing versioning and releases.

Copy link
Contributor

Choose a reason for hiding this comment

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

To clarify - this is just a stepping stone for now... We're trying to avoid wasting time on nom logistics to focus on the product itself. We (the folks working on migrate) are going to own the upkeep of this until it transitions to something our automation is able to deal with...

@HBobertz HBobertz requested a review from Naumel June 27, 2023 19:35
@RomainMuller RomainMuller dismissed Naumel’s stale review June 28, 2023 08:06

No longer relevant

@mergify
Copy link
Contributor

mergify bot commented Jun 28, 2023

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 8ea0070
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit 561cbc5 into main Jun 28, 2023
@mergify mergify bot deleted the bobertzh/doc-update branch June 28, 2023 08:35
@mergify
Copy link
Contributor

mergify bot commented Jun 28, 2023

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

ahmetsoykan pushed a commit to ahmetsoykan/aws-cdk that referenced this pull request Jun 28, 2023
Due to the addition of noctilucent to cdk, contributors needed to download rust/rustup to be able to build the cdk.

This uses the pre-existing dependency on Docker/Finch to containerize the process in order to not incur any further dependencies for contributors to manage.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
ahmetsoykan added a commit to ahmetsoykan/aws-cdk that referenced this pull request Jun 28, 2023
lukey-aleios pushed a commit to lukey-aleios/aws-cdk that referenced this pull request Jun 30, 2023
Due to the addition of noctilucent to cdk, contributors needed to download rust/rustup to be able to build the cdk.

This uses the pre-existing dependency on Docker/Finch to containerize the process in order to not incur any further dependencies for contributors to manage.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
lukey-aleios pushed a commit to lukey-aleios/aws-cdk that referenced this pull request Jun 30, 2023
Due to the addition of noctilucent to cdk, contributors needed to download rust/rustup to be able to build the cdk.

This uses the pre-existing dependency on Docker/Finch to containerize the process in order to not incur any further dependencies for contributors to manage.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS. p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants