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

Am/chore/next tfhe wip #673

Merged
merged 4 commits into from
Nov 10, 2023
Merged

Am/chore/next tfhe wip #673

merged 4 commits into from
Nov 10, 2023

Conversation

IceTDrinker
Copy link
Member

PR content/description

Various improvements to the build system to be able to use the crate as a dependency in a semver-trick setting, main change is a way to by pass the build.rs script which was erroring due to weird cargo conflicts on package names (and maybe the fact our build.rs is not that smart to begin with with path allocations and such, so being able to skip it entirely just makes things easier for us for the semver trick)

The added TFHE_SPEC in the Makefile is to make sure Cargo can disambiguate the fact we are talking about our package and not a dependency, see rust-lang/cargo#12891

Check-list:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • Relevant issues are marked as resolved/closed, related issues are linked in the description
  • Check for breaking changes (including serialization changes) and add them to commit message following the conventional commit specification

Copy link

github-actions bot commented Nov 8, 2023

@slab-ci cpu_fast_test

Copy link

github-actions bot commented Nov 8, 2023

@slab-ci cpu_fast_test

Makefile Outdated
@@ -17,6 +17,10 @@ FAST_TESTS?=FALSE
FAST_BENCH?=FALSE
BENCH_OP_FLAVOR?=DEFAULT
NODE_VERSION=20
TFHE_CURRENT_VERSION:=$(shell grep '^version[[:space:]]*=' tfhe/Cargo.toml | cut -d '=' -f 2 | xargs)
Copy link
Contributor

@mayeul-zama mayeul-zama Nov 8, 2023

Choose a reason for hiding this comment

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

This could give the wrong result if a crate dependency is defined before the package version and its version is in new line

That's unlikely but still

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree, if you have a better proposal I take it :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if it exist, but inserting a utility which asserts that a stream is only one line and forwards it would be more secure (even if not perfect)

Copy link
Member Author

Choose a reason for hiding this comment

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

though it looks like the Cargo.toml format does not allow new lines for { version = "..." } stuff

Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can have

[dependencies.dep_name]
version = "1.0"

Copy link
Member Author

Choose a reason for hiding this comment

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

no reason to have dependencies before package metadata, so even though it's not perfect, it's much better

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 Author

Choose a reason for hiding this comment

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

or maybe a light toml parser

Copy link
Contributor

@mayeul-zama mayeul-zama Nov 8, 2023

Choose a reason for hiding this comment

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

a light toml parser

That seems overkill to me

Copy link
Member Author

Choose a reason for hiding this comment

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

got something a bit more robust

tfhe/cbindgen.toml Show resolved Hide resolved
tfhe/build.rs Show resolved Hide resolved
@IceTDrinker
Copy link
Member Author

gotta love that the unambiguous spec for run (and only run) does not work

Copy link

github-actions bot commented Nov 8, 2023

@slab-ci cpu_fast_test

Copy link

github-actions bot commented Nov 9, 2023

@slab-ci cpu_fast_test

@slab-ci
Copy link

slab-ci bot commented Nov 9, 2023

http status 502 Bad Gateway code not expected

- adding the tfhe package as a dependency is currently causing issues with
Cargo because of unified feature resolution it seems, it needs an
additional version specifier to disambiguate which package we are referring
to, an issue exists on their end but I don't think a fix is to be expected
soon rust-lang/cargo#12891
- commiting this to main and then backporting the relevant pieces to 0.4.x
Copy link

github-actions bot commented Nov 9, 2023

@slab-ci cpu_fast_test

@tmontaigu
Copy link
Contributor

looks ok to me

@IceTDrinker
Copy link
Member Author

looks ok to me

Approve if you think it can go for merging pretty please 😄

Copy link

github-actions bot commented Nov 9, 2023

Pull Request has been approved 🎉
Launching full test suite...
@slab-ci cpu_test
@slab-ci cpu_integer_test
@slab-ci cpu_multi_bit_test
@slab-ci cpu_wasm_test
@slab-ci csprng_randomness_testing

@IceTDrinker IceTDrinker merged commit 61c8ead into main Nov 10, 2023
19 checks passed
@IceTDrinker IceTDrinker deleted the am/chore/next_tfhe_wip branch November 10, 2023 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants