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

Replace mainSourceFile with excludedSourceFile in unittest build #229

Closed
wants to merge 1 commit into from

Conversation

Geod24
Copy link

@Geod24 Geod24 commented May 22, 2021

The directive wasn't using mainSourceFile,
because the configuration was only for testing.

@schveiguy
Copy link
Collaborator

The test system in mysql-native is kind of weird (I have to figure out why it's used here). I don't think the change is as simple as this. But you have it backwards -- the dub changes are preventing people from using this project, not the other way around. If someone depends on a specific revision of mysql-native, they shouldn't have to upgrade because the build system all of a sudden decided things don't mean what they used to mean. This is not the only project broken by the dub changes.

@Geod24
Copy link
Author

Geod24 commented May 22, 2021

I don't think the change is as simple as this.

I would need more details on this. Knowing the feature and what it does, I see no reason why it'd be more complicated.

But you have it backwards -- the dub changes are preventing people from using this project, not the other way around.

Those releases versions are released, we can't change that. What we can do is make future versions of mysql-native compatible with all dub version by removing one line.

@schveiguy
Copy link
Collaborator

Likewise, historical versions of mysql-native are released, we can't change that. Why should someone depending on an older version of mysql-native have to upgrade (and validate their project) simply because the build system decided things didn't mean what they used to mean?

I don't disagree that it shouldn't be using this directive for future versions, I want to revisit the whole testing system in general (it's run with shell scripts and compiled test harnesses, whereas I think most of it should be with unittests). But this ignores the fact that the build system has already been fundamentally altered and I don't want to release new versions of old branches (i.e. a new 2.x release) just to workaround dub bugs.

@Geod24
Copy link
Author

Geod24 commented May 22, 2021

I don't disagree that it shouldn't be using this directive for future versions

So let's merge this, shall we, unblock users, and continue the discussion about dub in the dub PR ?

@schveiguy
Copy link
Collaborator

I need to verify the CI still works (it's not running, and I don't know why at the moment).

@schveiguy
Copy link
Collaborator

Can you force push? I think I had a setting wrong on travis.

@schveiguy schveiguy closed this May 22, 2021
@schveiguy schveiguy reopened this May 22, 2021
@schveiguy
Copy link
Collaborator

OK that seems to have done it.

@schveiguy
Copy link
Collaborator

So CI is failing due to the extra "main" declared in

void main() {}

I have to spend some time digging through the CI to figure out what it is trying to do with that. It seems oddly out of place, and more of a kludge than solution.

@schveiguy
Copy link
Collaborator

I'm going to have to address CI soon. This one build on Travis consumed all the credits, so this will take some time. I think next step is to set up github actions to avoid this situation. See #227

@Geod24
Copy link
Author

Geod24 commented May 22, 2021

Okay so I compiled with verbose output. Without any change (using mainSourceFile), configuration unittest-vibe outputs:

dmd -c -of.dub/build/mysql-native-test-unittest-vibe-unittest-posix.osx.darwin-x86_64-dmd_v2.096.1-E3DA5E7543076FDAF986A9BACAB23BA6/mysql-native-test-unittest-vibe.o -debug -g -unittest -w -version=Have_mysql_native -version=Have_vibe_core -version=Have_eventcore -version=Have_stdx_allocator -version=EventcoreKqueueDriver -version=Have_taggedalgebraic -debug=MYSQLN_TESTS -Isource/ -I../../.dub/packages/vibe-core-1.7.0/vibe-core/source/ -I../../.dub/packages/eventcore-0.8.48/eventcore/source/ -I../../.dub/packages/taggedalgebraic-0.11.6/taggedalgebraic/source/ -I../../.dub/packages/stdx-allocator-2.77.5/stdx-allocator/source/
.dub/code/mysql-native-test-unittest-vibe-unittest-posix.osx.darwin-x86_64-dmd_v2.096.1-25A439DC1BA9D7C14B9E3D73F82E2418_dub_test_root.d source/mysql/commands.d source/mysql/connection.d source/mysql/escape.d source/mysql/exceptions.d source/mysql/metadata.d source/mysql/pool.d source/mysql/prepared.d source/mysql/protocol/comms.d source/mysql/protocol/constants.d source/mysql/protocol/extra_types.d source/mysql/protocol/packet_helpers.d source/mysql/protocol/packets.d source/mysql/protocol/sockets.d source/mysql/result.d source/mysql/test/common.d source/mysql/test/integration.d source/mysql/test/regression.d source/mysql/types.d ../../.dub/packages/vibe-core-1.7.0/vibe-core/source/vibe/appmain.d -vcolumns

With the line removed:

dmd -c -of.dub/build/mysql-native-test-unittest-vibe-unittest-posix.osx.darwin-x86_64-dmd_v2.096.1-E3DA5E7543076FDAF986A9BACAB23BA6/mysql-native-test-unittest-vibe.o -debug -g -unittest -w -version=Have_mysql_native -version=Have_vibe_core -version=Have_eventcore -version=Have_stdx_allocator -version=EventcoreKqueueDriver -version=Have_taggedalgebraic -debug=MYSQLN_TESTS -Isource/ -I../../.dub/packages/vibe-core-1.7.0/vibe-core/source/ -I../../.dub/packages/eventcore-0.8.48/eventcore/source/ -I../../.dub/packages/taggedalgebraic-0.11.6/taggedalgebraic/source/ -I../../.dub/packages/stdx-allocator-2.77.5/stdx-allocator/source/
.dub/code/mysql-native-test-unittest-vibe-unittest-posix.osx.darwin-x86_64-dmd_v2.096.1-25A439DC1BA9D7C14B9E3D73F82E2418_dub_test_root.d source/mysql/commands.d source/mysql/connection.d source/mysql/escape.d source/mysql/exceptions.d source/mysql/metadata.d source/mysql/package.d source/mysql/pool.d source/mysql/prepared.d source/mysql/protocol/comms.d source/mysql/protocol/constants.d source/mysql/protocol/extra_types.d source/mysql/protocol/packet_helpers.d source/mysql/protocol/packets.d source/mysql/protocol/sockets.d source/mysql/result.d source/mysql/test/common.d source/mysql/test/integration.d source/mysql/test/regression.d source/mysql/types.d ../../.dub/packages/vibe-core-1.7.0/vibe-core/source/vibe/appmain.d -vcolumns

With the latest change (excludedSourceFiles):

dmd -c -of.dub/build/mysql-native-test-unittest-vibe-unittest-posix.osx.darwin-x86_64-dmd_v2.096.1-E3DA5E7543076FDAF986A9BACAB23BA6/mysql-native-test-unittest-vibe.o -debug -g -unittest -w -version=Have_mysql_native -version=Have_vibe_core -version=Have_eventcore -version=Have_stdx_allocator -version=EventcoreKqueueDriver -version=Have_taggedalgebraic -debug=MYSQLN_TESTS -Isource/ -I../../.dub/packages/vibe-core-1.7.0/vibe-core/source/ -I../../.dub/packages/eventcore-0.8.48/eventcore/source/ -I../../.dub/packages/taggedalgebraic-0.11.6/taggedalgebraic/source/ -I../../.dub/packages/stdx-allocator-2.77.5/stdx-allocator/source/
.dub/code/mysql-native-test-unittest-vibe-unittest-posix.osx.darwin-x86_64-dmd_v2.096.1-25A439DC1BA9D7C14B9E3D73F82E2418_dub_test_root.d source/mysql/commands.d source/mysql/connection.d source/mysql/escape.d source/mysql/exceptions.d source/mysql/metadata.d source/mysql/pool.d source/mysql/prepared.d source/mysql/protocol/comms.d source/mysql/protocol/constants.d source/mysql/protocol/extra_types.d source/mysql/protocol/packet_helpers.d source/mysql/protocol/packets.d source/mysql/protocol/sockets.d source/mysql/result.d source/mysql/test/common.d source/mysql/test/integration.d source/mysql/test/regression.d source/mysql/types.d ../../.dub/packages/vibe-core-1.7.0/vibe-core/source/vibe/appmain.d -vcolumns

(I added a newline to separate the list of files, for readability).
So currently, package.d is actually not compiled in, because mainSourceFile is excluded from dub test.
The thing is, there is some overlap between what dub test does and what the unittest configuration does.

Note that I also noticed that all configurations but one use excludedSourceFile "source/app.d". And that's exactly this kind of use case for which the mainSourceFile behavior was fixed.

@Geod24
Copy link
Author

Geod24 commented May 22, 2021

I'm going to have to address CI soon. This one build on Travis consumed all the credits, so this will take some time.

Yeah Travis really killed their open source offering with the credit approach.

See #227

Thanks for the pointer, I gave a review to the PR 🤷

@Geod24 Geod24 changed the title Remove 'mainSourceFile' from unittest build Replace mainSourceFile with excludedSourceFile in unittest build May 22, 2021
The directive wasn't using `mainSourceFile`,
because the configuration was only for testing.
@Geod24
Copy link
Author

Geod24 commented May 25, 2021

Fixed, although the configuration is not used anymore.

@schveiguy
Copy link
Collaborator

Going to close, as I think this is no longer relevant. In #235 I'm planning on removing the source/app.d file completely, as it really is its own thing not related to the library.

@schveiguy schveiguy closed this May 25, 2021
@Geod24
Copy link
Author

Geod24 commented May 25, 2021

I'm not sure I follow ? The unittest-vibe is currently broken, but you don't see it in the CI because it's not used anymore (AFAICS). This unbreaks it. Removing source/app.d sounds like a good idea on its own, but I suppose for the present PR to be irrelevant you'd have to remove unittest-vibe, wouldn't you ?

@schveiguy
Copy link
Collaborator

See the referenced PR. in particular the dub.sdl. I'm making things simple.

@schveiguy
Copy link
Collaborator

BTW, the unittest-vibe and the unittest-vibe-ut were redundant. Just one used unit-threaded and the other didn't. I'm not sure why they were both in there.

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.

2 participants