Skip to content
This repository has been archived by the owner on Aug 9, 2023. It is now read-only.

rectx build causes crash if source and build directory are not set #62

Closed
hrszpuk opened this issue Jan 30, 2023 · 8 comments
Closed

rectx build causes crash if source and build directory are not set #62

hrszpuk opened this issue Jan 30, 2023 · 8 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed IMPORTANT For updates/bug fixes that need to done as soon as possible. Stale issue
Milestone

Comments

@hrszpuk
Copy link
Owner

hrszpuk commented Jan 30, 2023

Describe the issue
So, rectx build was updated to read data from the project.rectx config file instead of just assuming where the executable is. However, this causes issues if the build/source/main/executable fields in the config are not set. If the fields are not set, then build/run does not know where anything is and just decides to crash.

To Reproduce (only necessary for code)
Steps to reproduce the behavior described above:

  1. Step 1
  2. Step 2
  3. Step 3
  4. Outcome

Expected behavior
Project config needs to be filled automatically or build needs to search for the correct folders.

Screenshots
image

@hrszpuk hrszpuk added bug Something isn't working help wanted Extra attention is needed labels Jan 30, 2023
@hrszpuk hrszpuk self-assigned this Jan 30, 2023
@hrszpuk hrszpuk added this to the 2.0.0 milestone Jan 30, 2023
@hrszpuk
Copy link
Owner Author

hrszpuk commented Jan 30, 2023

Solution

There are a couple of fixes that need to be done.

  1. Instead of crashing, if the fields are not filled rectx should notify the user that they need to be filled.
  2. Template syntax need to be updated so you can "label" a directory/file so during generation rectx automatically adds the "labelled" folders/files into the appropriate config fields. It may be a good idea to implement a field keyword that lets the template to define the values in the config pre-generation. This would also make the templates more powerful.
  3. rectx build/run searches/assumes where stuff is. This isn't a great idea on it's own because if it doesn't know where things are then it could easily assume the wrong things and error. However, if the project.rectx config provides the template name, rectx could look up the template name and (given that solution 2 is implemented) we can find the build/source/main/etc that way.

@Khhs167
Copy link

Khhs167 commented Feb 9, 2023

I don't really know how rectx works, but couldn't you possibly default to making a "build" or "bin" directory when building, and just include all files in the project directory and sub directories. Perhaps ignore the "build"/"bin" dir when scanning for .rct files?

Once again, I'm not the expert

@hrszpuk
Copy link
Owner Author

hrszpuk commented Feb 9, 2023

Thanks for the suggestion @Khhs167 😄.

Rectx generates project files, but it doesn't restrict the user to a specific project layout/structure. To do this, rectx uses a template which specifies how the project should be generated and a project config to specify where everything is. However, currently, the template does not specify where to find all of the ".rct" files or where to build the executable, so the project config does not specify where anything is. Since rectx build uses the project config to find the appropriate directories it causes a crash because the values in the config are not specified.

Unfortunately, I cannot generate a default folder for the executable because rectx doesn't even know where the source folder is! I would like to avoid generating default folders/files for the most part as the information exists for rectx to use just not available where it was expecting it to be available.

@hrszpuk
Copy link
Owner Author

hrszpuk commented Feb 9, 2023

Ultimately, this bug is due to shortsightedness in template syntax. I should be able to get it patched in no time 😎.

@github-actions
Copy link

Due to a lack of activity, this issue has been deemed stale. If this level of activity continues for a further 5 days this issues will be closed.

@github-actions
Copy link

github-actions bot commented Mar 1, 2023

This issue has been closed due to a lack of activity!

@github-actions github-actions bot closed this as completed Mar 1, 2023
@hrszpuk hrszpuk reopened this Mar 2, 2023
@github-actions
Copy link

Due to a lack of activity, this issue has been deemed stale. If this level of activity continues for a further 5 days this issues will be closed.

@github-actions
Copy link

This issue has been closed due to a lack of activity!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working help wanted Extra attention is needed IMPORTANT For updates/bug fixes that need to done as soon as possible. Stale issue
Projects
No open projects
Status: Done
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants