-
Notifications
You must be signed in to change notification settings - Fork 149
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
Ns/versionize clean #1326
Ns/versionize clean #1326
Conversation
f444677
to
2c36486
Compare
d4d7ea2
to
102815c
Compare
10cccb0
to
c365b14
Compare
c365b14
to
935b754
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't checked the lint tool for now
.PHONY: install_tfhe_lints # Install custom tfhe-rs lints | ||
install_tfhe_lints: | ||
(cd utils/cargo-tfhe-lints-inner && cargo install --path .) && \ | ||
cd utils/cargo-tfhe-lints && cargo install --path . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it try to reinstall everytime ? My main question here being that if the tool gets updated does the install step try to update the already installed tool ?
Alternatively is the installation mandatory or could it be run as a standalone executable maybe ?
Separate question: does it require a dedicated toolchain as was shown in the tutorial ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this is reinstalled every times but if its code did not change it is instant.
For the moment I don't think it can be run as a standalone tool because of the way the command line arguments are parsed: let tool_args = std::env::args().skip(2).collect::<Vec<_>>();
.
This assumes that the command is invoked with cargo tfhe-lints [args]
and will not work with ./target/carg-tfhe-lints [args]
.
Yes it needs a specific toolchain which is the one used by rustc-tools. The toolchain is specified in the toolchain.txt. Only the cargo-tfhe-lints-inner
tool needs this, I should remove the toolchain.txt
in cargo-tfhe-lints
.
integer_key: self.key.versionize_owned(), | ||
integer_key: (*self.key).clone().versionize_owned(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused here, why the clone ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.key
is wrapped in an Arc here. So I have to extract the inner type to call versionize_owned
. MSRV for the tfhe crate is 1.75 so I cannot use this: https://doc.rust-lang.org/std/sync/struct.Arc.html#method.unwrap_or_clone
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However I should at least impl<T: Versionize> Versionize for Arc<T>
in tfhe-versionable
I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are allowed to bump the version and you can do the impl if you want to as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you don't need the MSRV bump then don't bump
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the impl for Arc, this simplifies the code in tfhe
since the manual impl is not needed anymore.
I also updated the MSRV.
cf2b141
to
1aced21
Compare
4787b94
to
fbda08e
Compare
fbda08e
to
208f69f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for your patience and thorough corrections !
For the generated code
BREAKING CHANGE: `versionize_owned` now takes its argument by value.
BREAKING CHANGE: The `Upgrade` trait now requires to specify the Error type as an associated type (similar to `TryFrom`)
208f69f
to
61aeb93
Compare
closes: please link all relevant issues
PR content/description
Various small improvements for the versioning feature. The main ones are:
serialize_owned
method now takes an owned value. This reduces the number of clone needed for serializationCheck-list: