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

make constants out of non-changing variables #9

Merged
merged 4 commits into from
Dec 23, 2023

Conversation

Godspower-Eze
Copy link
Contributor

Fix build by changing var to const for constant values as used in current version of zig.

Copy link
Owner

@gballet gballet left a comment

Choose a reason for hiding this comment

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

build isn't broken, which version of zig are you building with?

@gballet
Copy link
Owner

gballet commented Dec 21, 2023

and your change does break tests:

src/main.zig:496:19: error: expected type '*crypto.sha2.Sha2x32(.{.iv0 = 1779033703, .iv1 = 3144134277, .iv2 = 1013904242, .iv3 = 2773480762, .iv4 = 1359893119, .iv5 = 2600822924, .iv6 = 528734635, .iv7 = 1541459225, .digest_bits = 256})', found '*const crypto.sha2.Sha2x32(.{.iv0 = 1779033703, .iv1 = 3144134277, .iv2 = 1013904242, .iv3 = 2773480762, .iv4 = 1359893119, .iv5 = 2600822924, .iv6 = 528734635, .iv7 = 1541459225, .digest_bits = 256})'
src/main.zig:496:19: note: cast discards const qualifier
/opt/hostedtoolcache/zig/0.11.0/x86_64-linux/lib/std/crypto/sha2.zig:115:26: note: parameter type declared here
src/main.zig:496:19: error: expected type '*crypto.sha2.Sha2x32(.{.iv0 = 1779033703, .iv1 = 3144134277, .iv2 = 1013904242, .iv3 = 2773480762, .iv4 = 1359893119, .iv5 = 2600822924, .iv6 = 528734635, .iv7 = 1541459225, .digest_bits = 256})', found '*const crypto.sha2.Sha2x32(.{.iv0 = 1779033703, .iv1 = 3144134277, .iv2 = 1013904242, .iv3 = 2773480762, .iv4 = 1359893119, .iv5 = 2600822924, .iv6 = 528734635, .iv7 = 1541459225, .digest_bits = 256})'
src/main.zig:496:19: note: cast discards const qualifier
/opt/hostedtoolcache/zig/0.11.0/x86_64-linux/lib/std/crypto/sha2.zig:115:26: note: parameter type declared here

I'm not against merging this to accommodate future zig versions, but 0.11.0 is the reference version and needs to build.

src/main.zig Outdated Show resolved Hide resolved
@Godspower-Eze
Copy link
Contributor Author

build isn't broken, which version of zig are you building with?

0.12.0-dev.1773+8a8fd47d2

@Godspower-Eze
Copy link
Contributor Author

What command do use in running your test?

@gballet
Copy link
Owner

gballet commented Dec 22, 2023

We only support the latest release, so if it breaks in master we'll wait for the breaking changes to be merged and released before upgrading versions.

The test commands can be seen in the ci file:

zig build test --summary all

@gballet
Copy link
Owner

gballet commented Dec 22, 2023

Could you please remove the .DS_Store?

@gballet gballet changed the title fix: build turn unused variables into constants Dec 23, 2023
@gballet gballet changed the title turn unused variables into constants make constants out of non-changing variables Dec 23, 2023
Copy link
Owner

@gballet gballet left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you for being my first contributor!👋

@gballet gballet merged commit 0bb0ab8 into gballet:master Dec 23, 2023
3 checks passed
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.

2 participants