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 meson build file #28

Merged
merged 17 commits into from Nov 7, 2019
Merged

Conversation

bioinfornatics
Copy link
Contributor

Dear,

In order to be able to build with meson. I added a meson.build file

$ meson build
$ ninja -C build
$ ninja install

meson.build Outdated Show resolved Hide resolved
meson.build Show resolved Hide resolved
@schveiguy
Copy link
Owner

Also, we need to resolve this issue with the compiler and cas. Not sure what needs to happen there, it seems like a compiler bug.

@bioinfornatics
Copy link
Contributor Author

bioinfornatics commented Nov 6, 2019

Also, we need to resolve this issue with the compiler and cas. Not sure what needs to happen there, it seems like a compiler bug.

I think too is a compiler bug as I built with meson (and ldc2) the latest release with success.
Moreover here the build fail with dub

@schveiguy
Copy link
Owner

schveiguy commented Nov 6, 2019

One final request, is there a way to ensure the meson build is tested during CI? Otherwise, you will be spending a lot of time fixing things when the meson build breaks ;)

@bioinfornatics
Copy link
Contributor Author

bioinfornatics commented Nov 6, 2019

One final request, is there a way to ensure the meson build is tested during CI?

I will take a look, I agree with you is better with test.

@bioinfornatics bioinfornatics changed the title Add meson build file WIP Add meson build file Nov 6, 2019
@bioinfornatics bioinfornatics force-pushed the meson_build_tool branch 6 times, most recently from 5210b3b to 2c55ec0 Compare November 7, 2019 07:28
@bioinfornatics
Copy link
Contributor Author

bioinfornatics commented Nov 7, 2019

So I updated CI in order to add meson build part of test.
Moreover I extended both compiler compiler and os use to ldc and osx

Only meson with ldc build actually.
It is strange as I have do any change on dub and io source code.

Moreover currently the code is not dip1000 compatible as once I enable the feature meson with ldc fail.

@bioinfornatics bioinfornatics force-pushed the meson_build_tool branch 2 times, most recently from 3950754 to 2cae3c9 Compare November 7, 2019 09:29
@bioinfornatics bioinfornatics changed the title WIP Add meson build file Add meson build file Nov 7, 2019
@bioinfornatics bioinfornatics force-pushed the meson_build_tool branch 5 times, most recently from 477f26a to b668f5f Compare November 7, 2019 10:14
@bioinfornatics
Copy link
Contributor Author

bioinfornatics commented Nov 7, 2019

I think too page deployment is broken from a long time as travis documentation tell to set the secret variable from the settings page of io repository and to use this code:

deploy:
  provider: pages
  skip_cleanup: true
  github_token: $GITHUB_TOKEN  # Set in the settings page of your repository, as a secure variable
  keep_history: true
  on:
    branch: master

To meet the travis documentation we have to

  1. set the secrete variable
  2. remove before_deploy section
  3. update the deploy section accordingly to the documentation

$url = "http://downloads.dlang.org/releases/2.x/$($latest)/dmd.$($latest).windows.7z";
#$latest = (Invoke-WebRequest "http://downloads.dlang.org/releases/LATEST").toString();
#$url = "http://downloads.dlang.org/releases/2.x/$($latest)/dmd.$($latest).windows.7z";
$url = "http://downloads.dlang.org/releases/2.x/2.088.1/dmd.2.088.1.windows.7z"
Copy link

Choose a reason for hiding this comment

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

Not sure you want this...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

current io code can build up to dmdfe 2.088.1
Updating io code should be done in another pull request

Copy link
Owner

Choose a reason for hiding this comment

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

Yeah, we can update this when the bugs are fixed in the latest compiler.

@schveiguy
Copy link
Owner

Looking at the meson build output, it doesn't look like it's running unittests. Is this expected? If it can run the unit tests, that would be ideal.

link_args : common_ldflags,
install: true,
version: meson.project_version(),
d_unittest: false
Copy link
Owner

@schveiguy schveiguy Nov 7, 2019

Choose a reason for hiding this comment

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

Can we make a separate executable with unittests turned on?

Copy link
Owner

Choose a reason for hiding this comment

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

From the meson site, looks like we can do that with:

io_test_exe = executable('io_test', sources, d_unittest: true)
test('iotest', io_test_exe)

I think we would have to add a main function somewhere, and add that to the sources.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added the option run_test

$ meson build -Drun_test=true
$ ninja build test

Copy link
Owner

Choose a reason for hiding this comment

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

Awesome! Let's see how it goes, and I'll merge if things look good. Thanks for all the effort here! Always good to spread libraries into alternate build mechanisms.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for your words of encouragement.
I think meson is a good thing for D libraries as the build system can to be used for linux distro packaging. Moreover it can generate pkg-config file and dub file. It can query dub repository and many others things :-)

Copy link

Choose a reason for hiding this comment

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

Good stuff!

@schveiguy
Copy link
Owner

I think the meson test is failing because it's running the test application in the build directory, not in the root directory. Is there a way to fix it?

@bioinfornatics
Copy link
Contributor Author

I think the meson test is failing because it's running the test application in the build directory, not in the root directory. Is there a way to fix it?

Thanks @schveiguy I will take a look

@schveiguy
Copy link
Owner

OK, I don't know how long it will be for LDC/DMD to get these bugs fixed. If you want to change the meson with ldc to not required, that's probably good enough for now, we can squash-merge.

@schveiguy
Copy link
Owner

@bioinfornatics I think we fixed the issue for LDC in #30. Can you add back in the ldc test with 1.18.0? I want to see if it works.

@bioinfornatics
Copy link
Contributor Author

Good job that works 😉

@schveiguy
Copy link
Owner

Alright excellent! I think when ldc 1.19.0 comes out, we may have to revisit, but it's green right now. Thanks @kinke and @bioinfornatics.

@schveiguy schveiguy merged commit 6b2974d into schveiguy:master Nov 7, 2019
@bioinfornatics bioinfornatics deleted the meson_build_tool branch November 8, 2019 07:32
@bioinfornatics bioinfornatics mentioned this pull request Nov 8, 2019
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.

None yet

3 participants