-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
Don't maintain a generated Languages.pm file #176
Open
ehuelsmann
wants to merge
4
commits into
main
Choose a base branch
from
generated-perl-languages
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
9fd1084
Don't maintain a generated Languages.pm file
ehuelsmann 63a22b5
Use 'dzil build' to build a complete Gherkin-{VERSION} lib directory
ehuelsmann 48d8e26
Use the generated languages file in the source tree
ehuelsmann 730a3e1
Make 'dzil' discoverable
ehuelsmann File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ perl5/ | |
.cpanfile_dependencies | ||
cpanfile.snapshot | ||
CHANGELOG.md | ||
lib/Gherkin/Generated/Languages.pm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this in place, I would expect the code from the Makefile that does the generation is no longer needed. And with it some other changes can be removed too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently the Makefile targets are still used for the GitHub Actions CI runs. Those runs are specialized because they depend on the conformance data, which isn't packaged in the release tarball. I need to check again, but from what I remember
dzil
passes a cleaned environment to the test scripts, so the scripts needed a predictable directory to find the conformance data.The
dzil build
target only packages the files for release. Thedzil test
target only runs a few syntax checks. Definitely not enough to validate conformance.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the Makefile as a whole is still used.
But you've created an alternative for the generation of
lib/Gherkin/Generated/Languages.pm
. And I would generally expect a build process to have a single way of doing this. So I would not expectperl helper-scripts/build_languages.pl
to be invoked in the Makefile anymore.Perhaps
dzil build
would have to be invoked insteadcpanm
? And perhaps the acceptance tests would have to be ran with the artifact produced bydzil build
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running the tests with an environment as it would have been created by installing the artifact from
dzil build
, can be done usingdzil test
(to run the Perl test suite) ordzil run
(to run an arbitrary command).I guess what it comes down to is: should the Makefile follow the patterns all other Makefiles use (thereby deviating from "the Perl way")? Or should I use "the Perl way", thereby deviating from "the project way"?
I guess I know the answer: since Elixir doesn't do it the project way anyway, so there's precedent for doing it "the language's ecosystem way". I'll change this PR to de-duplicate accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I know what the "Perl way" is. ;)
But most languages do follow the pattern of executing the code in the artifact produced by the build system - occasionally with a shim.
For example JavaScript uses npm to build the artifact.
And then to run the tests
Where
test-cli.mjs
is a shim that uses Gherkin to run the acceptance tests.Perl seems to differ mostly in that it uses both
cpanm
(to create the artifact used by tests) anddzil
(to create the released artifact). I would prefer it if we have system for both.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! There'sa misconception there. Good to be able to clarify that.
cpanm
is actually not building the artifact (dzil build
is);cpanm
is about installing the dependencies to be able to run the tests (as well asdzil
itself). Until this PR (which removeslib/Gherkin/Generated/Languages.pm
) the tests can be run without any build steps straight out of the repository.This PR changes that, because with this PR a build step is required (generating the missing languages file) before the tests can be run. This is an extra step being introduced in this PR.
My plan now is to change the
acceptance
Makefile target: it will invokedzil test
, which will generate the missing languages file. I will also change theacceptance/*
targets to Perl code which can be run as part ofdzil test
(which assumes it can run the files in t/ as Perl test files; it doesn't invoke the project's Makefile).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part has me a little confused. The way the acceptance tests are run seems correct to me.
Then I would now expect
perl helper-scripts/build_languages.pl
to be replaced withdzil build
or something like that.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are as long as the file
lib/Gherkin/Generated/Languages.pm
exists, but this commit removes that file. Instead, I'm invokingdzil build
, which generates a release tarball, but Perl can't use that tarball to load its modules from. It also generates a directory with the content of that tarball, but that has the version number embedded (making the Makefile a more complex).To keep the makefile simple, I was going to go with the way Elixir works, but that breaks down for other reasons (the URI value).
I've taken yet another direction with this PR now, based on your comments and my findings so far.