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

Fix build for bluespec-compiler #293

Closed
wants to merge 2 commits into from
Closed

Fix build for bluespec-compiler #293

wants to merge 2 commits into from

Conversation

tmarkettos
Copy link
Contributor

Upstream bsc have a new GNUmakefile which is substantially different from
the kind that cheribuild expects. Adjust our build rules to suit.

Currently we don't build the documentation since that implies lots of Latex
dependencies, that aren't strictly necessary to use the bsc compiler

Fixes #291

Upstream bsc have a new GNUmakefile which is substantially different from
the kind that cheribuild expects.  Adjust our build rules to suit.

Currently we don't build the documentation since that implies lots of Latex
dependencies, that aren't strictly necessary to use the bsc compiler
self.make_args.set(PREFIX=self.install_dir)

def clean(self, **kwargs):
Copy link
Member

Choose a reason for hiding this comment

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

It looks like latest version support out-of-source builds, if we can use that instead we can avoid changing clean().

Copy link
Contributor Author

@tmarkettos tmarkettos Jul 1, 2022

Choose a reason for hiding this comment

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

There's no 'make clean' target in the upstream source - can we make sure that an out-of-source build won't try to call it?

Edit: correction, there is. Let me see why that wasn't working...

@@ -45,11 +45,20 @@ def __init__(self, config: CheriConfig):
self.add_required_system_tool("cabal", apt="cabal-install", homebrew="cabal-install")
for i in ("autoconf", "gperf", "bison", "flex"):
self.add_required_system_tool(i, homebrew=i)
self.add_required_system_header("tcl/tcl.h", apt="tcl-dev")
self.make_args.set(PREFIX=self.install_dir)
Copy link
Member

Choose a reason for hiding this comment

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

If you remove build_in_source_dir = True, the following might be sufficient:

Suggested change
self.make_args.set(PREFIX=self.install_dir)
self.make_args.set(PREFIX=self.install_dir, BUILDDIR=self.build_dir)

Copy link
Contributor Author

@tmarkettos tmarkettos Jul 1, 2022

Choose a reason for hiding this comment

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

It turns out their out-of-tree build is broken. bsc/src/Libraries sets its own BUILDDIR, to be [sourcetree]/build/bsvlib, which is overriden by ours, and then Libraries' wildcarded calls to the 'install' command fail because they're trying to install directories (from the wrong place). I think that's fixable upstream but somewhat messy, so perhaps in-tree is good enough for now? In which case we need to prevent cheribuild calling 'make distclean'

Copy link
Member

Choose a reason for hiding this comment

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

Maybe I should just remove the distclean workaround and always use git clean for in-source clean. For now using this seems fine.

Copy link
Member

Choose a reason for hiding this comment

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

I wonder if it works if you set BUILDIR in the environment instead of on the make command line?

@arichardson
Copy link
Member

Is this still needed?

@tmarkettos
Copy link
Contributor Author

The current version with recent changes is working for me, so closing this PR.

@tmarkettos tmarkettos closed this Aug 8, 2024
@tmarkettos tmarkettos deleted the atm26-bsc branch August 8, 2024 11:21
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.

bluespec-compiler fails to build on Linux host
2 participants