{"action":"created","issue":{"url":"https://api.github.com/repos/HandBrake/HandBrake/issues/1054","repository_url":"https://api.github.com/repos/HandBrake/HandBrake","labels_url":"https://api.github.com/repos/HandBrake/HandBrake/issues/1054/labels{/name}","comments_url":"https://api.github.com/repos/HandBrake/HandBrake/issues/1054/comments","events_url":"https://api.github.com/repos/HandBrake/HandBrake/issues/1054/events","html_url":"https://github.com/HandBrake/HandBrake/issues/1054","id":281145980,"node_id":"MDU6SXNzdWUyODExNDU5ODA=","number":1054,"title":"Building for Windows Documentation","user":{"login":"ajkajk","id":17911295,"node_id":"MDQ6VXNlcjE3OTExMjk1","avatar_url":"https://avatars2.githubusercontent.com/u/17911295?v=4","gravatar_id":"","url":"https://api.github.com/users/ajkajk","html_url":"https://github.com/ajkajk","followers_url":"https://api.github.com/users/ajkajk/followers","following_url":"https://api.github.com/users/ajkajk/following{/other_user}","gists_url":"https://api.github.com/users/ajkajk/gists{/gist_id}","starred_url":"https://api.github.com/users/ajkajk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajkajk/subscriptions","organizations_url":"https://api.github.com/users/ajkajk/orgs","repos_url":"https://api.github.com/users/ajkajk/repos","events_url":"https://api.github.com/users/ajkajk/events{/privacy}","received_events_url":"https://api.github.com/users/ajkajk/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-12-11T19:51:46Z","updated_at":"2018-12-05T13:06:13Z","closed_at":"2017-12-12T00:31:31Z","author_association":"NONE","body":"### Description of problem or feature request\r\n\r\nI've been switching from using a VM to using the new Ubuntu app built on Windows Subsystem for Linux.  This runs Ubuntu 16.04.3 LTS.  \r\n\r\nFollowing the current documentation at <https://handbrake.fr/docs/en/latest/developer/build-windows.html> revealed a couple of errors and perhaps deficiencies.\r\n\r\n### Steps to reproduce the problem\r\n\r\nAttempt to build HandBrake for Windows\r\n\r\n### HandBrake version (e.g., 1.0.0)\r\n\r\nCurrent repository\r\n\r\n### Operating system and version (e.g., Ubuntu 16.04 LTS, macOS 10.3 High Sierra, Windows 10 Creators Update)\r\n\r\nMicrosoft Windows [Version 10.0.16299.64]\r\n\r\n### Problems with Dependencies  \r\n\r\n* Using a fresh installation, the quoted dependencies can't be installed without first issuing a `sudo apt-get update` command - otherwise `yasm` is not visible.  It would be good practice to bring the installed system up-to-date at the same time i.e. `sudo apt-get upgrade && sudo apt autoremove`.\r\n\r\n  I think these commands should be included in the documentation\r\n\r\n* The actual list of dependencies doesn't include those needed to run the `mingw-w64-build` script. Further packages needed, of those listed in the script as requirements, are `bison bzip2 flex g++ gunzip pax`.\r\n\r\n* Although `libtool` is listed as a dependency, it is not recognised by the `configure` script unless `libtool-bin` is also installed.  Although the script has facilities for building this (and `pkg-config`) if missing, this didn't work for me.\r\n\r\nThe sufficient dependencies to add to a fresh install that I found were `bison cmake curl flex g++ gcc git intltool libtool libtool-bin m4 make patch pax pkg-config python tar wget yasm`\r\n\r\nI think the list in the documentation should be updated.  (The list for building for Ubuntu at <https://handbrake.fr/docs/en/latest/developer/install-dependencies-ubuntu.html> provides another view - it doesn't include `pax` for example.)\r\n\r\nI imagine these results would be the same in a fresh native install of Ubuntu.\r\n\r\n### Controlling the build\r\n\r\nThe documentation gives no guidance on controlling the build.  \r\n\r\n* For users wishing to build a release version of HandBrake for example to include the fdk-aac encoder, I think a mention of the use of the git tag facility as used by HandBrake should be included i.e. \r\n\r\n  `git tag` (this lists the tags) \r\n  `git checkout tags/1.0.3` (or whichever version you want from the list),\r\n    \r\n   This allows the specific version of HandBrake to be built.\r\n\r\n* Similarly, the options available with `configure` aren't mentioned.  The facility to list usage by calling `./configure -h` might be included.  In any case the specific case of building to include the fdk-aac encoder, i.e. the `--enable-fdk-aac` option, could be explicitly mentioned given that is probably a motivation for building your own \r\n\r\n### Using Windows Filestore\r\n\r\nIf the option of using the Windows Ubuntu app **is** documented, the following might also be noted.\r\n\r\nMS recommend using Windows filestore (DrvFs) for this sort of work i.e. placing the source somewhere in the regular Windows user NTFS space and linking to this from the Linux world, rather than cloning HandBrake to ~/HandBrake.  This has the advantage of being able to build the GUI from the same clone as the dll, rather than maintaining two workspaces.  (That was a reason for me to do this anyway.)\r\n\r\nThere are a couple of problems with this currently.  \r\n\r\n* When using GNU tar to extract source, the original file times of the source files are not maintained.  This plays havoc with subsequent attempts to make.  I've raised a bug report with MS and they will eventually fix this.  In the meantime, you can use the port of bsdtar from <http://gnuwin32.sourceforge.net/packages/libarchive.htm> by quoting the path e.g. `--gtar=/mnt/c/SW/GnuWin32/GnuWin32/bin/bsdtar.exe` to configure.\r\n\r\n* Also, there is some problem with using concurrency.  The build works if make is not asked to run more than 1 job at a time i.e.  `--launch-jobs=1` or a call of `make` without any options works.  I've not tried to diagnose this - it may be a fault in the build system exposed by the different scheduling running against the Windows Linux kernel implementation.\r\n\r\nWhether either of these issues ought to be documented in the HandBrake build for Windows documentation I don't know.\r\n\r\nI've only used a toolchain built-in Linux filestore (VolFs) i.e. `scripts/mingw-w64-build x86_64 ~/hbtoolchain`\r\n\r\n### Building using MSYS2\r\n\r\nFor building for Windows, an alternative to build from a single workspace is to use gcc from the MSYS2 environment.  This isn't currently documented for Handbrake and since the build system supports it, perhaps this ought to be documented here too.\r\n\r\nAfter installing MSYS2 from <http://www.msys2.org/> and updating with \r\n```\r\npacman -Syu\r\npacman -Su\r\n```\r\nI added the following packages:\r\n```\r\npacman -S base-devel cmake diffutils gcc git make mingw-w64-cross mingw-w64-cross-toolchain mingw-w64-x86_64-gcc mingw-w64-x86_64-yasm yasm\r\n```\r\nAnd then ran\r\n```\r\ngit clone https://github.com/HandBrake/HandBrake.git && cd HandBrake\r\n./configure --cross=x86_64-w64-mingw32 --enable-qsv --enable-fdk-aac --launch-jobs=10 --launch\r\n```\r\nThis is all in an MSYS shell rather than a MINGW64 shell - the latter fails in `configure` unable to find `x86_64-w64-mingw32-ar`\r\n"},"comment":{"url":"https://api.github.com/repos/HandBrake/HandBrake/issues/comments/444478323","html_url":"https://github.com/HandBrake/HandBrake/issues/1054#issuecomment-444478323","issue_url":"https://api.github.com/repos/HandBrake/HandBrake/issues/1054","id":444478323,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NDQ3ODMyMw==","user":{"login":"uweiner","id":18006293,"node_id":"MDQ6VXNlcjE4MDA2Mjkz","avatar_url":"https://avatars0.githubusercontent.com/u/18006293?v=4","gravatar_id":"","url":"https://api.github.com/users/uweiner","html_url":"https://github.com/uweiner","followers_url":"https://api.github.com/users/uweiner/followers","following_url":"https://api.github.com/users/uweiner/following{/other_user}","gists_url":"https://api.github.com/users/uweiner/gists{/gist_id}","starred_url":"https://api.github.com/users/uweiner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uweiner/subscriptions","organizations_url":"https://api.github.com/users/uweiner/orgs","repos_url":"https://api.github.com/users/uweiner/repos","events_url":"https://api.github.com/users/uweiner/events{/privacy}","received_events_url":"https://api.github.com/users/uweiner/received_events","type":"User","site_admin":false},"created_at":"2018-12-05T13:06:13Z","updated_at":"2018-12-05T13:06:13Z","author_association":"NONE","body":"GitHub Desktop for windows adds a Carriage Return at the end of each line.\r\nAs a result, the build of hb.dll fails in the linux box. Anyone knows how to tell GitHub Desktop not to do add Carriage Return automatically?\r\nThe win\\CS code compiles fine, but the code in the linux box only compiles well if I clone HandBrake repository again from the linux box command-line (to another location).\r\n"}}
{"actor":{"display_login":"uweiner"}}