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

[experimental] build lld on appveyor #286

Merged
merged 13 commits into from Dec 31, 2017
Merged

Conversation

rainers
Copy link
Member

@rainers rainers commented Dec 30, 2017

No description provided.

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @rainers!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

@rainers
Copy link
Member Author

rainers commented Dec 30, 2017

closing for now, trying it on a different account

@rainers rainers closed this Dec 30, 2017
@rainers
Copy link
Member Author

rainers commented Dec 30, 2017

Seems to work now.

Copy link
Member

@MartinNowak MartinNowak left a comment

Choose a reason for hiding this comment

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

Looks mostly good.


call "c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"
git clone --depth 1 --branch %LLVM_BRANCH% https://github.com/llvm-mirror/llvm.git llvm || exit /B 1
git clone --depth 1 --branch %LLVM_BRANCH% https://github.com/llvm-mirror/lld.git llvm\tools\lld || exit /B 1
Copy link
Member

Choose a reason for hiding this comment

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

I'd rather go with the released sources, then we also have proper versioning.
http://releases.llvm.org/download.html#5.0.1

http://releases.llvm.org/5.0.1/lld-5.0.1.src.tar.xz
http://releases.llvm.org/5.0.1/llvm-5.0.1.src.tar.xz

Bonus, check gpg signatures locally and put the sha256sums in the script (prolly simpler than gpg on window).

d5b36c0005824f07ab093616bdff247f3da817cae2c51371e1d1473af717d895  lld-5.0.1.src.tar.xz
5fa7489fc0225b11821cab0362f5813a05f2bcf2533e8a4ea9c9c860168807b0  llvm-5.0.1.src.tar.xz

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed to download the tarballs. How would you verify the SHA? (I don't think this is super important, though.)

devenv LLVM.sln /project lld /Build "MinSizeRel|Win32" || exit /B 1

if not exist ..\bin\nul md ..\bin
copy MinSizeRel\bin\lld-link.exe ..\bin
Copy link
Member

Choose a reason for hiding this comment

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

Compress the exe and output with a version number, e.g. lld-link-5.0.1.zip.

Copy link
Member Author

Choose a reason for hiding this comment

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

Building a zip file now. I'm not sure compressed exes are so great, I suspect it makes program execution slower than when reading the program from a fast disk or the file cache.

appveyor.yml Outdated
- bin\lld-link.exe -> windows\build_lld.bat

artifacts:
- path: bin\lld-link.exe
Copy link
Member

Choose a reason for hiding this comment

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

Not sure whether you could use variables here bin\lld-link-%VERSION%.zip.

Copy link
Member Author

Choose a reason for hiding this comment

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

According to the docs lld-link-$(VERSION).zip should work.

set CMAKE_OPT=%CMAKE_OPT% -DLLVM_INCLUDE_DIRS="c:/projects/llvm/include"

cmake %CMAKE_OPT% ..\llvm || exit /B 1
devenv LLVM.sln /project lld /Build "MinSizeRel|Win32" || exit /B 1
Copy link
Member

Choose a reason for hiding this comment

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

Can we trigger this manually, or build the script when the version/file changed? Running half an hour for every unrelated change seems wasteful.

Copy link
Member

Choose a reason for hiding this comment

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

AppVeyor supports crons, so we could run it once a day?

Copy link
Member Author

Choose a reason for hiding this comment

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

The build can be triggered manually if you login to Appveyor. LLD is cached (from master builds) and is only rebuilt if the dependency changes, i.e. currently the batch file.

Copy link
Member

Choose a reason for hiding this comment

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

For a fully manual build, you could add.

branches: { only: [manually-triggered-build] }

But indeed using the cache is also a good idea.

cmake %CMAKE_OPT% ..\llvm || exit /B 1
devenv LLVM.sln /project lld /Build "MinSizeRel|Win32" || exit /B 1

zip ../../lld-link-%LLVM_VER%.zip MinSizeRel\bin\lld-link.exe
Copy link
Member

Choose a reason for hiding this comment

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

cd MinSizeRel\bin
7z a ..\..\..\..\lld-link-%LLMV_VER%.zip lld-link.exe

appveyor.yml Outdated
- 'lld-link-%LLVM_VER%.zip -> windows\build_lld.bat'

artifacts:
- path: bin\lld-link-$(LLVM_VER).zip
Copy link
Member

Choose a reason for hiding this comment

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

without the bin\ now

Copy link
Member

Choose a reason for hiding this comment

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

And I guess it's also using %LLVM_VER% expansion.

@MartinNowak MartinNowak changed the base branch from master to build-lld December 31, 2017 13:38
- root seems to be project checkout
@MartinNowak
Copy link
Member

AppVeyor would still copy the artifacts for every commit on master.
Let's simply make a couple of inactive build-X branches for the different builds, then we can manually trigger them and we have a clean history of artifacts.

@MartinNowak MartinNowak force-pushed the build_lld branch 2 times, most recently from d6153bd to 72503fb Compare December 31, 2017 15:36
@rainers
Copy link
Member Author

rainers commented Dec 31, 2017

AppVeyor would still copy the artifacts for every commit on master.

Artifacts could also be uploaded when rebuilt, see https://github.com/dlang/installer/pull/284/files#diff-180360612c6b8c4ed830919bbb4dd459R58 for an example.
But it might be a bit troublesome to find the last build in this case, so another branch sounds good to me, too.

@MartinNowak
Copy link
Member

@rainers
Copy link
Member Author

rainers commented Jan 1, 2018

Signed and uploaded

Thanks. Should we add a similar build branch for the mingw libraries? The build tool dlang/tools#267 could be moved to the installer in that case.

@MartinNowak
Copy link
Member

Yes, let's add all the irregularly build ones.

@rainers
Copy link
Member Author

rainers commented Jan 2, 2018

Yes, let's add all the irregularly build ones.

#289

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants