The sound distributed version control system

#456 libpijul doesn't build on Windows

Closed on July 4, 2021
The_Decryptor on June 29, 2021

I tried to install Pijul alpha 49 on Windows, but it fails when building libpijul

error[E0053]: method `set_permissions` has an incompatible type for trait
   --> C:\Users\thede\.cargo\registry\src\github.com-1ecc6299db9ec823\libpijul-1.0.0-alpha.40\src\working_copy\filesystem.rs:340:24
    |
340 |     fn set_permissions(&mut self, _name: &str, _permissions: u16) -> Result<(), Self::Error> {
    |                        ^^^^^^^^^
    |                        |
    |                        types differ in mutability
    |                        help: change the self-receiver type to match the trait: `self: &working_copy::filesystem::FileSystem`
    |
   ::: C:\Users\thede\.cargo\registry\src\github.com-1ecc6299db9ec823\libpijul-1.0.0-alpha.40\src\working_copy\mod.rs:22:24
    |
22  |     fn set_permissions(&self, name: &str, permissions: u16) -> Result<(), Self::Error>;
    |                        ----- type in trait
    |
    = note: expected fn pointer `fn(&working_copy::filesystem::FileSystem, &str, _) -> Result<_, _>`
               found fn pointer `fn(&mut working_copy::filesystem::FileSystem, &str, _) -> Result<_, _>`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0053`.
error: could not compile `libpijul`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
pmeunier added a change on June 29, 2021
JRPSGFZYHKTHPES7PMOYPTY5653TWKNFCU7A5PHZYCWSPH7TUXVQC
main
pmeunier on June 29, 2021

Thanks! I believe I’ve fixed this, and republished on crates.io

The_Decryptor on June 29, 2021

Yep that fixed it for me, but now it fails on a different error within Pijul itself.

error[E0277]: `Result<repository::Repository, anyhow::Error>` is not a future
  --> C:\Users\thede\.cargo\registry\src\github.com-1ecc6299db9ec823\pijul-1.0.0-alpha.49\src\commands\git.rs:45:38
   |
45 |         let repo = if let Ok(repo) = Repository::find_root(self.repo_path.clone()).await {
   |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Result<repository::Repository, anyhow::Error>` is not a future
   |
   = help: the trait `futures::Future` is not implemented for `Result<repository::Repository, anyhow::Error>`
   = note: required by `futures::Future::poll`

error[E0609]: no field `current_channel` on type `config::Config`
   --> C:\Users\thede\.cargo\registry\src\github.com-1ecc6299db9ec823\pijul-1.0.0-alpha.49\src\commands\git.rs:459:26
    |
459 |         repo.repo.config.current_channel,
    |                          ^^^^^^^^^^^^^^^ unknown field
    |
    = note: available fields are: `default_remote`, `extra_dependencies`, `remotes`, `hooks`, `colors`, `pager`

error[E0560]: struct `libpijul::change::Author` has no field named `name`
   --> C:\Users\thede\.cargo\registry\src\github.com-1ecc6299db9ec823\pijul-1.0.0-alpha.49\src\commands\git.rs:699:17
    |
698 |             authors: vec![libpijul::change::Author {
    |                           ------------------------ help: `libpijul::change::Author` is a tuple struct, use the appropriate syntax: `libpijul::change::Author(/* fields */)`
699 |                 name: signature.name().unwrap().to_string(),
    |                 ^^^^ field does not exist
    |
   ::: C:\Users\thede\.cargo\registry\src\github.com-1ecc6299db9ec823\libpijul-1.0.0-alpha.41\src\change.rs:155:12
    |
155 | pub struct Author(pub std::collections::BTreeMap<String, String>);
    |            ------ `libpijul::change::Author` defined here

error[E0560]: struct `libpijul::change::Author` has no field named `email`
   --> C:\Users\thede\.cargo\registry\src\github.com-1ecc6299db9ec823\pijul-1.0.0-alpha.49\src\commands\git.rs:700:17
    |
698 |             authors: vec![libpijul::change::Author {
    |                           ------------------------ help: `libpijul::change::Author` is a tuple struct, use the appropriate syntax: `libpijul::change::Author(/* fields */)`
699 |                 name: signature.name().unwrap().to_string(),
700 |                 email: signature.email().map(|e| e.to_string()),
    |                 ^^^^^ field does not exist
    |
   ::: C:\Users\thede\.cargo\registry\src\github.com-1ecc6299db9ec823\libpijul-1.0.0-alpha.41\src\change.rs:155:12
    |
155 | pub struct Author(pub std::collections::BTreeMap<String, String>);
    |            ------ `libpijul::change::Author` defined here

error[E0560]: struct `libpijul::change::Author` has no field named `full_name`
   --> C:\Users\thede\.cargo\registry\src\github.com-1ecc6299db9ec823\pijul-1.0.0-alpha.49\src\commands\git.rs:701:17
    |
698 |             authors: vec![libpijul::change::Author {
    |                           ------------------------ help: `libpijul::change::Author` is a tuple struct, use the appropriate syntax: `libpijul::change::Author(/* fields */)`
...
701 |                 full_name: None,
    |                 ^^^^^^^^^ field does not exist
    |
   ::: C:\Users\thede\.cargo\registry\src\github.com-1ecc6299db9ec823\libpijul-1.0.0-alpha.41\src\change.rs:155:12
    |
155 | pub struct Author(pub std::collections::BTreeMap<String, String>);
    |            ------ `libpijul::change::Author` defined here

error[E0609]: no field `current_channel` on type `config::Config`
   --> C:\Users\thede\.cargo\registry\src\github.com-1ecc6299db9ec823\pijul-1.0.0-alpha.49\src\commands\git.rs:732:49
    |
732 |     if let Some(ref mut cur) = repo.repo.config.current_channel {
    |                                                 ^^^^^^^^^^^^^^^ unknown field
    |
    = note: available fields are: `default_remote`, `extra_dependencies`, `remotes`, `hooks`, `colors`, `pager`

error[E0609]: no field `current_channel` on type `config::Config`
   --> C:\Users\thede\.cargo\registry\src\github.com-1ecc6299db9ec823\pijul-1.0.0-alpha.49\src\commands\git.rs:736:26
    |
736 |         repo.repo.config.current_channel = Some(txn.name(&channel.read().unwrap()).to_string())
    |                          ^^^^^^^^^^^^^^^ unknown field
    |
    = note: available fields are: `default_remote`, `extra_dependencies`, `remotes`, `hooks`, `colors`, `pager`

error[E0599]: no method named `save_config` found for struct `repository::Repository` in the current scope
   --> C:\Users\thede\.cargo\registry\src\github.com-1ecc6299db9ec823\pijul-1.0.0-alpha.49\src\commands\git.rs:738:15
    |
738 |     repo.repo.save_config()?;
    |               ^^^^^^^^^^^ method not found in `repository::Repository`
    |
   ::: C:\Users\thede\.cargo\registry\src\github.com-1ecc6299db9ec823\pijul-1.0.0-alpha.49\src\repository.rs:9:1
    |
9   | pub struct Repository {
    | --------------------- method `save_config` not found for this

error: aborting due to 8 previous errors

Some errors have detailed explanations: E0277, E0560, E0599, E0609.
For more information about an error, try `rustc --explain E0277`.
error: failed to compile `pijul v1.0.0-alpha.49`, intermediate artifacts can be found at `C:\Users\thede\AppData\Local\Temp\cargo-installh1klIh`

Caused by:
  could not compile `pijul`

To learn more, run the command again with --verbose.

Should I file a separate issue for this?

pmeunier added a change on June 29, 2021
D66CRGCNWIZ7NDFKPPICWJHNEIIEM7T4IIUELH3T4NHRUADQXIUQC
main
pmeunier added a change on June 29, 2021
FYUDBQ3C5GWIFKITBAKEXTK4AFZXZOH7DHI7QFXQOQ3HYUIYDEVAC
main
pmeunier added a change on June 29, 2021
NEJOYVJB4VXJJPFBWD2YK7PK6KKHQGRHIJHLEJ53HLQ3ZQRE5EPQC
main
pmeunier on July 4, 2021

Just tested this on Windows, it works.

pmeunier closed this discussion on July 4, 2021