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

Add Windows CI #124

Merged
merged 1 commit into from
Mar 30, 2020
Merged

Add Windows CI #124

merged 1 commit into from
Mar 30, 2020

Conversation

Luni-4
Copy link
Collaborator

@Luni-4 Luni-4 commented Mar 20, 2020

This PR adds a CI for Windows

@calixteman
Copy link
Collaborator

According to the log I suppose we're using powershell so maybe you could try:
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-webrequest?view=powershell-7

@Luni-4
Copy link
Collaborator Author

Luni-4 commented Mar 20, 2020

According to the log I suppose we're using powershell so maybe you could try:
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-webrequest?view=powershell-7

Thanks a lot! :)
I followed your advice, let's see if it works

@Luni-4
Copy link
Collaborator Author

Luni-4 commented Mar 20, 2020

@calixteman @marco-c

Invoke-WebRequest is not recognized as an internal or external command, operable program or batch file.

Am I doing something wrong?

@marco-c
Copy link
Collaborator

marco-c commented Mar 20, 2020

.taskcluster.yml Outdated Show resolved Hide resolved
@calixteman
Copy link
Collaborator

Ahhhh!! patches for CI...

@Luni-4
Copy link
Collaborator Author

Luni-4 commented Mar 20, 2020

@calixteman
Ahhh, you're right, so frustrating...

Practically I can't find the link.exe from Visual Studio, do you know how to retrieve that @marco-c?

@calixteman
Copy link
Collaborator

Maybe in runing vcvarsall.bat: rust-lang/rust#38584 (comment)

@Luni-4
Copy link
Collaborator Author

Luni-4 commented Mar 20, 2020

Yep, I've tried to run that, but the path is not correct. Which Visual Studio version do we have on TaskCluster?

set VS_PATH="%ProgramFiles(x86)%\Microsoft Visual Studio\2019"
call "%VS_PATH%\Community\VC\Auxiliary\Build\vcvars64.bat"

@Luni-4
Copy link
Collaborator Author

Luni-4 commented Mar 20, 2020

Nope, the path doesn't exist

@Luni-4
Copy link
Collaborator Author

Luni-4 commented Mar 20, 2020

It seems there isn't Visual Studio installed

@marco-c
Copy link
Collaborator

marco-c commented Mar 20, 2020

This is all we have in the image: https://raw.githubusercontent.com/taskcluster/generic-worker/2509a1f8589b0b536186f5fe8f043385bf67197f/worker_types/win2012r2/bootstrap.ps1.

The Windows SDK 8.1 is installed:

choco install -y windows-sdk-8.1

It should probably have the linker, we "just" need to figure out how to use it :P

@calixteman
Copy link
Collaborator

Don't we have a windows image with VS inside ?
I'd say that linker should come with VS (probably 2012 with this image)

@marco-c
Copy link
Collaborator

marco-c commented Mar 20, 2020

This image is used to build Firefox, so the linker should be available.

@marco-c
Copy link
Collaborator

marco-c commented Mar 20, 2020

It could be in some directory under C:\Program Files\Microsoft SDKs or C:\Program Files\Windows Kits

@Luni-4
Copy link
Collaborator Author

Luni-4 commented Mar 20, 2020

Would it be possible to install Visual Studio 2019 on the image? Because the main problem is the tree-sitter compilation. It will be much simpler to use that imho.

Anyway, the linker should be installed by this command:

Start-Process "C:\vcredist_x86-vs2015.exe" -ArgumentList "/install /passive /norestart /log C:\vcredist_x86-vs2015-install.log" -Wait -PassThru

Now I just need to know where :P

@marco-c
Copy link
Collaborator

marco-c commented Mar 20, 2020

@marco-c
Copy link
Collaborator

marco-c commented Mar 20, 2020

Would it be possible to install Visual Studio 2019 on the image?

It'd probably increase the size of the image too much, they just install the SDK and other dependencies because not all features of Visual Studio (especially the UI) are needed.

