Skip to content

Conversation

@cprecioso
Copy link
Member

@cprecioso cprecioso commented Dec 1, 2025

Description


  • I extracted the computation of the artifact and tarball name out of the waspc-build workflow, so that we can reuse it in multiple places (mainly, the fetch-nightly-packages; and in the future the npm packaging script) without repeating ourselves.
  • Makes the waspc-build job output the computed names of the artifacts it has created. This way we don't hardcode these names in the following workflows.
    • This requires a bit of a workaround since, in matrix jobs, each job will override the output. Instead, we store each job's output in a different variable.

Type of change

  • 🔧 Just code/docs improvement
  • 🐞 Bug fix
  • 🚀 New/improved feature
  • 💥 Breaking change

Checklist

  • I tested my change in a Wasp app to verify that it works as intended.

  • 🧪 Tests and apps:

    • I added unit tests for my change.
    • (if you fixed a bug) I added a regression test for the bug I fixed.
    • (if you added/updated a feature) I added/updated e2e tests in examples/kitchen-sink/e2e-tests.
    • (if you added/updated a feature) I updated the starter templates in waspc/data/Cli/templates, as needed.
    • (if you added/updated a feature) I updated the example apps in examples/, as needed.
      • (if you updated examples/tutorials) I updated the tutorial in the docs (and vice versa).
  • 📜 Documentation:

    • (if you added/updated a feature) I added/updated the documentation in web/docs/.
  • 🆕 Changelog: (if change is more than just code/docs improvement)

    • I updated waspc/ChangeLog.md with a user-friendly description of the change.
    • (if you did a breaking change) I added a step to the current migration guide in web/docs/migration-guides/.
    • I bumped the version in waspc/waspc.cabal to reflect the changes I introduced.

@cprecioso cprecioso self-assigned this Dec 1, 2025
@cprecioso cprecioso changed the title WIP cprecioso/extract naming Dec 1, 2025
@cprecioso cprecioso force-pushed the cprecioso/separate-workflows branch from 6268ab3 to a8b09b5 Compare December 1, 2025 15:38
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 1, 2025

Deploying wasp-docs-on-main with  Cloudflare Pages  Cloudflare Pages

Latest commit: 935a6bf
Status: ✅  Deploy successful!
Preview URL: https://6f38d859.wasp-docs-on-main.pages.dev
Branch Preview URL: https://cprecioso-separate-workflows.wasp-docs-on-main.pages.dev

View logs

@cprecioso cprecioso force-pushed the cprecioso/separate-workflows branch from e6a39bd to 3eff1c1 Compare December 1, 2025 16:37
@cprecioso cprecioso force-pushed the cprecioso/separate-workflows branch from 3eff1c1 to be4e42f Compare December 1, 2025 16:50
@cprecioso cprecioso force-pushed the cprecioso/separate-workflows branch from be4e42f to 23209a6 Compare December 2, 2025 08:44
@cprecioso cprecioso force-pushed the cprecioso/separate-workflows branch from 23209a6 to e0ad7c1 Compare December 2, 2025 09:10
@cprecioso cprecioso force-pushed the cprecioso/separate-workflows branch from e0ad7c1 to 89d55e7 Compare December 2, 2025 09:10
@cprecioso cprecioso force-pushed the cprecioso/separate-workflows branch from 89d55e7 to 6ad9ba9 Compare December 2, 2025 09:21
@cprecioso cprecioso force-pushed the cprecioso/separate-workflows branch from 6ad9ba9 to 4ab3cb2 Compare December 2, 2025 09:35
@cprecioso cprecioso force-pushed the cprecioso/separate-workflows branch from 4ab3cb2 to 4ae72a3 Compare December 2, 2025 09:49
@cprecioso cprecioso force-pushed the cprecioso/separate-workflows branch from 4ae72a3 to 6ab98fc Compare December 2, 2025 10:30
@cprecioso cprecioso changed the title cprecioso/extract naming CI: Extract and don't hardcode artifact naming Dec 2, 2025
@cprecioso cprecioso marked this pull request as ready for review December 2, 2025 11:00
@cprecioso cprecioso force-pushed the cprecioso/separate-workflows branch from 6ab98fc to afd026c Compare December 3, 2025 13:26
@cprecioso cprecioso force-pushed the cprecioso/separate-workflows branch from afd026c to 10f3781 Compare December 3, 2025 14:01
@cprecioso cprecioso requested a review from sodic December 4, 2025 08:28
@cprecioso cprecioso force-pushed the cprecioso/separate-workflows branch from 10f3781 to 1e26277 Compare December 10, 2025 15:44
@cprecioso cprecioso changed the base branch from main to push-yvpvopwlurqz December 10, 2025 15:53
@cprecioso cprecioso force-pushed the cprecioso/separate-workflows branch from 1e26277 to 0c112c0 Compare December 11, 2025 10:07
Base automatically changed from push-yvpvopwlurqz to main December 16, 2025 13:27
@cprecioso cprecioso force-pushed the cprecioso/separate-workflows branch from 0c112c0 to 935a6bf Compare December 16, 2025 13:42
Copy link
Member

