Skip to content

Commit

Permalink
ShellScriptlets: Require CMAKE_BUILD_TYPE or meson --buildtype argume…
Browse files Browse the repository at this point in the history
…nts.

Otherwise we get a debug, non-optimized build, which is almost certainly
not what we want to build recipies with.
  • Loading branch information
waddlesplash committed Sep 29, 2021
1 parent 48afa21 commit cf89615
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions HaikuPorter/ShellScriptlets.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,28 @@ def getShellVariableSetters(shellVariables):
$configure $dirArgs $buildSpec $@
}
# helper function to validate CMake invocations (and use the correct one)
cmake()
{
if [[ "$*" != *CMAKE_BUILD_TYPE* ]]; then
echo "error: invoking cmake without CMAKE_BUILD_TYPE specified"

This comment has been minimized.

Copy link
@tqh

tqh Oct 9, 2021

I ran into this, and I wish the error message was as descriptive as the commit message. So maybe clarify?

This comment has been minimized.

Copy link
@korli

korli Oct 16, 2021

Contributor

the check is also wrong when using --build or --install, see https://cmake.org/cmake/help/latest/manual/cmake.1.html

This comment has been minimized.

Copy link
@waddlesplash

waddlesplash Oct 16, 2021

Author Member

Indeed, I guess so. Will fix early next week.

This comment has been minimized.

Copy link
@korli

korli Oct 20, 2021

Contributor
exit 1
fi
$portPackageLinksDir/cmd~cmake/bin/cmake $*

This comment has been minimized.

Copy link
@tqh

tqh Oct 9, 2021

This doesn't seem to work when cross-compiling.

This comment has been minimized.

Copy link
@tqh

tqh Oct 9, 2021

haiku/arm64/objects/haiku/arm64/packaging/repositories/HaikuPortsCross-build/sys-libs/zlib_bootstrap/work-1.2.11/wrapper-script: line 291: /packages/zlib_bootstrap-1.2.11-1/cmd~cmake/bin/cmake: No such file or directory

}
# helper function to validate Meson invocations (and use the correct one)
meson()
{
if [[ "$*" != *buildtype* ]]; then
echo "error: invoking meson without --buildtype argument"
exit 1
fi
$portPackageLinksDir/cmd~meson/bin/meson $*
}
fixDevelopLibDirReferences()
{
# Usage: fixDevelopLibDirReferences <file> ...
Expand Down

3 comments on commit cf89615

@waddlesplash
Copy link
Member Author

Choose a reason for hiding this comment

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

@tqh, @korli: all comments should be fixed in cd9ed95

@korli
Copy link
Contributor

@korli korli commented on cf89615 Oct 20, 2021

Choose a reason for hiding this comment

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

Seems OK indeed.

@tqh
Copy link

@tqh tqh commented on cf89615 Oct 21, 2021

Choose a reason for hiding this comment

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

I think it behaves as intended, but can't really check until I fix all packages:
error: invoking cmake without CMAKE_BUILD_TYPE specified! note: you probably want -DCMAKE_BUILD_TYPE=Release or -DCMAKE_BUILD_TYPE=RelWithDebInfo Command '['bash', '-c', '. /home/frho/haiku-clean/haiku/arm64/objects/haiku/arm64/packaging/repositories/HaikuPortsCross-build/dev-libs/libsolv_bootstrap/work-0.3.0_haiku_2014_12_22/wrapper-script']' returned non-zero exit status 1.

Please sign in to comment.