@calixteman
Copy link
Collaborator

We need to have a C/C++ compiler for tree-sitter stuff + linker of course.
So I'd say that we need to get VS or maybe we could use a clang artifact.

@marco-c
Copy link
Collaborator

marco-c commented Mar 20, 2020

We need to have a C/C++ compiler for tree-sitter stuff + linker of course.
So I'd say that we need to get VS or maybe we could use a clang artifact.

I don't think Visual Studio is necessary, the Windows SDK (which we have in the image) should be enough.

@Luni-4
Copy link
Collaborator Author

Luni-4 commented Mar 20, 2020

It'd probably increase the size of the image too much, they just install the SDK and other dependencies because not all features of Visual Studio (especially the UI) are needed.

That's true, let me try with the current linker then. Let's hope it works

We need to have a C/C++ compiler for tree-sitter stuff + linker of course.
So I'd say that we need to get VS or maybe we could use a clang artifact.

These problems will be solved as soon as the tree-sitter-core will be oxidized

@calixteman
Copy link
Collaborator

We need to have a C/C++ compiler for tree-sitter stuff + linker of course.
So I'd say that we need to get VS or maybe we could use a clang artifact.

I don't think Visual Studio is necessary, the Windows SDK (which we have in the image) should be enough.

You're right: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Windows_SDK_versions

@marco-c
Copy link
Collaborator

marco-c commented Mar 20, 2020

I'm trying to get access to a machine with that imageset so I can check where the linker is.

@marco-c
Copy link
Collaborator

marco-c commented Mar 20, 2020

link exe

@marco-c
Copy link
Collaborator

marco-c commented Mar 20, 2020

So it seems the Microsoft linker is not installed with the SDK with Choco :(

We could try with the linker from C:\go\pkg\tool\windows_amd64, maybe we are lucky.
Otherwise, we'd probably need this package: https://chocolatey.org/packages/microsoft-visual-cpp-build-tools.

@Luni-4
Copy link
Collaborator Author

Luni-4 commented Mar 20, 2020

I will try to use the C:\go\pkg\tool\windows_amd64 linker.

Otherwise, we'd probably need this package: https://chocolatey.org/packages/microsoft-visual-cpp-build-tools.

I've already used that package, it takes quite a lot to be installed, so we should add it to the image and recreate the image

@Luni-4
Copy link
Collaborator Author

Luni-4 commented Mar 20, 2020

It doesn't work the go path either.
Could you install the build-tools on the image, please, @marco-c?

Thanks a lot!

@marco-c
Copy link
Collaborator

marco-c commented Mar 20, 2020

We should start with installing it here, and then we can figure out if we can add it to the image (we might have to define a separate one, I need to talk with who manages that image).
Luckily on a cloud machine the command doesn't take so much: just 1 minute.

@calixteman
Copy link
Collaborator

Or maybe we could use the deepspeech image which should contain what we need.

@marco-c
Copy link
Collaborator

marco-c commented Mar 20, 2020

Yeah, we could do that and hope they keep what we need. If they don't, we'll have to define our own.
This is the setup script they are using: https://github.com/mozilla/community-tc-config/blob/9e3918d97aa629a300c403a84c20da49a3c7b1d4/imagesets/deepspeech-win2012r2-gpu/bootstrap.ps1.

@Luni-4
Copy link
Collaborator Author

Luni-4 commented Mar 20, 2020

@calixteman
Copy link
Collaborator

There is a lot of useless stuff for us in this image and we should probably create one for "standard" projects so we should create new one.
But at least we can try with the deepspeech one and we'll switch to the future one.

@Luni-4
Copy link
Collaborator Author

Luni-4 commented Mar 20, 2020

It seems I can't change the image

@marco-c
Copy link
Collaborator

marco-c commented Mar 20, 2020

Not yet, the right scopes need to be added. I'll do it on Monday.

@lu-zero
Copy link
Collaborator

lu-zero commented Mar 24, 2020

These problems will be solved as soon as the tree-sitter-core will be oxidized

I'm not sure how upstream would be amenable to this, we could complete a first pass by oxidizing the rust and the cpp parsers and see how they work with r-c-a first.

@marco-c
Copy link
Collaborator

marco-c commented Mar 26, 2020

Let's start by trying to install the package here, once we get it working we can decide about what to do with the image. Updating the image is a long process, so the trial and error to update the image first and then this PR, then the image again, etc., etc., would be super painful.

You could try to install https://chocolatey.org/packages/visualstudio2019buildtools, which can also be installed without admin rights if you pass the --installPath parameter (it should be something like choco install -y visualstudio2019buildtools --params "--installPath C:\SOME_DIR).

@Luni-4
Copy link
Collaborator Author

Luni-4 commented Mar 26, 2020

@marco-c

I tried your method but I get the following error Access to the path 'C:\ProgramData\chocolatey\lib-bad' is denied. since chocolatey is not authorized to access that directory.

Furthermore, that directory can't be changed with the --install-dir argument, because we don't have the licensed version of chocolatey.

Other than that, if we succeed, how can we reboot the machine? From the visualstudio2019buildtools package:

A reboot may be required after (or even before) installing/uninstalling this package.
If control over reboots is required, it is advisable to install the dependencies (esp. dotnetfx 4.7.2 or later) first, perform a reboot if necessary, and then install this package.

@marco-c
Copy link
Collaborator

marco-c commented Mar 26, 2020

Furthermore, that directory can't be changed with the --install-dir argument, because we don't have the licensed version of chocolatey.

That's the chocolatey argument, but we can instead pass the installation directory as a package parameter (so it's passed to the VS installer) like I mentioned above:

