Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.devtools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.devtools
Commits
8d1ed789
Commit
8d1ed789
authored
5 years ago
by
Tiago de Freitas Pereira
Browse files
Options
Downloads
Patches
Plain Diff
Consolidating the hacks implemented to solve conda-build issues
parent
c493826d
No related branches found
No related tags found
1 merge request
!115
Consolidating the hacks implemented to solve conda-build issues
Pipeline
#34362
passed
5 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/devtools/bootstrap.py
+40
-22
40 additions, 22 deletions
bob/devtools/bootstrap.py
bob/devtools/scripts/build.py
+4
-22
4 additions, 22 deletions
bob/devtools/scripts/build.py
with
44 additions
and
44 deletions
bob/devtools/bootstrap.py
+
40
−
22
View file @
8d1ed789
...
@@ -45,6 +45,43 @@ import logging
...
@@ -45,6 +45,43 @@ import logging
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
def
do_hack
(
project_dir
):
"""
This function is supposed to be for temporary usage.
It implements hacks for the issues: https://gitlab.idiap.ch/bob/bob.devtools/merge_requests/112
and https://github.com/conda/conda-build/issues/3767)
"""
#### HACK to avoid ripgrep ignoring bin/ directories in our checkouts
import
shutil
git_ignore_file
=
os
.
path
.
join
(
project_dir
,
'
.gitignore
'
)
if
os
.
path
.
exists
(
git_ignore_file
):
logger
.
warn
(
'
Removing
"
.gitignore
"
to overcome issues with ripgrep
'
)
logger
.
warn
(
'
See https://gitlab.idiap.ch/bob/bob.devtools/merge_requests/112
'
)
os
.
unlink
(
git_ignore_file
)
#### END OF HACK
#### HACK that avoids this issue: https://github.com/conda/conda-build/issues/3767
license_file
=
os
.
path
.
join
(
project_dir
,
'
LICENSE
'
)
recipe_dir
=
os
.
path
.
join
(
project_dir
,
'
conda
'
)
if
os
.
path
.
exists
(
license_file
)
and
os
.
path
.
exists
(
recipe_dir
):
logger
.
warn
(
'
Copying LICENSE file to `./conda` dir to avoid issue with conda build (https://github.com/conda/conda-build/issues/3767)
'
)
logger
.
warn
(
'
Replacing ../LICENSE to LICENSE (https://github.com/conda/conda-build/issues/3767)
'
)
shutil
.
copyfile
(
license_file
,
os
.
path
.
join
(
recipe_dir
,
"
LICENSE
"
))
# Checking COPYING file just in case
copying_file
=
os
.
path
.
join
(
project_dir
,
'
COPYING
'
)
if
(
os
.
path
.
exists
(
copying_file
)):
shutil
.
copyfile
(
copying_file
,
os
.
path
.
join
(
recipe_dir
,
"
COPYING
"
))
meta_file
=
os
.
path
.
join
(
recipe_dir
,
"
meta.yaml
"
)
recipe
=
open
(
meta_file
).
readlines
()
recipe
=
[
l
.
replace
(
"
../COPYING
"
,
"
COPYING
"
).
replace
(
"
../LICENSE
"
,
"
LICENSE
"
)
for
l
in
recipe
]
open
(
meta_file
,
"
wt
"
).
write
(
''
.
join
(
recipe
))
#### END OF HACK
def
set_environment
(
name
,
value
,
env
=
os
.
environ
):
def
set_environment
(
name
,
value
,
env
=
os
.
environ
):
"""
Function to setup the environment variable and print debug message.
"""
Function to setup the environment variable and print debug message.
...
@@ -431,28 +468,9 @@ if __name__ == "__main__":
...
@@ -431,28 +468,9 @@ if __name__ == "__main__":
setup_logger
(
logger
,
args
.
verbose
)
setup_logger
(
logger
,
args
.
verbose
)
#### HACK to avoid ripgrep ignoring bin/ directories in our checkouts
# Run conda-build hacks
if
os
.
path
.
exists
(
'
.gitignore
'
):
# TODO: Remove this hack as soon as possible
logger
.
warn
(
'
Removing
"
.gitignore
"
to overcome issues with ripgrep
'
)
do_hack
(
"
.
"
)
logger
.
warn
(
'
See https://gitlab.idiap.ch/bob/bob.devtools/merge_requests/112
'
)
os
.
unlink
(
'
.gitignore
'
)
#### END OF HACK
#### HACK that avoids this issue: https://github.com/conda/conda-build/issues/3767
if
os
.
path
.
exists
(
'
LICENSE
'
)
and
os
.
path
.
exists
(
'
conda
'
):
logger
.
warn
(
'
Creating symlink in `./conda` to avoid issue with conda build (https://github.com/conda/conda-build/issues/3767)
'
)
logger
.
warn
(
'
Replacing ../LICENSE to LICENSE (https://github.com/conda/conda-build/issues/3767)
'
)
pwd
=
os
.
path
.
abspath
(
os
.
curdir
)
os
.
symlink
(
f
"
{
pwd
}
/LICENSE
"
,
f
"
{
pwd
}
/conda/LICENSE
"
)
if
(
os
.
path
.
exists
(
'
COPYING
'
)):
os
.
symlink
(
f
"
{
pwd
}
/COPYING
"
,
f
"
{
pwd
}
/conda/COPYING
"
)
recipe
=
open
(
"
./conda/meta.yaml
"
).
readlines
()
recipe
=
[
l
.
replace
(
"
../COPYING
"
,
"
COPYING
"
).
replace
(
"
../LICENSE
"
,
"
LICENSE
"
)
for
l
in
recipe
]
open
(
"
./conda/meta.yaml
"
,
"
wt
"
).
write
(
''
.
join
(
recipe
))
#### END OF HACK
condarc
=
os
.
path
.
join
(
args
.
conda_root
,
"
condarc
"
)
condarc
=
os
.
path
.
join
(
args
.
conda_root
,
"
condarc
"
)
...
...
This diff is collapsed.
Click to expand it.
bob/devtools/scripts/build.py
+
4
−
22
View file @
8d1ed789
...
@@ -178,29 +178,11 @@ def build(
...
@@ -178,29 +178,11 @@ def build(
)
)
#### HACK to avoid ripgrep ignoring bin/ directories in our checkouts
#### HACK to avoid ripgrep ignoring bin/ directories in our checkouts
# TODO: Remove this hack as soon as possible
from
bob.devtools.bootstrap
import
do_hack
project_dir
=
os
.
path
.
dirname
(
recipe_dir
[
0
])
project_dir
=
os
.
path
.
dirname
(
recipe_dir
[
0
])
import
shutil
do_hack
(
project_dir
)
if
os
.
path
.
exists
(
os
.
path
.
join
(
project_dir
,
'
.gitignore
'
)):
logger
.
warn
(
'
Removing
"
.gitignore
"
to overcome issues with ripgrep
'
)
logger
.
warn
(
'
See https://gitlab.idiap.ch/bob/bob.devtools/merge_requests/112
'
)
os
.
unlink
(
os
.
path
.
join
(
project_dir
,
'
.gitignore
'
))
#### END OF HACK
#### HACK that avoids this issue: https://github.com/conda/conda-build/issues/3767
if
os
.
path
.
exists
(
os
.
path
.
join
(
project_dir
,
'
LICENSE
'
))
and
os
.
path
.
exists
(
recipe_dir
[
0
]):
logger
.
warn
(
'
Creating symlink in `./conda` to avoid issue with conda build (https://github.com/conda/conda-build/issues/3767)
'
)
logger
.
warn
(
'
Replacing ../LICENSE to LICENSE (https://github.com/conda/conda-build/issues/3767)
'
)
pwd
=
project_dir
# WE NEED TO COPY. FOR SOME REASON SYMLINK DOESN'T WORK IN THIS CASE
shutil
.
copyfile
(
f
"
{
pwd
}
/LICENSE
"
,
f
"
{
pwd
}
/conda/LICENSE
"
)
if
(
os
.
path
.
exists
(
os
.
path
.
join
(
project_dir
,
'
COPYING
'
))):
shutil
.
copyfile
(
f
"
{
pwd
}
/COPYING
"
,
f
"
{
pwd
}
/conda/COPYING
"
)
recipe
=
open
(
os
.
path
.
join
(
recipe_dir
[
0
],
"
meta.yaml
"
)).
readlines
()
recipe
=
[
l
.
replace
(
"
../COPYING
"
,
"
COPYING
"
).
replace
(
"
../LICENSE
"
,
"
LICENSE
"
)
for
l
in
recipe
]
open
(
os
.
path
.
join
(
recipe_dir
[
0
],
"
meta.yaml
"
),
"
wt
"
).
write
(
''
.
join
(
recipe
))
#### END OF HACK
# get potential channel upload and other auxiliary channels
# get potential channel upload and other auxiliary channels
channels
=
get_channels
(
channels
=
get_channels
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment