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

Needs to be updated for move to gitlab #18

Open
Moini opened this issue Jun 10, 2017 · 38 comments
Open

Needs to be updated for move to gitlab #18

Moini opened this issue Jun 10, 2017 · 38 comments

Comments

@Moini
Copy link
Contributor

Moini commented Jun 10, 2017

Hi Olof,

can you let me know if you have the time to update the vagrant file?

This repo was linked from the Inkscape website at https://inkscape.org/en/develop/getting-started/ , and I had to take it out of it now, because of the git move. However, I would like to include it again, when the repo has been updated.

[Note to self: this is the text:
Building inside a Virtual Box VM

Possibly the simplest way to build Inkscape is using inkup, which provides you with a Vagrantfile capable of building a virtual machine, which build Inkscape from sources. It requires you to have VirtualBox and Vagrant installed on your machine.]

@objarni
Copy link
Owner

objarni commented Jun 10, 2017 via email

@Moini
Copy link
Contributor Author

Moini commented Jun 10, 2017

Thx, @objarni !

@objarni
Copy link
Owner

objarni commented Jun 11, 2017

I have fiddled around for awhile now, it seems I cannot get Vagrant+VBox to install guest additions (needed for vagrant to function) correctly on my system (Windows 10, VBox 5.1.16, Vagrant 1.9.2), so I am not able to test the switch just now.

Do you have a functioning VBox+Vagrant system to test the switch in?

@Moini
Copy link
Contributor Author

Moini commented Jun 11, 2017

VBox yes, but I've never used Vagrant. I'm not even sure about how these things will be 'stacked'...

I assume that vagrant opens a virtualbox instance and creates or downloads a VM, then logs into it and pulls and builds Inkscape?
(why the 'docker' folder?)

But I'm going to test your instructions now ;-)

@Moini
Copy link
Contributor Author

Moini commented Jun 11, 2017

First issue:
doesn't work with ssh, needed to do

git clone https://github.com/objarni/inkup.git
(this will always work, no matter if you have your ssh keys configured correctly or not)

Second issue:
Vagrant from package management doesn't find VirtualBox, although it is installed.
Seems it only supports Vbox 4.0, 4.1, 4.2, 4.3, 5.0, and I have got 5.1.22... (newer than what is available from repos, because it fixes an issue...)
Current version from https://www.vagrantup.com/downloads.html works with my Virtualbox (but that's not an issue for most people - just caused by my custom VBox installation).

Third issue:
Same ssh problem for inkscape.
Changing address to https://gitlab.com/inkscape/inkscape.git solved it.

Fourth issue:
starting vagrant up when machine is already downloaded and imported, but there is no inkscape source code on it, just stops. Can it check for this instead, in case gitlab couldn't be reached?

==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: flag to force provisioning. Provisioners marked to run always will still run.

So, I deleted the VM, and tried anew.

(btw. it asks me if I want to upgrade to 16.04, when I log in)

fifth issue:
git clone seems to fail (nothing happens, no files in /inkscape directory) - when done manually, it works....

Dinner is ready, taking a break.

@objarni
Copy link
Owner

objarni commented Jun 11, 2017

Thanks for your thourough testing!

To answer each of your issues:

  1. Ah, yes. Changing to https instead of ssh will not even assume people have SSH keys setup, which makes sense. I'll change.

  2. Argh, tricky. Not sure how to handle ATM.

  3. Good, I'll change.

  4. Yeah, this is one reason I'd like to change to ansible, puppet or chef instead of "custom bash script" inside the Vagrantfile. Those tools are much better at handling 'recovery/start/restart' than a bash script can ever be... So I'm slightly reluctant to "hack" the script, as I'd rather not make it any more complicated than it alredy is. Of the three tools I mentioned, ansible is the least heavyweight when it comes to learning/dependencies (just ssh) and also the most modern, so I'd prefer ansible before the other two.

  5. No idea why it fails. Would you retry after throwing away the inkup_xyz machine from the VBox main interface? (it's just another VM)?

@objarni
Copy link
Owner

objarni commented Jun 11, 2017

About docker: I have removed it. It was an attempt to switch from vagrant to docker, however it required the host OS to be Linux, and all necessary binary library dependences to be available too, which just misses the target of inkup (which is to make it easy to get started with inkscape development).

@objarni
Copy link
Owner

objarni commented Jun 11, 2017

I have solved (1) and (3); would you mind re-trying "vagrant up" from scratch, that is after removing the previous VM? If that succeeds, I would consider this issue closed.

Of course, the general hassle of vagrant/vbox/vbox guest additions versioning does not go away, but it is unrelated to this issue.

@Moini
Copy link
Contributor Author

Moini commented Jun 11, 2017

I think 5.) might have been an issue with me not using ls -a, but only ls....
Vagrant is running currently, I'll check again.

