Skip to content

Fix Mojo solution_1 build (meta sieve_size name collision)#1030

Merged
rbergen merged 2 commits intoPlummersSoftwareLLC:drag-racefrom
relmer:fix/1027-mojo-solution1-build
Dec 25, 2025
Merged

Fix Mojo solution_1 build (meta sieve_size name collision)#1030
rbergen merged 2 commits intoPlummersSoftwareLLC:drag-racefrom
relmer:fix/1027-mojo-solution1-build

Conversation

@relmer
Copy link
Copy Markdown
Contributor

@relmer relmer commented Dec 25, 2025

Description

This fixes issue #1027 where solution_1 fails during the Docker build step with:

error: invalid redefinition of 'sieve_size'

Root cause
The meta sieve types declare a compile-time generic parameter named sieve_size (e.g. prime_sieve_1bit_meta[sieve_size: Int]) and also used sieve_size as the runtime parameter name in __call__. Newer Mojo treats that as a redeclaration in the same scope.

Fix
Rename the __call__ runtime parameter in the meta types to avoid colliding with the generic parameter.

Verification
docker build -t mojosieve . and docker run --rm -it mojosieve succeed again.

Fixes #1027

Contributing requirements

  • I read the contribution guidelines in CONTRIBUTING.md.
  • I placed my solution in the correct solution folder.
  • I added a README.md with the right badge(s).
  • I added a Dockerfile that builds and runs my solution.
  • I selected drag-race as the target branch.
  • All code herein is licensed compatible with BSD-3.

Copy link
Copy Markdown
Contributor

@rbergen rbergen left a comment

Choose a reason for hiding this comment

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

@relmer Thank you so much for submitting this! I've taken the liberty of reenabling CI and benchmark builds for Mojo/solution_1, and I can confirm CI succeeds once again.

So, LGTM!

@rbergen rbergen merged commit 8c1eaba into PlummersSoftwareLLC:drag-race Dec 25, 2025
173 checks passed
@relmer relmer deleted the fix/1027-mojo-solution1-build branch December 25, 2025 14:49
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.

Mojo/solution_1 fails to build

2 participants