Git Product home page Git Product logo

Comments (14)

jinmingjian avatar jinmingjian commented on September 16, 2024 1

@felix91gr great to see you show the enthusiasm for swift and sde.

The building of swift 3.1 for linux is tricky sometimes. Somes may be fixed but new could come out in that you are in the bleeding edge!

one of my suggestion seem for your problem:
jinmingjian/sde#13 (comment)

And it needs two passes in Linux: First, disable "sourcekit-inproc" comopnent for libdispatch, and second enable "sourcekit-inproc" for itself.

I do not run new build recently. The two-pass building for linux should be fixed in this Feb. But not sure why you met... you can just try two-pass building first.

from swift-linux-build.

felix91gr avatar felix91gr commented on September 16, 2024 1

Awesome! I'm gonna run it with two passes then.

I'll post here when I get results! 😄

from swift-linux-build.

felix91gr avatar felix91gr commented on September 16, 2024

Hmm 🤔

It failed again, giving me this:

+ /usr/bin/cmake --build /home/felix/Desktop/TwoPasses/build/2pass/swift-linux-x86_64 -- -j1 all swift-test-stdlib-linux-x86_64
ninja: error: '/home/felix/Desktop/TwoPasses/build/2pass/libdispatch-linux-x86_64/src/.libs/libdispatch.so', needed by 'lib/libsourcekitdInProc.so', missing and no known rule to make it
swift/utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting
swift/utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting

I think I know what's the problem. Here's my prepass preset:


##########################################################################################
[preset: prepass]#########################################################################
##########################################################################################
build-subdir=2pass
jobs=1
release
lldb
llbuild
libdispatch
swiftpm
xctest
foundation
extra-cmake-options="-DSWIFT_BUILD_SOURCEKIT:BOOL=ON -DSWIFT_TOOL_SOURCEKITD_REPL_BUILD=1"

dash-dash
 
swift-install-components=autolink-driver;compiler;clang-builtin-headers;stdlib;sdk-overlay;license;tools
#build-swift-static-stdlib=1
# modify installable-package to fit your need
install_destdir=/2p/linux/swift-git/output
installable_package=/2p/linux/swift-git/swift-git-snapshot.tar.gz

install-swift
install-lldb
install-cmark
install-llbuild
install-libdispatch
install-swiftpm
install-xctest
install-foundation
reconfigure

#use-gold-linker
skip-test-cmark
skip-test-lldb
skip-test-swift 
skip-test-llbuild
skip-test-swiftpm
skip-test-xctest 
skip-test-foundation
skip-test-libdispatch
skip-test-linux

As you can see, it has this line:

extra-cmake-options="-DSWIFT_BUILD_SOURCEKIT:BOOL=ON -DSWIFT_TOOL_SOURCEKITD_REPL_BUILD=1"

I think that one might be the culprit, since it makes the script build something related to SourceKit. I will try to build it again, without that line, and I'll tell you how it goes :)

from swift-linux-build.

jinmingjian avatar jinmingjian commented on September 16, 2024

@felix91gr ok, service yourself and fun 😃

from swift-linux-build.

felix91gr avatar felix91gr commented on September 16, 2024

Dang it, I just discovered that my computer has failing RAM.

I kept getting errors like "build stopped by signal. Run with -v to see more...", but they never happened at the same step in the compiling process. Sometimes, it stopped for "natural" reasons, like in the error with not finding libdispatch. But what mostly happened was this "signal" thing.

And so, I thought "OK, I'm probably using a bad commit. I'll use a Snapshot. But then when I use it, a snapshot that passes all of the tests, it still fails randomly... except 1 every 3 or 4 times, where it failed because I was doing it with 1-pass when it should've been 2-pass

I'm running a memtest now, and oh man, it has lots of bad sectors 😆

This computer is fairly old... I'll look up if I can find cheap RAM for it. It uses DDR2, but if it can use DDR3 then I can probably afford it.

I have another, newer pc, but that one is getting repairs so I don't have it with me at the moment. I'll keep the compiling tests back for a week or so, until I get it back.

For now... I'll see if I can help with other stuff 🙂

from swift-linux-build.

felix91gr avatar felix91gr commented on September 16, 2024

Update: nope, DDR3 is electronically incompatible with DDR2. I'll gather some from old pcs, then. They are way too expensive for the specs to buy them xD

from swift-linux-build.

felix91gr avatar felix91gr commented on September 16, 2024

Turns out: one of my SODIMMs is clean of errors; only one of them is actually faulty. I'm using now only 2GB of RAM

Then I ran the first pass (w/o sourcekit) and it compiled! (FINALLY! 😆)
I'm on to the next pass now. If it compiles, I'll start building and testing a tutorial for it 🙂

from swift-linux-build.

jinmingjian avatar jinmingjian commented on September 16, 2024

@felix91gr it is a challenge to build llvm like somethings with 2GB. Good to know you have it passed. 😸

from swift-linux-build.

felix91gr avatar felix91gr commented on September 16, 2024

@jinmingjian indeed :)

Now I had again the problem with libdispatch.so not being linked. I think it might be because I didn't do anything in between the build processes, like for example copying the libraries to /usr/lib/ or making symlinks to them. All I'm running after the checkout is this:

# Don't compile SourceKit yet
sudo swift/utils/build-script --preset=prepass 

# Now, compile SourceKit
sudo swift/utils/build-script --preset=postpass

Maybe I should modify the presets in a different way? Should I add some "set up symlinks" step?

from swift-linux-build.

jinmingjian avatar jinmingjian commented on September 16, 2024

after first pass, you should have got the libdispatch library built in

YOUR_BUILDOUT_DIR/YOUR_PRESET_NAME/libdispatch-linux-x86_64/src/.libs/libdispatch.so

The sourcekit will built against with this library location. The final built pack will have libdispatch copied into $YOUR_PACK/usr/lib, then it is your responsibility to install it into correct directory.

So, install libdispatch library into system libs is not necessary to build sourcekit (and should not effect the building process).

from swift-linux-build.

felix91gr avatar felix91gr commented on September 16, 2024

@jinmingjian 🤔

After first pass, you should have got the libdispatch library built in

YOUR_BUILDOUT_DIR/YOUR_PRESET_NAME/libdispatch-linux-x86_64/src/.libs/libdispatch.so

I don't quite have that. In the presets, I wrote:

  • Preset name: prepass, postpass
  • Build subdir: 2pass (for both)
  • Install destdir: /2p/linux/... (for both)

Maybe there lives the problem? I get libdispatch built here:

./build/2pass/libdispatch-linux-x86_64/src/.libs/libdispatch.so

Therefore, maybe SourceKit can't find it properly. Where did I mess up the presets? 😅

from swift-linux-build.

jinmingjian avatar jinmingjian commented on September 16, 2024

Could you upload the output of building here? Let me have a look for you:)

from swift-linux-build.

felix91gr avatar felix91gr commented on September 16, 2024

Could you upload the output of building here? Let me have a look for you:)

I'm doing so right now, in a fork of this repo ^^

I tried to upload a tar.gz, but it gave me problems. I'm uploading it uncompressed now, I'll update this post when it finishes 😄

from swift-linux-build.

felix91gr avatar felix91gr commented on September 16, 2024

@jinmingjian here it is: https://github.com/felix91gr/swift-linux-build
(my build output and presets)
(I ran first the prepass preset, and then the postpass preset)

from swift-linux-build.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.