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

dont use global include dir #89

Open
wants to merge 55 commits into
base: master
Choose a base branch
from
Open

Conversation

maddanio
Copy link
Contributor

@maddanio maddanio commented Jan 8, 2021

its not neccessary and makes it harder to isolate components

@pfultz2
Copy link
Owner

pfultz2 commented Jan 8, 2021

This is set so when installing header only libraries with -X header, the headers will be available. I guess build scripts should do find_path. What issues are you seeing with isolation? All components are symlinked into the same directory, so I am not sure what kind of isolation you want to achieve.

@maddanio
Copy link
Contributor Author

I am just generally concerned with determinism, i.e. that the build of one package is not influenced by the presence of another, especcially for build caching. and also that when in cmake I use one package i dont get to see another "for free" so I can guarnatuee that only the specified dependencies are visible. header only should also be discoverable from the package dir, no?

@maddanio
Copy link
Contributor Author

hmm, I cant find this header thing. -X is for specifying a cmake file, right? Ah, header.cmake :). Hmm, couldnt that produce a findable package?

@maddanio
Copy link
Contributor Author

ok, I looked at header.cmake and tried to make it generate a config file, but I think its a bit too complex, also I dont really need it right now, so I will leave it alone. still i would like to avoid having all headers visible all the time, so I think I will just make this switchable

@maddanio
Copy link
Contributor Author

ok, added --no-global-include to init fo this to be optional, ok?

@@ -56,7 +56,8 @@ def w(obj, prefix, verbose, build_path, *args, **kwargs):
@click.option('-D', '--define', multiple=True, help="Extra configuration variables to pass to CMake")
@click.option('--shared', is_flag=True, help="Set toolchain to build shared libraries by default")
@click.option('--static', is_flag=True, help="Set toolchain to build static libraries by default")
def init_command(prefix, toolchain, cc, cxx, cflags, cxxflags, ldflags, std, define, shared, static):
@click.option('--no-global-include', is_flag=True, help="Don't use global include dir (required for -X header)")
Copy link
Owner

Choose a reason for hiding this comment

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

How about naming this --disable-global-include?

@pfultz2
Copy link
Owner

pfultz2 commented Jan 21, 2021

Also, are you able to add a test for this? I think a simple test like this just to get coverage could be added in test/test_cget.py:

def test_disable_global_include_toolchain(d):
    d.cmds([
        cget_cmd('init', '--disable-global-include'),
        cget_cmd('install', '--verbose --test', get_exists_path('libsimple'))
    ])

@ghost
Copy link

ghost commented Jan 26, 2021

DeepCode's analysis on #9a5780 found:

  • ⚠️ 1 warning, ℹ️ 3 minor issues. 👇
  • ✔️ 7 issues were fixed.

Top issues

Description Example fixes
hashlib.sha1 is insecure. Consider changing it to a secure hashing algorithm (e.g. SHA256). Occurrences: 🔧 Example fixes
standard import "import base64, copy, argparse, six, dirhash, hashlib" should be placed before "import base64, copy, argparse, six, dirhash, hashlib" Occurrences: 🔧 Example fixes
Imports from package base64 are not grouped Occurrences: 🔧 Example fixes

👉 View analysis in DeepCode’s Dashboard | Configure the bot

@@ -87,8 +90,10 @@ def init_command(prefix, toolchain, cc, cxx, cflags, cxxflags, ldflags, std, def
@click.option('--debug', is_flag=True, help="Install debug version")
@click.option('--release', is_flag=True, help="Install release version")
@click.option('--insecure', is_flag=True, help="Don't use https urls")
@click.option('--use-build-cache', is_flag=True, help="Cache builds")
Copy link
Owner

Choose a reason for hiding this comment

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

This shouldn't have the build cache changes.

# TODO: Set also PKG_CONFIG_SYSROOT_DIR
if(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE STREQUAL "ONLY")
list(APPEND ${PREFIX}_BASE_ENV_COMMAND "PKG_CONFIG_LIBDIR=${${PREFIX}_PKG_CONFIG_PATH}")
endif()
Copy link
Owner

Choose a reason for hiding this comment

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

This shouldn't skip setting pkg config paths. Either way, I would prefer these changes in a seperate PR.

COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/autogen.sh
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
endif (AUTOTOOLS_RUN_AUTOGEN_SH)
Copy link
Owner

Choose a reason for hiding this comment

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

This should be put in a seperate PR.

set_ = cmake_set
if_ = cmake_if
else_ = cmake_else
append_ = cmake_append
yield set_('CGET_PREFIX', self.prefix)
yield set_('CMAKE_PREFIX_PATH', self.prefix)
Copy link
Owner

Choose a reason for hiding this comment

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

Extending the CMAKE_PREFIX_PATH should not be removed.

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.

None yet

2 participants