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

Cannot build on MacOS #7

Closed
n8henrie opened this issue Nov 20, 2018 · 7 comments
Closed

Cannot build on MacOS #7

n8henrie opened this issue Nov 20, 2018 · 7 comments
Labels
bug Something isn't working

Comments

@n8henrie
Copy link

MacOS 10.14.1

I suspect may be an issue I need to raise at https://github.com/meh/rust-ffmpeg instead, but just putting it out there.

I was hoping to work on #4 as my first Rust contribution (thanks for the label), but obviously won't get far if I can't build as is!

$ cargo version
cargo 1.30.0 (a1a4ad372 2018-11-02)
$ rustc --version
rustc 1.30.1 (1433507eb 2018-11-07)
$ cargo build
   Compiling cfg-if v0.1.4
   Compiling rustc-serialize v0.3.24
   Compiling term v0.4.6
   Compiling unicode-xid v0.0.3
   Compiling void v1.0.2
   Compiling nodrop v0.1.12
   Compiling libc v0.2.42
   Compiling memoffset v0.2.1
   Compiling bitflags v0.5.0
   Compiling ucd-util v0.1.1
   Compiling regex v0.2.11
   Compiling byteorder v1.2.3
   Compiling scopeguard v0.3.3
   Compiling lazy_static v1.0.2
   Compiling lazycell v0.6.0
   Compiling slab v0.4.0
   Compiling utf8-ranges v1.0.0
   Compiling futures v0.1.23
   Compiling version_check v0.1.4
   Compiling unicode-xid v0.1.0
   Compiling glob v0.2.11
   Compiling pnet_base v0.21.0
   Compiling httparse v1.3.2
   Compiling serde v1.0.70
   Compiling scoped-tls v0.1.2
   Compiling nix v0.10.0
   Compiling take v0.1.0
   Compiling slab v0.3.0
   Compiling pnet v0.21.0
   Compiling try-lock v0.1.0
   Compiling smallvec v0.2.1
   Compiling bitflags v1.0.3
   Compiling safemem v0.2.0
   Compiling bitflags v0.7.0
   Compiling rustc-demangle v0.1.9
   Compiling ipnetwork v0.12.8
   Compiling percent-encoding v1.0.1
   Compiling dtoa v0.4.3
   Compiling linked-hash-map v0.4.2
   Compiling strsim v0.6.0
   Compiling bitflags v0.9.1
   Compiling itoa v0.4.2
   Compiling language-tags v0.2.2
   Compiling smallvec v0.6.2
   Compiling log v0.4.3
   Compiling crossbeam-utils v0.3.2
   Compiling unreachable v1.0.0
   Compiling arrayvec v0.4.7
   Compiling regex-syntax v0.5.6
   Compiling iovec v0.1.2
   Compiling memchr v2.0.1
   Compiling net2 v0.2.33
   Compiling num_cpus v1.8.0
   Compiling rand v0.4.2
   Compiling pnet_sys v0.21.0
   Compiling time v0.1.40
   Compiling unicase v2.1.0
   Compiling proc-macro2 v0.4.8
   Compiling pnet_macros_support v0.21.0
   Compiling base64 v0.9.2
   Compiling xml-rs v0.3.6
   Compiling syntex_pos v0.42.0
   Compiling backtrace v0.3.9
   Compiling lru-cache v0.1.1 (https://github.com/kevincox/lru-cache.git?branch=entry-api#f4aa4662)
   Compiling tokio-executor v0.1.2
   Compiling tokio-service v0.1.0
   Compiling relay v0.1.1
   Compiling nix v0.9.0
   Compiling thread_local v0.3.5
   Compiling log v0.3.9
   Compiling want v0.0.4
   Compiling bytes v0.4.8
   Compiling aho-corasick v0.6.6
   Compiling futures-cpupool v0.1.8
   Compiling crossbeam-epoch v0.4.3
   Compiling pnet_datalink v0.21.0
   Compiling mio v0.6.15
   Compiling rand v0.3.22
   Compiling quote v0.6.3
   Compiling error-chain v0.11.0
   Compiling tokio-timer v0.2.4
   Compiling syntex_errors v0.42.0
   Compiling tokio-io v0.1.7
   Compiling crossbeam-deque v0.3.1
   Compiling syn v0.14.4
   Compiling tokio-reactor v0.1.2
   Compiling tokio-codec v0.1.0
   Compiling syntex_syntax v0.42.0
   Compiling tokio-threadpool v0.1.5
   Compiling mime v0.3.8
   Compiling env_logger v0.4.3
   Compiling tokio-tcp v0.1.0
   Compiling os_pipe v0.6.1
   Compiling tokio-udp v0.1.1
   Compiling serde-xml-rs v0.2.1
   Compiling serde_json v1.0.24
   Compiling tokio-fs v0.1.2
   Compiling serde_derive v1.0.70
   Compiling tokio v0.1.7
   Compiling tokio-core v0.1.17
   Compiling tokio-proto v0.1.1
   Compiling tokio-file-unix v0.4.2
   Compiling hyper v0.11.27
   Compiling docopt v0.8.3
   Compiling syntex v0.42.2
   Compiling pnet_macros v0.21.0
   Compiling pnet_packet v0.21.0
   Compiling pnet_transport v0.21.0
   Compiling rustymedia v0.1.0 (/Users/me/git/rustymedia)
error[E0425]: cannot find value `O_TMPFILE` in this scope
   --> src/ffmpeg.rs:350:47
    |
350 |         { use nix::fcntl::*; O_APPEND | O_CLOEXEC | O_TMPFILE | O_RDWR },
    |                                                     ^^^^^^^^^ not found in this scope

error: aborting due to previous error

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

To learn more, run the command again with --verbose.
@n8henrie
Copy link
Author

Looks like this may be the upstream issue (based on this)... but oddly I can build rustymedia with ffmpeg 4.1 on my Arch Linux box, but not with the same version on my MacOS laptop.

@kevincox
Copy link
Owner

Hi. Thanks for taking a look. It appears that this issue is in our ffmpeg.rs, not the ffmpeg crate. I don't have a Mac so I can't test it but I will gladly accept changes that claim to improve how rustymedia works on MacOS.

I suspect that MacOS doesn't support the O_TMPFILE flag. This flag creates a file with no name in the filesystem. This is used to cache the transcoded files on the disk but allowing the space to be automatically freed up when the file descriptor is closed or the process exits.

I guess we will need an alternative on MacOS. A simple option would be opening a file with a random name then unlinking it right away.

@kevincox kevincox added the bug Something isn't working label Nov 20, 2018
@n8henrie
Copy link
Author

Perhaps relevant commentary and project: Stebalien/tempfile#13

@n8henrie
Copy link
Author

Both you and this conversation talk about unlinking the tempfile immediately -- I thought unlinking deletes the file, but it sounds like it perhaps isn't deleted until all processes using it have exited.

Would you be interested in a PR if it adds tempfile as a dependency? Or would you prefer one that does it without adding another dependency (even if the implementation is perhaps more naive)?

@kevincox
Copy link
Owner

I would be happy to use the tempfile crate. I see no need to make another implementation of it in our repo.

n8henrie added a commit to n8henrie/rustymedia that referenced this issue Jan 2, 2019
Removes dependency on nix
Adds dependency on tempfile

Fixes build failure on MacOS due to absence of `O_TMPFILE`

Fixes kevincox#7
@n8henrie
Copy link
Author

n8henrie commented Jan 2, 2019

Project now builds and passes all tests on MacOS.

Still doesn't run though, I'll start a new issue.

@kevincox
Copy link
Owner

kevincox commented Jan 3, 2019

Thanks. I'll close this issue then.

@kevincox kevincox closed this as completed Jan 3, 2019
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.

2 participants