it should be something like choco install -y visualstudio2019buildtools --params "--installPath C:\SOME_DIR"

Other than that, if we succeed, how can we reboot the machine? From the visualstudio2019buildtools package:

Let's hope it's not required for us, we'll see.

@Luni-4
Copy link
Collaborator Author

Luni-4 commented Mar 26, 2020

That's the chocolatey argument, but we can instead pass the installation directory as a package parameter (so it's passed to the VS installer) like I mentioned above:

it should be something like choco install -y visualstudio2019buildtools --params "--installPath C:\SOME_DIR"

I tried but it doesn't seem to work because of the error mentioned above: c0d78bf

@marco-c
Copy link
Collaborator

marco-c commented Mar 26, 2020

I tried but it doesn't seem to work because of the error mentioned above: c0d78bf

OMG, this is super painful. I guess we'll have to do trial and error with the image. I'll comment here when it's ready.

@Luni-4
Copy link
Collaborator Author

Luni-4 commented Mar 26, 2020

OMG, this is super painful. I guess we'll have to do trial and error with the image. I'll comment here when it's ready.

Thank you! :)
If you need some help, ping me.

Perhaps the simplest thing would be to install a licensed version of chocolatey on the image, otherwise the build tools directly.

@marco-c
Copy link
Collaborator

marco-c commented Mar 27, 2020

Image updated, you can use C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat.

@Luni-4
Copy link
Collaborator Author

Luni-4 commented Mar 27, 2020

Image updated, you can use C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat.

Thanks a lot @marco-c! :)

I will work on that on Monday!

@marco-c
Copy link
Collaborator

marco-c commented Mar 27, 2020

Thanks a lot @marco-c! :)

No, thank you ;)

@Luni-4 Luni-4 force-pushed the win2 branch 3 times, most recently from c2489d3 to 75bd5cd Compare March 30, 2020 08:36
@marco-c marco-c merged commit 8d0d672 into mozilla:master Mar 30, 2020
@marco-c
Copy link
Collaborator

marco-c commented Mar 30, 2020

\o/

@Luni-4
Copy link
Collaborator Author

Luni-4 commented Mar 30, 2020

Yeah!! :D

@Luni-4 Luni-4 deleted the win2 branch March 30, 2020 09:43
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

Successfully merging this pull request may close these issues.

4 participants