fix: Ensure parser directory is created correctly, not as a file - #4
Open
tomoya0318 wants to merge 1 commit into
Open
fix: Ensure parser directory is created correctly, not as a file#4tomoya0318 wants to merge 1 commit into
parser directory is created correctly, not as a file#4tomoya0318 wants to merge 1 commit into
Conversation
The tokenizer generation script failed when the build directory did not exist. - In step 2, added logic to create the `parser` directory inside `/MSCCD/modules/msccd_tokenizer/src/main/java/org/nagoya_u/ertl/sa/` before copying resources. This prevents build failures caused by the missing directory. - Removed unnecessary trailing whitespace for better code style and readability.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Overview
This PR fixes a critical build failure where the build script incorrectly created the
parserbuild directory as a file instead of a directory.This change ensures the directory is proactively created correctly, making the build process robust. It also includes minor code style improvements by removing unnecessary whitespace.
Background/Problem
The core issue was not simply that the
parserdirectory was missing, but that the build script incorrectly created it as a file.Here's the sequence of events that caused the failure:
cpcommand within thecpResources.shscript was executed with a non-existent destination path (MSCCD/modules/msccd_tokenizer/src/main/java/org/nagoya_u/ertl/sa/parser).cpcommand's default behavior created a file named parser containing the contents of the first source file.target is not a directoryerror.Changes
To resolve this, the following changes were made:
tokenizerGeneration.py, added a call toos.makedirs()right before the resource copy script is executed. This proactively createsparseras a directory, ensuring that thecpcommand correctly copies files into it, rather than creating an incorrect file.How to Test
I have confirmed that this change fixes the issue by following these steps:
parserdirectory to simulate the failure condition.Related Issues