@infomiho infomiho left a comment

Choose a reason for hiding this comment

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

Left some comments

Comment on lines 27 to 28
# Using the ::error:: prefix lets GitHub handle it as a special string, and shows up as a red error in the logs.
# https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands#setting-an-error-message
Copy link
Member

Choose a reason for hiding this comment

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

On the fence if we need this comment, for example, you are not explaining the fromJson API for Github Action etc.

But I'm okay if we keep it 👍

RAW

Comment on lines 178 to 200
set -ex # Fail on error and print each command
input_arch=(
macos-x86_64
macos-aarch64
input_files=(
"$X86_64_TARBALL_NAME"
"$AARCH64_TARBALL_NAME"
)
# Extract each architecture
for arch in "${input_arch[@]}"; do
mkdir "arch-$arch"
tar -xzf "wasp-cli-${arch}/wasp-${arch}.tar.gz" -C "arch-$arch"
i=0;
for file in "${input_files[@]}"; do
mkdir "arch-$i"
tar -xzf "$file" -C "arch-$i"
i=$((i + 1))
done
mkdir universal
# Create the universal binary
lipo -create arch-*/wasp-bin -output universal/wasp-bin
# Copy the data folder too
cp -R "arch-${input_arch[0]}/data" universal/
# Copy the data folder too (we take the first one, should be identical in both)
cp -R "arch-0/data" universal/
# Pack back up
tar -czf wasp-macos-universal.tar.gz -C universal .
tar -czf ${{ steps.compute-artifact-names.outputs.tarball-name }} -C universal .
Copy link
Member

Choose a reason for hiding this comment

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

Something feels off about using $i here for me. I asked some of my LLM buddies to help me with some suggestions:

  1. You could use for i in "${!input_files[@]}"; do to get the array indicies which lets you do tar -xzf "${input_files[$i]}" -C "arch-$i".
  2. Another suggestion was to go fully explicit with something like:
    set -ex
    
    # Create semantic directories
    mkdir x86_64 aarch64 universal
    
    # Extract specifically to those directories
    tar -xzf "$X86_64_TARBALL_NAME" -C x86_64
    tar -xzf "$AARCH64_TARBALL_NAME" -C aarch64
    
    # Create the universal binary
    # Now it is obvious which inputs are being used
    lipo -create x86_64/wasp-bin aarch64/wasp-bin -output universal/wasp-bin
    
    # Copy data from one of the sources (explicitly choosing x86_64)
    cp -R x86_64/data universal/
    
    # Pack back up
    tar -czf ${{ steps.compute-artifact-names.outputs.tarball-name }} -C universal .

Copy link
Member

Choose a reason for hiding this comment

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

I found the second option the most readable since this is an exact thing we are doing: creating 1 universal binary out of Intel and ARM binaries. We don't need the extensibility here, it'll always be that.

@cprecioso cprecioso requested review from infomiho and removed request for sodic December 16, 2025 15:58
@cprecioso cprecioso merged commit be91d9c into main Dec 16, 2025
26 checks passed
@cprecioso cprecioso deleted the cprecioso/separate-workflows branch December 16, 2025 20:24
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.

3 participants