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

Latest Build Fails to Compile #22

Closed
ghost opened this issue Jan 31, 2019 · 11 comments · Fixed by #27
Closed

Latest Build Fails to Compile #22

ghost opened this issue Jan 31, 2019 · 11 comments · Fixed by #27
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Jan 31, 2019

When I run

cargo build

I get this I am on the latest version of Rust from RustUp and the latest MacOSX. This command is being run in iTerm2.

If I had to take a wild guess as to why this is happening I would say it is due to not using the latest Rust as is mentioned in this pull request.

@kamiyaa
Copy link
Owner

kamiyaa commented Feb 1, 2019

Unfortunately, I don't have a Mac to test on.
I am guessing libc exposes different APIs for the NULL pointer on Linux and Mac?
https://github.com/rust-lang/libc/blob/master/src/unix/bsd/apple/mod.rs#L2313
https://github.com/rust-lang/libc/blob/master/src/unix/notbsd/linux/mod.rs#L1328

I will see what I can do

@kamiyaa
Copy link
Owner

kamiyaa commented Feb 1, 2019

@gottaStartNow Try the latest commit adea8ba

@kamiyaa kamiyaa added the bug Something isn't working label Feb 2, 2019
@sb-liu
Copy link

sb-liu commented Feb 18, 2019

warning: unused import: `std::fmt`
 --> src/joshuto/config/preview.rs:5:5
  |
5 | use std::fmt;
  |     ^^^^^^^^
  |
  = note: #[warn(unused_imports)] on by default

warning: unused import: `joshuto::preview`
 --> src/joshuto/command/delete_files.rs:9:5
  |
9 | use joshuto::preview;
  |     ^^^^^^^^^^^^^^^^

warning: unused import: `joshuto::preview`
  --> src/joshuto/command/file_operations.rs:10:5
   |
10 | use joshuto::preview;
   |     ^^^^^^^^^^^^^^^^

warning: unused import: `joshuto::ui`
 --> src/joshuto/preview.rs:9:5
  |
9 | use joshuto::ui;
  |     ^^^^^^^^^^^

error[E0308]: mismatched types
  --> src/joshuto/command/set_mode.rs:41:14
   |
41 |             (libc::S_IRUSR, 'r'),
   |              ^^^^^^^^^^^^^ expected u32, found u16
help: you can cast an `u16` to `u32`, which will zero-extend the source value
   |
41 |             (libc::S_IRUSR.into(), 'r'),
   |              ^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
  --> src/joshuto/command/set_mode.rs:42:14
   |
42 |             (libc::S_IWUSR, 'w'),
   |              ^^^^^^^^^^^^^ expected u32, found u16
help: you can cast an `u16` to `u32`, which will zero-extend the source value
   |
42 |             (libc::S_IWUSR.into(), 'w'),
   |              ^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
  --> src/joshuto/command/set_mode.rs:43:14
   |
43 |             (libc::S_IXUSR, 'x'),
   |              ^^^^^^^^^^^^^ expected u32, found u16
help: you can cast an `u16` to `u32`, which will zero-extend the source value
   |
43 |             (libc::S_IXUSR.into(), 'x'),
   |              ^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
  --> src/joshuto/command/set_mode.rs:44:14
   |
44 |             (libc::S_IRGRP, 'r'),
   |              ^^^^^^^^^^^^^ expected u32, found u16
help: you can cast an `u16` to `u32`, which will zero-extend the source value
   |
44 |             (libc::S_IRGRP.into(), 'r'),
   |              ^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
  --> src/joshuto/command/set_mode.rs:45:14
   |
45 |             (libc::S_IWGRP, 'w'),
   |              ^^^^^^^^^^^^^ expected u32, found u16
help: you can cast an `u16` to `u32`, which will zero-extend the source value
   |
45 |             (libc::S_IWGRP.into(), 'w'),
   |              ^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
  --> src/joshuto/command/set_mode.rs:46:14
   |
46 |             (libc::S_IXGRP, 'x'),
   |              ^^^^^^^^^^^^^ expected u32, found u16
help: you can cast an `u16` to `u32`, which will zero-extend the source value
   |
46 |             (libc::S_IXGRP.into(), 'x'),
   |              ^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
  --> src/joshuto/command/set_mode.rs:47:14
   |
47 |             (libc::S_IROTH, 'r'),
   |              ^^^^^^^^^^^^^ expected u32, found u16
help: you can cast an `u16` to `u32`, which will zero-extend the source value
   |
47 |             (libc::S_IROTH.into(), 'r'),
   |              ^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
  --> src/joshuto/command/set_mode.rs:48:14
   |
48 |             (libc::S_IWOTH, 'w'),
   |              ^^^^^^^^^^^^^ expected u32, found u16
help: you can cast an `u16` to `u32`, which will zero-extend the source value
   |
48 |             (libc::S_IWOTH.into(), 'w'),
   |              ^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
  --> src/joshuto/command/set_mode.rs:49:14
   |
49 |             (libc::S_IXOTH, 'x'),
   |              ^^^^^^^^^^^^^ expected u32, found u16
help: you can cast an `u16` to `u32`, which will zero-extend the source value
   |
49 |             (libc::S_IXOTH.into(), 'x'),
   |              ^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
  --> src/joshuto/unix.rs:40:45
   |
40 |     const LIBC_PERMISSION_VALS: [u32; 3] = [libc::S_IXUSR, libc::S_IXGRP, libc::S_IXOTH];
   |                                             ^^^^^^^^^^^^^ expected u32, found u16

error[E0308]: mismatched types
  --> src/joshuto/unix.rs:54:10
   |
54 |         (S_IFREG, '-'),
   |          ^^^^^^^ expected u16, found u32

error[E0308]: mismatched types
  --> src/joshuto/unix.rs:55:10
   |
55 |         (S_IFDIR, 'd'),
   |          ^^^^^^^ expected u16, found u32

error[E0308]: mismatched types
  --> src/joshuto/unix.rs:56:10
   |
56 |         (S_IFLNK, 'l'),
   |          ^^^^^^^ expected u16, found u32

error[E0308]: mismatched types
  --> src/joshuto/unix.rs:57:10
   |
57 |         (S_IFSOCK, 's'),
   |          ^^^^^^^^ expected u16, found u32

error[E0308]: mismatched types
  --> src/joshuto/unix.rs:58:10
   |
58 |         (S_IFBLK, 'b'),
   |          ^^^^^^^ expected u16, found u32

error[E0308]: mismatched types
  --> src/joshuto/unix.rs:59:10
   |
59 |         (S_IFCHR, 'c'),
   |          ^^^^^^^ expected u16, found u32

error[E0308]: mismatched types
  --> src/joshuto/unix.rs:60:10
   |
60 |         (S_IFIFO, 'f'),
   |          ^^^^^^^ expected u16, found u32

error: aborting due to 17 previous errors

For more information about this error, try `rustc --explain E0308`.
error: Could not compile `joshuto`.

Log file for compilation bug

@kamiyaa
Copy link
Owner

kamiyaa commented Feb 18, 2019

@sb-liu try if the latest commit compiles: de70d4f

@sb-liu
Copy link

sb-liu commented Feb 18, 2019

error[E0425]: cannot find value `tx` in this scope
   --> src/commands/file_operations.rs:252:17
    |
252 |                 tx.send(progress_info).unwrap();
    |                 ^^ not found in this scope

error[E0425]: cannot find value `rx` in this scope
   --> src/commands/file_operations.rs:264:19
    |
264 |             recv: rx,
    |                   ^^ not found in this scope

warning: unused import: `preview`
 --> src/commands/delete_files.rs:9:5
  |
9 | use preview;
  |     ^^^^^^^
  |
  = note: #[warn(unused_imports)] on by default

warning: unused import: `preview`
  --> src/commands/file_operations.rs:11:5
   |
11 | use preview;
   |     ^^^^^^^

warning: unused import: `ui`
 --> src/preview.rs:9:5
  |
9 | use ui;
  |     ^^

error[E0308]: mismatched types
  --> src/commands/set_mode.rs:61:49
   |
61 |             entry.metadata.permissions.set_mode(mode + (1 << 15));
   |                                                 ^^^^^^^^^^^^^^^^ expected u32, found u16
help: you can cast an `u16` to `u32`, which will zero-extend the source value
   |
61 |             entry.metadata.permissions.set_mode((mode + (1 << 15)).into());
   |                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
  --> src/commands/set_mode.rs:85:64
   |
85 |                     let mut mode_string = unix::stringify_mode(mode);
   |                                                                ^^^^ expected u16, found u32

error[E0308]: mismatched types
   --> src/ui.rs:187:48
    |
187 |     ncurses::waddstr(win, unix::stringify_mode(mode).as_str());
    |                                                ^^^^ expected u16, found u32

error[E0308]: mismatched types
   --> src/ui.rs:201:24
    |
201 |         if mode >> 9 & libc::S_IFLNK >> 9 == mode >> 9 {
    |                        ^^^^^^^^^^^^^^^^^^ expected u32, found u16

error[E0277]: no implementation for `u32 & u16`
   --> src/ui.rs:201:22
    |
201 |         if mode >> 9 & libc::S_IFLNK >> 9 == mode >> 9 {
    |                      ^ no implementation for `u32 & u16`
    |
    = help: the trait `std::ops::BitAnd<u16>` is not implemented for `u32`

error[E0308]: mismatched types
   --> src/ui.rs:270:32
    |
270 |         if unix::is_executable(mode) {
    |                                ^^^^ expected u16, found u32

error: aborting due to 8 previous errors

Some errors occurred: E0277, E0308, E0425.
For more information about an error, try `rustc --explain E0277`.
error: Could not compile `joshuto`.

@kamiyaa
Copy link
Owner

kamiyaa commented Feb 19, 2019

@sb-liu see if dev branch compiles on latest commit: dev@ d0105d7

@ghost
Copy link
Author

ghost commented Feb 20, 2019

Still failing
https://pastebin.com/bN0LM2P5

@kamiyaa
Copy link
Owner

kamiyaa commented Feb 20, 2019

@gottaStartNow can you see if the dev branch works?

@ghost
Copy link
Author

ghost commented Feb 21, 2019

@gottaStartNow can you see if the dev branch works?

Still will not build on 'dev' branch. The latest error as follows and yes it updated the ncurses-rs.
https://pastebin.com/YvuRM67J

@sb-liu
Copy link

sb-liu commented Mar 6, 2019

dev branch still facing issues with 16 bit int on MacOs

error[E0277]: the trait bound `u16: std::convert::From<u32>` is not satisfied
  --> src/unix.rs:90:45
   |
90 |             libc::chmod(svec.as_ptr(), mode.into());
   |                                             ^^^^ the trait `std::convert::From<u32>` is not implemented for `u16`
   |
   = help: the following implementations were found:
             <u16 as std::convert::From<bool>>
             <u16 as std::convert::From<std::num::NonZeroU16>>
             <u16 as std::convert::From<u8>>
   = note: required because of the requirements on the impl of `std::convert::Into<u16>` for `u32`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
error: Could not compile `joshuto`.

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

@austinhyde
Copy link
Contributor

Hi, I think I solved the macOS build issues on the latest master. I don't see any of the previous issues, just

error[E0308]: mismatched types
 --> src/util/unix.rs:6:50
  |
6 |     LIBC_PERMISSION_VALS.iter().any(|val| mode & *val != 0)
  |                                                  ^^^^ expected `u32`, found `u16`

error[E0277]: no implementation for `u32 & u16`
 --> src/util/unix.rs:6:48
  |
6 |     LIBC_PERMISSION_VALS.iter().any(|val| mode & *val != 0)
  |                                                ^ no implementation for `u32 & u16`
  |
  = help: the trait `std::ops::BitAnd<u16>` is not implemented for `u32`

Let me know if that doesn't work for some reason!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants