Skip to content

Commit

Permalink
Merge pull request #383 from zapta/develop
Browse files Browse the repository at this point in the history
Fixed broken build test.
  • Loading branch information
Obijuan authored Jun 14, 2024
2 parents 5018683 + 565bcb1 commit 580d9df
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
9 changes: 5 additions & 4 deletions apio/managers/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ class Project:

def __init__(self):
# TODO(zapta): Make these __private and provide getter methods.
self.board = None
self.top_module = None
self.exe_mode = None
self.board: str = None
self.top_module: str = None
self.native_exe_mode: bool = None

def create_sconstruct(self, project_dir: Path, arch=None, sayyes=False):
"""Creates a default SConstruct file"""
Expand Down Expand Up @@ -220,7 +220,8 @@ def read(self):
self.top_module = self._parse_top_module(
config_parser, parsed_attributes
)
self.exe_mode = self._parse_exe_mode(config_parser, parsed_attributes)
exe_mode = self._parse_exe_mode(config_parser, parsed_attributes)
self.native_exe_mode = {"default": False, "native": True}[exe_mode]

# Verify that the project file (api.ini) doesn't contain additional
# (illegal) keys that where not parsed
Expand Down
11 changes: 7 additions & 4 deletions apio/managers/scons.py
Original file line number Diff line number Diff line change
Expand Up @@ -888,8 +888,12 @@ def run(self, command, variables, packages, board=None, arch=None):
# -- We are using our custom SConstruct file
click.secho("Info: use custom SConstruct file")

# -- Check the configuration mode
if self.proj.exe_mode == "default":
# -- Verify necessary packages if needed.
# TODO(zapta): Can we drop the 'native' mode for simplicity?
if self.proj.native_exe_mode:
# Assuming blindly that the binaries we need are on the path.
click.secho("Warning: native exe mode (binaries should be on path)")
else:
# Run on `default` config mode
# -- Check if the necessary packages are installed
if not util.resolve_packages(
Expand All @@ -899,8 +903,7 @@ def run(self, command, variables, packages, board=None, arch=None):
):
# Exit if a package is not installed
raise AttributeError("Package not installed")
else:
click.secho("Info: native exe mode")


# -- Execute scons
return self._execute_scons(command, variables, board)
Expand Down
3 changes: 0 additions & 3 deletions test/env_commands/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,3 @@ def test_config(clirunner, validate_cliresult, configenv):
result = clirunner.invoke(cmd_config, ['--list'])
validate_cliresult(result)

# -- Execute "apio config --exe native"
result = clirunner.invoke(cmd_config, ['--exe', 'native'])
validate_cliresult(result)

4 comments on commit 580d9df

@cavearr
Copy link
Member

Choose a reason for hiding this comment

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

Thank you very much @zapta for this fix. I'm upgrading oss cad suite to the next version of the toolchain and need to get the development branch working.

If you plan to make big changes like these, try to make sure the tox tests works before releasing the PRs.

Thanks again for your contributions.

@zapta
Copy link
Collaborator

@zapta zapta commented on 580d9df Jun 17, 2024 via email

Choose a reason for hiding this comment

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

@cavearr
Copy link
Member

Choose a reason for hiding this comment

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

When you develop something in apio, before the PR you should execute:
make lint

and

make tox

This runs some tests to ensure that everything will continue to work.

@zapta
Copy link
Collaborator

@zapta zapta commented on 580d9df Jun 18, 2024 via email

Choose a reason for hiding this comment

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

Please sign in to comment.