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

Questions about Bat script. #989

Closed
1480c1 opened this issue Dec 4, 2018 · 46 comments
Closed

Questions about Bat script. #989

1480c1 opened this issue Dec 4, 2018 · 46 comments

Comments

@1480c1
Copy link
Member

1480c1 commented Dec 4, 2018

Continuation of the previous line of question, why is it that only cyanrip2 in line 858 and 859 has "yes" and "no" instead of shorted y and n? I do noticed that you check for yes instead of the y in the compile.sh. Nothing really major affected by this, just wondering why.

@1480c1
Copy link
Member Author

1480c1 commented Dec 4, 2018

I guess another question is should I limit the maximum amount of cores/threads for the cpu cores count question? Right now I have the max to be 99 because I doubt anyone would want to run more than 99 jobs on one computer.

Another question I have about the cpu count thing is why is there a for /l loop counting from 1 and incrementing by 1 to the core count answer (as far as my batch programming understanding goes, this is what I interpret from it)?

@wiiaboo
Copy link
Member

wiiaboo commented Dec 4, 2018

Continuation of the previous line of question, why is it that only cyanrip2 in line 858 and 859 has "yes" and "no" instead of shorted y and n? I do noticed that you check for yes instead of the y in the compile.sh. Nothing really major affected by this, just wondering why.

Probably forgot that y/n was the norm when I added it. No special reason.

I guess another question is should I limit the maximum amount of cores/threads for the cpu cores count question? Right now I have the max to be 99 because I doubt anyone would want to run more than 99 jobs on one computer.

There's probably someone with a 128-thread dual Xeon raising their hand somewhere in the world.

Another question I have about the cpu count thing is why is there a for /l loop counting from 1 and incrementing by 1 to the core count answer (as far as my batch programming understanding goes, this is what I interpret from it)?

I'd assume it's a failsafe for negative/zero numbers/NaN, but that was also done by jb-alvarado, so I can't explain why it was done that way.

@1480c1 1480c1 changed the title Cyanrip2 has "yes" and "no" instead of "y" and "n", Why? Questions about Bat script. Dec 5, 2018
@1480c1
Copy link
Member Author

1480c1 commented Dec 5, 2018

I guess for now, I'll just use this thread for any questions about any syntax or anything weird that I spot in the script. I'll close this for now and reopen when I have one.

@1480c1 1480c1 closed this as completed Dec 5, 2018
@1480c1
Copy link
Member Author

1480c1 commented Dec 6, 2018

I guess I have another question, a major I one. On line 1372, the variable try32 is set after asking if the person wants to try to get the mingw32 gcc compiler, however the catch below that is used to go back to retrying the installation uses the variable packF, not try32. Idk if this is a typo because after searching through the batch file, try32 is not mentioned again. Shouldn't the packF variable below it be try 32?

@1480c1 1480c1 reopened this Dec 6, 2018
@wiiaboo
Copy link
Member

wiiaboo commented Dec 6, 2018

Correct. Same thing with try64. Never catched because this is practically dead code.

@1480c1
Copy link
Member Author

1480c1 commented Dec 7, 2018

Next major question, should I still include XP support (the x265 option 6)? Because xp does not have a powershell by default. And the latest I can download is 2.0, while the actual latest is 6.1, with the minimum of the script being 3.0 which is available on 7 and on 8 by default. Like should I keep it, or should I hide it ( still an option, just now shown in the list)?

@1480c1
Copy link
Member Author

1480c1 commented Dec 7, 2018

I'm right trying to test to see if I can run the script, however, I will not be able to test a 64 bit installation due to my 64 bit xp pro iso not working even though I just ripped it from a dell cd.

Edit: It doesn't even have pause.

@wiiaboo
Copy link
Member

wiiaboo commented Dec 7, 2018

The script should not be expected to run on anything older than 8.1. The xp option is for the compiled binaries.
64-bit XP is a travesty that shouldn't have existed.

@1480c1
Copy link
Member Author

1480c1 commented Dec 7, 2018

Okay, next, I looked through the bat script and the only time forceQuitBatch is mentioned outside of the question thing is in a if that is commented out. Is it necessary for me to include this?

@wiiaboo
Copy link
Member

wiiaboo commented Dec 7, 2018

Probably not, that was a questionable workaround for a msys issue.

@1480c1
Copy link
Member Author

1480c1 commented Dec 9, 2018

So, far, I'm stuck on running the update script because it keeps on saying that I'm missing mintty even though it's clearly installed. One thing I do note is that mintty does not show up in pacman -Qqe. My current problem is that even though it runs the compile script, it seemingly does not run it properly when I try to circumvent using mintty even though everything else seems in order.

@1480c1
Copy link
Member Author

1480c1 commented Dec 9, 2018

Even when I have mintty set as explicit using pacman -D --asexplicit --noconfirm mintty right before running the script, it still says its not installed.

@1480c1
Copy link
Member Author

1480c1 commented Dec 9, 2018

Although another thing to note is that also happens when running the bat, so I'm looking in the update script right now to see if it somehow sets mintty as dep.

@1480c1
Copy link
Member Author

1480c1 commented Dec 9, 2018

Also, I'm not exactly sure on how the licenses work since I've never had an interest in reading up on how GPL and LGPL work but can I include 7Zip4Powershell in the script? It's licenced as LGPL 2.1 while this suite is GPL 3.0. I've tried looking up if I can include a LGPL program/script within a GPL program/script but all the answers were just either look at the license or ask a lawyer and there were no clear answers.

I'm slightly assuming yes, but idk at this point.

@wiiaboo
Copy link
Member

wiiaboo commented Dec 9, 2018

Although another thing to note is that also happens when running the bat, so I'm looking in the update script right now to see if it somehow sets mintty as dep.

It's explicitely in the msyspackages list of packages, so it shouldn't be marked as dependency. By itself, it shouldn't ever be a dependency, since it's one terminal emulator, so nothing should ever depend on it.

You can include more liberal licensed programs or libraries inside GPL, yes.

@wiiaboo
Copy link
Member

wiiaboo commented Dec 9, 2018

And yes, you can include 7zip4Powershell, as long as you don't have to install anything to get it. other than Powershell itself.

@1480c1
Copy link
Member Author

1480c1 commented Dec 11, 2018

I guess a status update is that so far, Its running the compile script, although I so many ugly work around by my standard that I will try to see if I can fix them ( mainly related to how powershell writes stuff to text files with the whole debacle of \r\n and \n, its causing the conf files and mirrorlists for pacman to be deleted through the update script).

@1480c1
Copy link
Member Author

1480c1 commented Dec 11, 2018

So, was successful. I have ffmpeg along with qsv and nvenc with fdk and others. I also have the other binaries.

@1480c1
Copy link
Member Author

1480c1 commented Dec 14, 2018

So far so good, only problem is that the pac-* files aren't being written properly by powershell and thus the update script is not reading them correctly, even through the ming($bit).sh is installing them properly. The other problem right now is that when circumventing mintty by running bash within powershell, powershell does not handle ascii colors properly and thus it shows Γö£ and [�[311m within the console (the logs generated both from mintty and powershell show the same thing though). Right now, I'm trying to figure out how to properly fix the writing of pac- files and trying to find a way to display the colors without a systemwide reg edit.

@1480c1
Copy link
Member Author

1480c1 commented Dec 14, 2018

Update: I got the ├ to work, only problem now is the colors as powershell can't handle direct ascii colors like mintty does.

@1480c1
Copy link
Member Author

1480c1 commented Dec 15, 2018

Uhh, I think this might be a problem, Leptonica 1.77.0 14 Dec 18... Renamed autobuild --> autogen.sh
Line 410 of media-suite_compile.sh [[ -f configure ]] || log autogen ./autobuild
Might need to change this?

Not exactly sure, mainly looked into this because my compile keeps on failing due to ./autobuild not existing.

@1480c1
Copy link
Member Author

1480c1 commented Dec 15, 2018

If anything, it seems to be nearly the exact same file except the third line having # autogen.sh instead of # autobuild

@1480c1
Copy link
Member Author

1480c1 commented Dec 15, 2018

Actually, nevermind. Didn't see the new changes. I wish github would notify me of any updates to the main repo or automatically pulling it in case there is no conflicts.

@wiiaboo
Copy link
Member

wiiaboo commented Dec 15, 2018

There's RSS and and you can also Follow the repository.

@1480c1
Copy link
Member Author

1480c1 commented Dec 21, 2018

Is there a reason why the packages are downloaded using the Sw switch for pacman and then installed using S for lines 1304, 1356, and 1390? Would it be possible to just condense them to a single S, or is there something else that relies on the packages being downloaded?

@wiiaboo
Copy link
Member

wiiaboo commented Dec 22, 2018

In short: Windows/NTFS being little babies that can't take a bit of IO use from pacman.
Search for write errors in the Issues.

@1480c1
Copy link
Member Author

1480c1 commented Dec 22, 2018

I see, I've never had much of a problem when installing a few packages using pacman, but then again I've never installed the same amount of packages as the script does at one time.

@1480c1
Copy link
Member Author

1480c1 commented Jan 7, 2019

Should I add in the option to have it automatically add the bin-video,bin-audio folders to path?
Meaning ask a question about adding the bin folders to the environment path with warnings about it and then checking if bin-video and bin-audio already exists in the path then splitting based on ; and replacing them with %instdir%\local%bit%\bin-video and bin-audio or if they don't exist in path, append them to path?
something like [Environment]::SetEnvironmentVariable("Path", $env:Path + ";$PSScriptroot\local$($bit)\bin-video;$PSScriptroot\local$($bit)\bin-audio", [EnvironmentVariableTarget]::Machine)

@1480c1
Copy link
Member Author

1480c1 commented Jan 7, 2019

I do know that it will go against the "just delete the suite folder" idea of removing the suite, but I think that at least a notification of the existence of environment path would probably help for people who have little to no experience with console and just wanted to build ffmpeg with fdk with non-free license such as @ #999

@wiiaboo
Copy link
Member

wiiaboo commented Jan 7, 2019

It's always a better idea to move/copy the compiled binaries to somewhere else, since they need to be replaced/deleted while building, so they can't be in use by something else.
So at most, you could add the option to copy/install the binaries automatically to somewhere else on a successful build finish.

@1480c1
Copy link
Member Author

1480c1 commented Jan 7, 2019

Okay, I probably will add that instead.

@1480c1
Copy link
Member Author

1480c1 commented Jan 15, 2019

So I see,

ffmpeg and apps that use it will depend on
%INSTALLDIR%/local64/bin-video/Processing.NDI.Lib.x64.dll to run!

Does that mean that ffmpeg will look for it in the same folder?
I'm trying to make sure which items I would need to copy over to a final directory.

@wiiaboo
Copy link
Member

wiiaboo commented Jan 15, 2019

It needs to be on %PATH%, afaik. So it could be same directory or any other directory that's in %PATH%. If it were *nix, it'd use LD_LIBRARY_PATH or something.

@1480c1
Copy link
Member Author

1480c1 commented Jan 16, 2019

I see, I'll just copy whatever is in the bin* folders along with the exe while keeping and sub folder structure. I'll just add a notification that it's up to the user to either add the end folder to path or set the final folder to a folder that's already in path.

@1480c1
Copy link
Member Author

1480c1 commented Jan 16, 2019

So according to the doc linked by @schmidthubert, it seems that it's best to just have the dlls with the executables due to the directory with the executables being the first one searched. So I'll just do the copy the subdirectories with the libraries along with the executables.

@1480c1
Copy link
Member Author

1480c1 commented Jan 16, 2019

I guess also that way, anytime any of the dlls or executables have been updated, the forced copy will replace the old ones in the final directory.

@wiiaboo
Copy link
Member

wiiaboo commented Jan 16, 2019

Which will fail if they're being used, so try to handle that, if possible. In *nix it works because executables don't get locked while being run.

@1480c1
Copy link
Member Author

1480c1 commented Jan 16, 2019

@1480c1
Copy link
Member Author

1480c1 commented Jan 19, 2019

Just curious, what editor do you guys use?

@wiiaboo
Copy link
Member

wiiaboo commented Jan 19, 2019

Sublime ocasionally and mostly VSCode.

@1480c1
Copy link
Member Author

1480c1 commented Jan 28, 2019

Is the whole, ending the parenthesis one indention in with the same indentation as the things in between, a quirk of JB? Because since some of the things weren't consistent, it's been slightly annoying.
e.g.
Line 1396-1404

(
echo.echo -ne "\033]0;install base system\007"
echo.msysbasesystem="$(cat /etc/pac-base.pk | tr '\n\r' '  ')"
echo.[[ "$(uname)" = *6.1* ]] ^&^& nargs="-n 4"
echo.echo $msysbasesystem ^| xargs $nargs pacman -Sw --noconfirm --ask=20 --needed
echo.echo $msysbasesystem ^| xargs $nargs pacman -S --noconfirm --ask=20 --needed
echo.echo $msysbasesystem ^| xargs $nargs pacman -D --asexplicit
echo.sleep ^3
echo.exit
    )>%build%\pacman.sh

vs line 1447-1455

(
    echo.echo -ne "\033]0;install 32 bit compiler\007"
    echo.mingw32compiler="$(cat /etc/pac-mingw.pk | sed 's;.*;mingw-w64-i686-&;g' | tr '\n\r' '  ')"
    echo.[[ "$(uname)" = *6.1* ]] ^&^& nargs="-n 4"
    echo.echo $mingw32compiler ^| xargs $nargs pacman -Sw --noconfirm --ask=20 --needed
    echo.echo $mingw32compiler ^| xargs $nargs pacman -S --noconfirm --ask=20 --needed
    echo.sleep ^3
    echo.exit
    )>%build%\mingw32.sh

@wiiaboo
Copy link
Member

wiiaboo commented Jan 28, 2019

I think the second one's from me/SublimeText. I've always hated both kinds of indentation.

@1480c1
Copy link
Member Author

1480c1 commented Jan 28, 2019

Should I do a pr with formatting the indentions to one format? (Parenthesis end on the same column as they began on, or the same style as the second one?)

@wiiaboo
Copy link
Member

wiiaboo commented Jan 28, 2019

I don't know what're the guidelines for batch code, choose whichever you want.

@1480c1
Copy link
Member Author

1480c1 commented Jan 28, 2019

Afaik, there is no guidelines for batch,I'll format it with the end on the same column as the beginning.

@1480c1 1480c1 closed this as completed May 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants