Dojo Custom Build Error - build

My HTML File : buildCheck.html
<SCRIPT src="/dojo/dojo.js"></SCRIPT>
<SCRIPT>
dojo.require("dijit.form.Button");
dojo.require("dijit.form.CheckBox");
dojo.require("dijit.form.ComboBox");
dojo.require("dijit.Dialog");
dojo.require("dojo.data.ItemFileReadStore");
dojo.require("my.app");
</SCRIPT>
Command :
>build.bat action=release htmlFiles=../../buildCheck1.html profile=myProfile
Error :
kwArgs.htmlFiles ../../buildCheck1.html
release: Using profile: profiles/myProfile.profile.js
release: Using version number: 0.0.0.dev for the release.
release: Deleting: ../../release/dojo
release: Copying: ../dojo/../dijit to: ../../release/dojo/dijit
release: ********** Not Copied: ../dojo/../dijit
release: Copying: ../dojo/../dojox to: ../../release/dojo/dojox
release: ********** Not Copied: ../dojo/../dojox
release: Copying: ../dojo to: ../../release/dojo/dojo
release: ********** Not Copied: ../dojo
release: Building dojo.js and layer files
js: "./../../dojo/_base/_loader/loader.js", line 423: exception from uncaught Ja
vaScript throw: Error: Could not load 'dojo.i18n'; last tried '../../release/doj
o/dojo/i18n.js'
I am geeting this error if i add the below component
dojo.require("dojo.data.ItemFileReadStore")
after removal the component build is working fine.
What can be the issue?What should i add to avoid this error?

It looks like at the point the error occurs, dojo/i18n has not yet been built. It seems weird to me, that you say it is the ItemFileReadStore - as noting in the dojo.data requires localization.
Try adding a manual dojo.require("dojo.i18n"); to your .html above any dijits reqs

I don't know how you had your files organized, but in my case, I had it like this:
- js
- dojo_require.js (the file with "dojo.require" statements, just like your "buildCheck.html")
- dojo-release-1.6.1-src (dojo files)
- dijit
- dojo
- dojox
- util
- buildscripts
- release
And I faced exactly the same problem. I figured out this happens, when the html file contains any require that loads something from the 'dojo' folder. dojo.require("dijit.<*>") is fine, dojo.require("dojox.<*>") is fine, but dojo.require("dojo.<*>") causes the build script to use an incorrect relative path to dojo. I was getting the same output as you:
release: Deleting: ../../release/dojo
release: Copying: ../dojo/../dijit to: ../../release/dojo/dijit
But I should have got something like Copying: ../../dojo/../dijit to: ../../release/dojo/dijit instead. One ../ was missing.
Now, it is probably a bug (I am lazy to investigate it further), and since 1.6 is a pretty old version of dojo, the correct fix should be to upgrade. But since at some occasions, it is just too much pain, here is a dirty hack that made it possible for my buildscript to run and finish:
In dojo-release-1.6.1-src/util/buildscripts/build.js, on the line 107, add this line:
prefixPath = '../' + prefixPath;
So that the entire block of code looks like this:
for(var i = 0; i < prefixes.length; i++){
var prefixName = prefixes[i][0];
var prefixPath = prefixes[i][1];
prefixPath = '../' + prefixPath; // HACK!
var finalPrefixPath = prefixPath;
if(finalPrefixPath.indexOf(".") == 0 && prefixName != "dojo"){
finalPrefixPath = dojoPrefixPath + "/" + prefixPath;
}
_copyToRelease(prefixName, finalPrefixPath, kwArgs, buildLayers);
if(kwArgs.symbol){
var releasePath = kwArgs.releaseDir + "/" + prefixName.replace(/\./g, "/");
buildUtil.insertSymbols(releasePath, kwArgs);
}
}

Related

conda-build fails to recognise libraries

I am trying to build a package using conda-build. This is my first time trying to build a conda package, and I am having far more problems than I expected too.
Here is my build.sh
CMAKE_PLATFORM_FLAGS+=(-DCMAKE_TOOLCHAIN_FILE="${RECIPE_DIR}/cross-linux.cmake")
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=$PREFIX ${CMAKE_PLATFORM_FLAGS[#]} .
make
cp surveyor.py random_pos_generator.py $PREFIX/bin/
cp add_filtering_info call_insertions clip_consensus_builder dc_remapper filter normalise reads_categorizer $PREFIX/bin/
And here is my meta.yaml:
{% set name = "insurveyor" %}
{% set version = "1.0.1" %}
package:
name: {{ name|lower }}
version: {{ version }}
source:
url: https://github.com/kensung-lab/INSurVeyor/archive/refs/tags/1.0.2.tar.gz
sha256: 33c85157892d3256abc96bb2a9053f05da9dcf55befeed720e965577db0b78b5
build:
skip: True # [not linux]
number: 0
requirements:
build:
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- cmake >=3.5
- autoconf ==2.69
host:
- libcurl
- bzip2
- xz
- zlib
- libdeflate
- openssl
- htslib >=1.13
run:
- python
- numpy >=1.21.2
test:
source_files:
- demo/
about:
home: https://github.com/kensung-lab/INSurVeyor
summary: 'An insertion caller for Illumina paired-end WGS data.'
description: XXX
license: GPL-3.0-only
license_file: LICENSE
extra:
recipe-maintainers:
- Mesh89
And here is the output of the process:
https://justpaste.it/3gfzf
(stack overflow would think the log is spam)
There are plenty of worrying messages, for example:
Warning: rpath /home/user/anaconda3/conda-bld/insurveyor_1670384223059/_build_env/lib is outside prefix /home/user/anaconda3/conda-bld/insurveyor_1670384223059/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_ (removing it)
Unknown format
WARNING :: Failed to get_static_lib_exports(/home/user/anaconda3/conda-bld/insurveyor_1670384223059/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/libssl.a)
Unknown format
Binary doesn't have a program header
When I try to run any executable, I get
symbol lookup error: /lib/x86_64-linux-gnu/libp11-kit.so.0: undefined symbol: ffi_type_pointer, version LIBFFI_BASE_7.0
I have spent a long time trying to figure out what is wrong and I am completely lost. When I google the warning/error messages, I cannot find any results.
I wonder if there is something fundamental that I misunderstand about the build process.
For example, why does conda complain about the rpath of the executables pointing to the build environment? Why those "Unknown format" warnings regarding the static libraries?

Adding paths to config file in most efficent way via Ansible

I wrote a task that is responsible for changing supervisor config file. The case is that on some servers we have more than one app running workers, so sometimes more than one path needs to be added to include section of supervisor.conf.
Currently I wrote this task in /roles/supervisor/tasks/main.yml/:
- name: Add apps paths in include section
lineinfile:
dest: /etc/supervisor/supervisord.conf
regex: '^files ='
line: 'files = /etc/supervisor/conf.d/*.conf /home/app/{{ app_name }}/releases/app/shared/supervisor/*.conf /home/dev/{{ app_name2 }}/releases/dev/shared/supervisor/*.conf'
when: ansible_hostname = 'ser-db-10'
notify: restart supervisor
tags: multi_workers
... and added in /roles/supervisor/defaults/main.yml/ this:
app_name: bla
app_name2: blabla
It works, but I don't like the thing that there are two application paths hardcoded in line and maybe I should also add variable in place of ser-db-10.
I am wondering how to rebuild this task to make it more independent.
What I mean is, if there are 4 apps, add 4 paths, if there are 2 apps, add 2 paths.
What is the most efficient way to do this?
As an example of how to put together the parameter line, the play below
- hosts: test_01
vars:
app_name1: A
app_name2: B
my_conf:
test_01:
lines:
- '/etc/*.conf'
- '/etc/{{ app_name1 }}/*.conf'
- '/etc/{{ app_name2 }}/*.conf'
tasks:
- debug:
msg: "files = {{ my_conf[inventory_hostname].lines|join(' ') }}"
gives
"msg": "files = /etc/*.conf /etc/A/*.conf /etc/B/*.conf"
With appropriate dictionary my_conf the task below should do the job
- name: Add apps paths in include section
lineinfile:
dest: /etc/supervisor/supervisord.conf
regex: '^files ='
line: "files = {{ my_conf[inventory_hostname].lines|join(' ') }}"
notify: restart supervisor
tags: multi_workers
(not tested)

Ansible replace seems to throw a parsing error?

I'm trying to use the Ansible replace module to change some text in a file on a Windows Server 2019 Standard target. I'm using Ansible 2.8.3 running on Python 2.7
- name: REPLACE | Replace baseline.local with FQDN in InternetSettings.xml
replace:
path: '/path/to/settings.xml'
regexp: 'baseline\.local'
replace: '{{ FQDN }}'
I don't think the issue is the path, although one of the directories on the path to the file has brackets '{}' in its name. Could that be it?
I've tried to do the same thing with win_lineinfile, and it didn't throw an error with the same path, but it'd be difficult in this case to replicate the functionality of replace, which is really what I need.
EDIT 2: It works when I copy the file over to my local machine and delegate to 127.0.0.1. I'm running ansible from a Windows Subsystem for Linux (WSL) installation. It also works when I copy the file to a remote linux system and run replace there, so it seems to be a Windows problem.?
EDIT: The stack trace of the error I'm getting:
"Exception calling "Create" with "1" argument(s): "At line:4 char:21
+ def _ansiballz_main():
+ ~
An expression was expected after '('.
At line:13 char:27
+ except (AttributeError, OSError):
+ ~
Missing argument in parameter list.
At line:15 char:7
+ if scriptdir is not None:
+ ~
Missing '(' after 'if' in if statement.
At line:22 char:7
+ if sys.version_info < (3,):
+ ~
Missing '(' after 'if' in if statement.
At line:22 char:30
+ if sys.version_info < (3,):
+ ~
Missing expression after ','.
At line:22 char:25
+ if sys.version_info < (3,):
+ ~
The '<' operator is reserved for future use.
At line:24 char:32
+
My teammates and I suspect that this issue is the result of attempting to use an ansible module not built for windows on a windows target - more particularly, a target that doesn't have python installed. We suspect that some part of the compiling of python on the ansible controller or subsequent execution of the python binary on the windows target is what's really causing the problem here. We've decided on the workaround of just using win_shell with powershell's 'replace' to do what we need to do.
Try changing your regexp string to double quotes:
regexp: "baseline.local"

gulp-less doesn't make CSS files anymore

I'm using gulp for generating CSS from LESS. It has worked perfectly, but now the script seems to ignore the LESS files.
Here is my gulpfile.js (it is definitely correct, since I have not change it in the last time):
// Include Gulp plugins
var gulp = require('gulp'),
less = require('gulp-less'),
watch = require('gulp-watch'),
prefix = require('gulp-autoprefixer'),
plumber = require('gulp-plumber'),
filter = require('gulp-filter'),
rename = require('gulp-rename'),
path = require('path')
;
// Compile LESS to CSS
gulp.task('build-less', function() {
const fileFilter = filter(['*', '!mixins.less', '!variables.less']);
gulp.src('./public/less/*.less') // path to less file
.pipe(fileFilter)
.pipe(plumber())
.pipe(less())
.pipe(gulp.dest('./public/css/')) // path to css directory
;
});
// Get vendors' code
gulp.task('build-vendors', function() {
gulp.src(['./public/components/bootstrap/less/theme.less', './public/components/bootstrap/less/bootstrap.less']) // path to less file
.pipe(plumber())
.pipe(less())
.pipe(rename(function (path) {
//rename all files except 'bootstrap.css'
if (path.basename + path.extname !== 'bootstrap.css') {
path.basename = 'bootstrap-' + path.basename;
}
}))
.pipe(gulp.dest('./public/css')) // path to css directory
;
});
// Run the build process
gulp.task('run', ['build-less', 'build-vendors']);
// Watch all LESS files, then run build-less
gulp.task('watch', function() {
gulp.watch('public/less/*.less', ['run'])
});
// Default will run the 'entry' task
gulp.task('default', ['watch', 'run']);
And here is the call and the output:
$ gulp
[11:21:03] Using gulpfile /var/www/path/to/project/gulpfile.js
[11:21:03] Starting 'watch'...
[11:21:03] Finished 'watch' after 21 ms
[11:21:03] Starting 'build-less'...
[11:21:03] Finished 'build-less' after 13 ms
[11:21:03] Starting 'build-vendors'...
[11:21:03] Finished 'build-vendors' after 4.65 ms
[11:21:03] Starting 'run'...
[11:21:03] Finished 'run' after 5.37 μs
[11:21:03] Starting 'default'...
[11:21:03] Finished 'default' after 6.05 μs
The whatch also works correctly -- when I edit my LESS files I get an output like this:
[11:22:22] Starting 'build-less'...
[11:22:22] Finished 'build-less' after 1.96 ms
[11:22:22] Starting 'build-vendors'...
[11:22:22] Finished 'build-vendors' after 1.78 ms
[11:22:22] Starting 'run'...
[11:22:22] Finished 'run' after 5.08 μs
I also tried to run the build-less directly:
$ gulp build-less
[11:24:06] Using gulpfile /var/www/path/to/project/gulpfile.js
[11:24:06] Starting 'build-less'...
[11:24:06] Finished 'build-less' after 13 ms
No errors, but also no changes at the CSS files.
What might go wrong here and how to fix it?
gulp-filter uses multimatch to match file paths against globbing patterns. The documentation for multimatch has this to say about *:
* matches any number of characters, but not /
Since you're trying to match files with paths like public/less/foo.less (which contain a /) using a single asterisk * doesn't work. You have to use two asterisks **:
gulp.task('build-less', function() {
const fileFilter = filter(['**/*', '!**/mixins.less', '!**/variables.less']);
gulp.src('./public/less/*.less') // path to less file
.pipe(fileFilter)
.pipe(plumber())
.pipe(less())
.pipe(gulp.dest('./public/css/')); // path to css directory
});

Mage_Selenium_Driver::doCommand() should be compatible with that of PHPUnit_Extensions_SeleniumTestCase_Driver

I am trying to configure Magento test automation framework on my system.
When I run phpunit in command line, I am getting following error. Same error I am getting while running test in the netbeans.
Strict Standards: Declaration of Mage_Selenium_Driver::doCommand() should
be compatible with that of PHPUnit_Extensions_SeleniumTestCase_Driver::doCommand()
in C:\MTAF\taf\lib\Mage\Selenium\Driver.php on line 38
..
Fatal error: Call to undefined method PHPUnit_Framework_TestSuite::isPublicTestMethod() in C:\MTAF\taf\lib\Mage\Selenium\TestCase.php on line 2502
Can some one please suggest some solution for the same.
I changed the code, this is the change I performed:
--- a/framework/Mage/Selenium/TestCase.php
+++ b/framework/Mage/Selenium/TestCase.php
## -409,7 +409,7 ## class Mage_Selenium_TestCase extends PHPUnit_Extensions_SeleniumTestCase
$testMethods = array();
$class = new ReflectionClass(self::$_testClass);
foreach ($class->getMethods() as $method) {
- if (PHPUnit_Framework_TestSuite::isPublicTestMethod($method)) {
+ if ($method->isPublic()) {
$testMethods[] = $method->getName();
}
}
I was getting this error when running phpunit >= 4.0. Downgrading to 3.7.x solved it for me.