I've looked up if it's possible to only get a single git branch, to reduce the time it takes to clone.
git clone -b trunk (or master now?) --single-branch git://sub.domain.com/repo.git - but not sure if it makes a relevant difference. Inkscape is huge with or without the 120 branches currently in the repo...

@objarni
Copy link
Owner

objarni commented Jun 11, 2017

Ah, great idea!

I just tried, the command "git clone https://github.com/inkscape/inkscape.git --single-branch" took less than 15 seconds! Terrific!

You or me to add --single-branch? 💃

@Moini
Copy link
Contributor Author

Moini commented Jun 11, 2017

You accidentally used the github repo mirror of Inkscape in your Vagrantfile ;-)

@Moini
Copy link
Contributor Author

Moini commented Jun 11, 2017

Can you do both?

@Moini
Copy link
Contributor Author

Moini commented Jun 11, 2017

I haven't checked how it works to update such a branch. Hope there are no pitfalls.

@objarni
Copy link
Owner

objarni commented Jun 11, 2017

Github, what a mistake! :) I blame Inkup being on Github.. Fixed, and using single-branch clone too.

"I haven't checked how it works to update such a branch. "

I don't understand what you mean?

@Moini
Copy link
Contributor Author

Moini commented Jun 11, 2017

I know that if you do a lightweight bzr checkout, that branch is kind of worthless for updating etc. Was afraid that there may be a similar issue with single-branch git checkouts.

@Moini
Copy link
Contributor Author

Moini commented Jun 11, 2017

Running now.

@objarni
Copy link
Owner

objarni commented Jun 11, 2017

What is running? Build or Inkscape?

About updating, inkup is for exploring and learning inkscape source and build, not really to do merge requests. I would suggest developing in the code base of the VM, and then copying changes to host machine in a proper git/ssh environment.

Of course, if you have ideas how to improve that use case (being able to actually push changes on new branches to gitlab), that would be great!

@Moini
Copy link
Contributor Author

Moini commented Jun 11, 2017

Sorry for being so unspecific. I meant my next trial with vagrant up.

People would need to setup their own ssh keys etc. on the machine - I don't think that can be automated, unless you give prompts to visit gitlab and upload a generated key ;-)

I'm on native Ubuntu 16.04 (or rather, Linux Mint 18.1), so if I ever wanted to upload code into the Inkscape repo (which I probably wouldn't without a merge request), I'd do it from my own machine directly. I've started to script the build process, too (for allowing parallel installs, with separate preferences directories and different package names, but only can work on .deb-using systems).

Definitely longer than 15 seconds now. Can vagrant redirect the output, so I can read what is happening?

@Moini
Copy link
Contributor Author

Moini commented Jun 11, 2017

(There is still network and disk activity on my VM, but that's all I can see)

@Moini
Copy link
Contributor Author

Moini commented Jun 11, 2017

Ha, I think I know now why it only took 15 sec for you - you used the near-empty gitlab repo ;-)

@objarni
Copy link
Owner

objarni commented Jun 11, 2017

The expected total time from no-image to built inkscape is around 40 minutes on my machine, of course depends on a lot of things.

Things that take time:

  1. letting Lubuntu update itself
  2. building Inkscape

Checking out the source code actually took a substantial amount of time from LP ( 10 minutes ? ) so the move has really sped up inkup.

You should be able to ssh into the machine, using vagrant/vagrant credentials, if you want to see what it is up to. Looking at top, and /var/log/syslog might give some hints?

@Moini
Copy link
Contributor Author

Moini commented Jun 11, 2017

It's building :)

@Moini
Copy link
Contributor Author

Moini commented Jun 11, 2017

And ends with:

==> default: [ 16%] 
==> default: Built target 2geom_LIB
==> default: make: 
==> default: *** [all] Error 2
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

@objarni
Copy link
Owner

objarni commented Jun 11, 2017

"Ha, I think I know now why it only took 15 sec for you - you used the near-empty gitlab repo ;-)"

You are right. I timed it again with correct URL, it is a more modest 3m55s now.

Could try doing a make yourself inside the box? It seems something went wrong with the actual make:ing of the project, but at least lib2geom seems to have gone alright?

Also, see my README.md for troubleshooting tips, to clean up the CMake files.

@Moini
Copy link
Contributor Author

Moini commented Jun 11, 2017

Already working on it - running the build without all the options in the Vagrant file, though.

Just cmake ../inkscape and make. Also didn't set the environment variables you set in the script.

Yeah, but now with a useful error message (sorry, right-click doesn't work in the VM, cannot copy-paste...):

bildschirmfoto_2017-06-11_23-05-48

@Moini
Copy link
Contributor Author

Moini commented Jun 11, 2017

Btw. you must have awesome bandwidth :)

@objarni
Copy link
Owner

objarni commented Jun 11, 2017

Ah, just remembered something that might be happening here when you get weird "make fails". Increase the VM's RAM memory to like 6 GB. Since it is doing builds in paralell (make -j2) it consumes a lot of RAM.

3 GB might not make it.

@Moini
Copy link
Contributor Author

Moini commented Jun 11, 2017

Ok, will try.

@Moini
Copy link
Contributor Author

Moini commented Jun 11, 2017

Btw. the clean-cmake-files command doesn't work - it tells me that
the source directory "/home/vagrant/build-inkscape/clean-cmake-files" does not exist

(I just delete the directory)

@objarni
Copy link
Owner

objarni commented Jun 11, 2017

Yeah, I would also just delete the build-inskscape folder and start over. Could you add an issue so that we do not forget to update the readme?

Off to bed, thanks for all your testing and contribution!

@Moini
Copy link
Contributor Author

Moini commented Jun 11, 2017

Good night - the build succeeded with more memory :)
Edit: I'm not sure how, but I got this wrong.

@Moini
Copy link
Contributor Author

Moini commented Jun 11, 2017

When README is updated, I'll add it back to the website :)

@Moini
Copy link
Contributor Author

Moini commented Jun 11, 2017

Huh? I must have been totally confused. Now it got stuck again at 16%, and there is no Inkscape installed. The error must be with the Inkscape / libnrtype code.

@objarni
Copy link
Owner

objarni commented Jun 12, 2017

I think this build issue may be related. Might it be so that the devlib available inside the Lubuntu VM is dated?

http://inkscape.13.x6.nabble.com/Alternative-glyphs-td4980002.html#a4980016

@Moini
Copy link
Contributor Author

Moini commented Jun 12, 2017

When I do an apt-cache policy on my 16.04-based machine, I get harfbuzz-dev 1.0.1, and Inkscape compiles. Shouldn't the if-else check for the harfbuzz version work just as well on 14.04?... Anyway, not exactly your issue... Unless you want to update the VM, too (then you could add more RAM, too - but I'm no longer sure it's needed.).

I have timed the cloning now, too, on my desktop ;-) - result:
all branches: 27 minutes, 1,5 Gb
single branch: 17 minutes, 900 Mb, so 10 minutes saved with my internet connection :) (which is fast, for Germany).
compiling with j3: 15 minutes

@objarni
Copy link
Owner

objarni commented Jun 12, 2017

OK, I don't quite understand how the dependency check works, is it a C-header or part of CMake scripts? Where would you make a change in the Inkscape project in order for upstream to fix this issue..? Or is it a consequence of some dependency add done in the provision script?

Nice build time :)

@Moini
Copy link
Contributor Author

Moini commented Jun 12, 2017

I can only give you the link to the file. I'm not a C++ person, and only know a little Python, all I can do is follow variable names around the code, by using search.

https://gitlab.com/inkscape/inkscape/blob/840a38b13e01c5782d88cef336fe10352cf0c212/src/libnrtype/FontFactory.cpp#L750

(and it worked fine on Ubuntu 16.04 - but seemed to cause issues on the VM - the code is 6 days old, so it should have been available yesterday)

@objarni
Copy link
Owner

objarni commented Jun 13, 2017

Ok so one solution is to use a 16.04 base box instead of 14.04.

There is probably some image available however it annoys me as it doesn't really explain the reason behind the error.

We could check with Inkscape core devs on the irc channel I guess, if they can see anything obvious.

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