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

Windows dependencies build #1197

Merged
merged 6 commits into from
Oct 23, 2024
Merged

Windows dependencies build #1197

merged 6 commits into from
Oct 23, 2024

Conversation

AAndrisa
Copy link
Collaborator

PR Description

In the old flow the needed dependencies were downloaded from a zip, and for msvc and mingw compiler were used the same files.
Now each compiler has its own specific dependencies.
Artifact manifest was updated and also publish deps script with the corresponding paths of the new files.
This PR is related to #1183

PR Type

  • Bug fix (a change that fixes an issue)
  • New feature (a change that adds new functionality)
  • Breaking change (a change that affects other repos or cause CIs to fail)

PR Checklist

  • I have conducted a self-review of my own code changes
  • I have commented new code, particulary complex or unclear areas
  • I have checked that I did not intoduced new warnings or errors (CI output)
  • I have checked that components that use libiio did not get broken
  • I have updated the documentation accordingly (GitHub Pages, READMEs, etc)

Copy link
Contributor

@rgetz rgetz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in general - this looks great. Thanks

I think you need to distribute the source of the dependencies to be license complainant. (not just the dlls). Although - I don't see the point in doing this in a giant tar - just in the source tar, the dependencies should be there as well.

plus - don't forget to fix the Codacy issue pointed out.

-Robin

FOR /F "USEBACKQ TOKENS=*" %%F IN (`%vswhere% !vswhere_params! -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe`) DO (
SET msbuild="%%F"
)
:: clone the zstd repo and build it with the desierd configuration
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

desierd

should be desired? (spelling)

cmake --build libxml2-build --config Release --target install

:: clone and build libserialport project
git clone https://github.com/sigrokproject/libserialport.git
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for other repos - you are getting specific versions. for libserialport - you are grabbing tip of master - is that what you want to do? (I'm not sure there is a better idea, since the newest release is so old)...

Copy link
Collaborator Author

@AAndrisa AAndrisa Sep 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another idea would be to specifically git checkout a commit from the master branch, in case other commits will be added in which case that might brake things for us. (if this is not ok, I will leave it as it is)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

considering a release was just done (last week) - maybe that's what you should point to?

https://github.com/sigrokproject/libserialport/tree/libserialport-0.1.2

@rgetz rgetz mentioned this pull request Sep 13, 2024
8 tasks
@AAndrisa
Copy link
Collaborator Author

AAndrisa commented Sep 25, 2024

in general - this looks great. Thanks

I think you need to distribute the source of the dependencies to be license complainant. (not just the dlls). Although - I don't see the point in doing this in a giant tar - just in the source tar, the dependencies should be there as well.

plus - don't forget to fix the Codacy issue pointed out.

-Robin

In the source tar should be included just the source code of the built dependencies?

@tfcollins
Copy link
Contributor

in general - this looks great. Thanks
I think you need to distribute the source of the dependencies to be license complainant. (not just the dlls). Although - I don't see the point in doing this in a giant tar - just in the source tar, the dependencies should be there as well.
plus - don't forget to fix the Codacy issue pointed out.
-Robin

In the source tar should be included just the source code of the built dependencies?

Yes and build scripts used so others can repeat.

Copy link
Contributor

@tfcollins tfcollins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides the package for dependency source+build scripts this looks good

:: if is run from the root of the libiio project all the dependencies will be found in the deps folder of the project
:: in case you already have some dependencies build just comment them in the script and during compilation of libiio specify the path
:: export as environment variables the ARCH, PLATFORM_TOOLSET and COMPILER used for visual studio build
:: ex: set ARCH=x64, PLATFROM_TOOLSET=v143 and COMPILER='Visual Studio 17 2022' for VS2022
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: PLATFROM_TOOLSET

@AAndrisa
Copy link
Collaborator Author

v2: update, add archive with the source code of the build dependencies for msvc build

Copy link
Contributor

@rgetz rgetz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me - thanks

(would still fix the Codacy issue though).

New flow for mingw builds on windows operating system is implemented by
installing the nedeed dependencies and build libiio with the bash from
msys2 that supports also mingw64.

The dependencies will be installed with pacman.

Signed-off-by: Andreea Andrisan <Andreea.Andrisan@analog.com>
With the new script added we can build libiio via msys2 bash using also
dependencis installed with pacman.

By removing the old dll files that were downloaded from an archive the
paths to the dependencies needed to be modified and now they are copied
from the mingw64 folder.

Signed-off-by: Andreea Andrisan <Andreea.Andrisan@analog.com>
@AAndrisa
Copy link
Collaborator Author

v3: fix Codacy issue

This script will clone and download different dependencies of the libiio
in order to build them with the msvc compiler.

Using msbuild that is the visual studio program designed for terminal
builds of visual studio projects.

Signed-off-by: Andreea Andrisan <Andreea.Andrisan@analog.com>
Switch to new script and modify the paths form cmake command and also
the path from where the dll files were copied.

The old script build_win.ps1 was renamed in build_win_msvc.ps1 because
now it supports just the msvc compiler, eliminating the support for
mingw because was not needed anymore.

Signed-off-by: Andreea Andrisan <Andreea.Andrisan@analog.com>
Export the source code of the build dependencies with msvc for the
Windows build.

Signed-off-by: Andreea Andrisan <Andreea.Andrisan@analog.com>
After new libraries build the nameing of some files was changed
and also the file was not updated with the lates changes.

Signed-off-by: Andreea Andrisan <Andreea.Andrisan@analog.com>
@AAndrisa
Copy link
Collaborator Author

v4: clone libserialport release

@AAndrisa AAndrisa merged commit 790a6c9 into main Oct 23, 2024
24 checks passed
@AAndrisa AAndrisa deleted the windows_dep branch October 23, 2024 18:19
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.

5 participants